-2

I'm using a VPS for some computationally heavy tasks but not to host a publicly-facing website. The author of the application I'm using recommends running the jar with 8GB of RAM, but adding those physical resources to my instance would quadruple the hourly cost of running the server.

I have a lot of free space on the instance's SSD. Is it feasible to create a large (8GB) swap file in order to increase the effective memory for computation? Someone wrote in another answer that swapping to SSD is an order of magnitude slower than RAM. I only use this server for offloading computing from my personal machine. Being billed by the hour, I can therefore kill the instance the moment I have my results.

If increasing RAM would cost 4x more, would using swap instead take 10x longer and therefore cost 10x more?

4
  • What's the impact of performance drop on your business?
    – Chopper3
    Jul 8, 2015 at 14:43
  • It's for research calculations, so that I can run these detached from my personal computer.
    – raphael
    Jul 8, 2015 at 15:03
  • You're asking us whether you should spend money (RAM), or time (swap). How can we know which of these is more valuable to you?
    – MadHatter
    Jul 8, 2015 at 15:28
  • Editing the question to better explain this, since on a VPS billed hourly, time = money
    – raphael
    Jul 8, 2015 at 16:41

1 Answer 1

2

I would not recommend using the swap space. This will delay everything running on the server (SSH, etc.). Besides it is more than 10x slower than actual RAM (link). I recommend going for either more RAM or limiting the application memory usage (depends on the application)

2
  • It depends on how the appl uses the memory, if it is not using all 8 GB all the time, then maybe it will be OK with swap. I wouldn't try it on rotational HDD, but as you have SSD (which is quite faster than HDD, but still magnitude slower than RAM) you can give it a try...
    – Marki555
    Jul 8, 2015 at 14:44
  • What I was trying to ask was whether I can get away with having too few RAM with a lot of swap. Sounds like the answer is mostly "NO", but it depends on the application.
    – raphael
    Jul 8, 2015 at 17:13

Not the answer you're looking for? Browse other questions tagged .