I have a vps running Ubuntu 10.04 with nginx as my webserver. I use APC for php caching and I noticed my server is doing lots of disk queries which resulted me having slower I/O. I have about +50 sites running on my vps and all are running wordpress. The vps has 2GB RAM with 2GB SWAP. I notice APC has used 100% fragments. You can see my apc stats here http://negima.nu/apc.php

Could anyone help me optimize APC? cause it's causing slow I/O

top - 09:34:24 up 2 days, 22:02,  1 user,  load average: 0.39, 0.41, 0.32
Tasks:  25 total,   1 running,  24 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.3%us,  0.9%sy,  0.0%ni, 95.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   4194304k total,   849228k used,  3345076k free,        0k buffers
Swap:        0k total,        0k used,        0k free,        0k cached

You gave the APC cache 2GB of RAM, but your VPS only has 2GB of RAM! Therefore the system must swap in order to do anything at all.

To resolve the problem, reduce the size of the APC cache, or add more RAM.

  • but it's not using 2GB RAM when I look at top. It's currently using 800mb ram – Ruriko Jan 29 '14 at 5:34
  • 1
    Looks like you made the mistake of using an OpenVZ VPS. You can't really trust the memory output shown by free or top in this case. – Michael Hampton Jan 29 '14 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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