We are getting out of memory frequently, as well fork cannot allocate memory. I did some investigation.
It seems that scripts are not case as I thought before this. I will share information which I get after analyzing.
I have isolated server, so other people cant reach to server. This will show "true" memory usage in this case.
- I have no mysqld and apache started [memory usage ~182mb].
- just started mysqld. no connections made to mysqld [mu ~340mb].
- httpd started [~360mb].
- first request to script. [~630mb]. But!! The most interesting part. Memory doesn't get deallocated. Everything looks OK. Script ended, page loaded successfuly. But it still around ~630mb.
Why one request eats 270MB? Why thats not deallocated after request?
- Server RAM 512 MB guaranteed
- 256 MB burstable
- PHP memory limit: 256MB
<IfModule prefork.c> StartServers 1 MinSpareServers 1 MaxSpareServers 3 ServerLimit 50 MaxClients 50 MaxRequestsPerChild 50 </IfModule>