Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

One of my servers is crashing once in a few days.

It does web serving + some background jobs like XML file processing.

If you look at the screenshot http://awesomescreenshot.com/075xmd24 you'll see that the server swaps although it has lots of free memory. Why does this happen? Why doesn't the OS use the free mem instead of swapping ?

The web serving is low traffic (maybe it has high load when google crawls it)

Server details: Ubuntu 11.10 oneiric i386 scalarizr (0.7.185) python 2.7.2, chef 0.10.8, mysql 5.1.58, apache 2.2.20, php 5.3.6, memcached 1.4.7 Amazon EC2 (us-west-1)

Thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The kernel swaps less active pages proactively, instead of needing to do reactive swapping when physical RAM is completely full and an application needs to be blocked waiting for memory to be freed via swapping.

You can mess with the swappiness kernel parameter, but do not do so unless the swapping behavior is causing problems - with additional evidence, there's no reason to assume that the use of swap is related to the crashing in any way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.