PostgreSQL on ephemeral storage Is there any safe way to use ephemeral storage (deleted on halt) for postgresql cluster?
Use it for system swap space.   Swapping doesn't hurt performance, running out of memory hurts performance. swapping is just a symptom.

You could also try putting unlogged temporary tables there but I'm not sure what would happen when they disappear.