1
             total       used       free     shared    buffers     cached
Mem:          1024       1020          3          0          0        859
-/+ buffers/cache:        160        863

With 863 "free" for programs, everything is getting memory issues. All webpages have

Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0

How can I figure out what the hell is eating up 859mb of memory in the cache and free it up?

I'm using nginx with php-fpm and mysql.

11
  • 2
    That's probably not the problem. What is your php-fpm configuration for your pool? And, is this an OpenVZ VPS? Jul 13, 2012 at 0:24
  • First of all find out who exactly is using most of your memory. Use top or ps.
    – golja
    Jul 13, 2012 at 0:24
  • Its a vps provided by my hosting, thats all that I know. What would you like to know about the php-fpm configuration? I have it set to dynamic, 10 max, 5 start, 3 spare min, 8 spare max. (I could go higher, but I dont see the need with the current load). I ran a load test with 500 concurrent connections earlier today after I changed the settings and it worked fine.
    – iargue
    Jul 13, 2012 at 0:29
  • Your php-fpm settings sound fine. First try restarting php-fpm. If you still have this same trouble, it's probably a problem with the hosting provider. This is why I won't touch OpenVZ-based VPSes with a ten foot pole... Jul 13, 2012 at 0:38
  • 2
    Linux is supposed to be using all the free memory as disk cache. This is not something you can (or even should) turn off. IF a program actually needs the memory, it will be able to get it - unless you're using an OpenVZ VPS. Jul 13, 2012 at 1:15

1 Answer 1

1

The issue was with APC. I was using the full 64mb of the cache. I increased it to 120mb and everything seems to be working smoothly now.

For anyone else having this issue, to increase your cache size, go to php.ini (or php.d directory and find apc.ini if it exists) and add or change

apc.shm_size=64M 

To whatever the value that you want it to be.

1
  • I'd accept this answer so people can view it as part of the wiki in the future.
    – Matthew
    Jul 13, 2012 at 19:14

You must log in to answer this question.

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