On 1/17/2011 4:23 PM, Grant wrote:
I think the idea is never use swap if possible, but in a case where
you don't have swap space or run out of swap space I think it's still
possible to lose data.

Isn't swap just an extension of system memory?  Isn't adding 4GB of
memory just as effective at preventing out-of-memory as dedicating 4GB
of HD space to swap?  I can understand enabling swap on a laptop or
other system with constrained memory capacity, but doesn't it make
sense to disable swap and add memory on a 24GB server?

Is swap basically a way to save money on RAM?

Most users won't willingly trades 4ns data access for 13ms data access. I'd say swap in that situation is a way to gracefully degrade performance so that a user or admin can decide what to do. And yes in some cases that graceful part isn't. In my experience swap has allowed me to log in, kill runaway processes, then shut down the database gracefully to make sure all data was saved. I tend not to configure more than 2-4GB these days on servers. The other thing to remember is alerting on 98% RAM usage under Linux is a not starter because Linux will shove everything into RAM until it's full. However alerting on 5% swap usage does work fairly well.

kashani

Reply via email to