Too Much Swapping, even though RAM is 2/3 Empty

Posted by indyaah on Super User See other posts from Super User or by indyaah
Published on 2012-11-20T23:04:04Z Indexed on 2012/11/20 23:05 UTC
Read the original article Hit count: 119

Filed under:
|
|
|
|

I have a VPS with 9GB RAM, 300GB HDD, 3 GB Swap, 7 Cores. The OS is CentOS 5.7 Final.

I have postgres9.0 running on my machine, with proper tuning done (at least by book/wiki of PostgreSQL).

What happens is most of the times when some complex query run (by complex I mean select with maximum 3 Joins), eventhough 66% of my RAM is unused there is ~99% swapping is happening.

Plus it screws up my disk IO which is most of the time reaching ~100% and slows down everything else. (I tend to believe something's wrong with my disk.)

I dont understand the reason of this much of swapping happening. Is it because of context switching?? Most of the time my processors are idle, while the IO wait goes upto 30% during pick times.

Would appreciate if some can shed some light on it.

Thanks.

© Super User or respective owner

Related posts about hard-drive

Related posts about memory