Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I host a wordpress site on my server which has 2GB mem, I have used some cache plugin, but when I type ps -eo "%C : %p : %z : %a" | sort -k5 -nr in SSH, I see the httpd memory usage is very high.

15.7 :  3131 : 4732740 : /usr/local/mysql/bin/mysqld
 0.5 :  3356 : 515860 : /usr/sbin/httpd
 0.6 :  3363 : 509308 : /usr/sbin/httpd
 0.6 :  3333 : 509308 : /usr/sbin/httpd
 0.5 :  3367 : 509308 : /usr/sbin/httpd
 0.5 :  3361 : 509308 : /usr/sbin/httpd
 0.5 :  3358 : 509308 : /usr/sbin/httpd
 0.5 :  3338 : 509308 : /usr/sbin/httpd
 0.4 :  3366 : 509308 : /usr/sbin/httpd
 0.3 :  3370 : 509308 : /usr/sbin/httpd
 0.3 :  3359 : 509308 : /usr/sbin/httpd
 0.0 :  3193 : 410980 : /usr/sbin/httpd
 ...

The server always dead. I have set memory in php.ini like this:

memory_limit = 768M
memory = 20M

Thanks for read.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Main reason for your server load is due to memory_limit (768M) of php.ini. As your server has only 2GB ram could not able to handle if more http request made into the server leads of multiple connection of php that consume more memory. so, i suggest you to decrease the global php.ini memory_limit to optimal that is below 200M to control the load.

share|improve this answer
    
1 httpd cost 50MB, if I set below 200M in php.ini, that mean my site only support 4 ips at one time? –  fish man Jan 19 '13 at 8:19
    
There is no relation between php memory_limit to ip connection. Php memory_limit is for the memory of php website, whereas the connection limit are defined in httpd.conf –  Mughil Jan 19 '13 at 14:59
    
how many memory_limit is better? you tell me below 200M but in some blog, i saw somebody say 1/4 of total server. Do you have some authoritative article? –  fish man Jan 20 '13 at 9:59
    
Memory is not that expensive today, maybe it is time to add some... –  vonbrand Jan 21 '13 at 18:08
add comment

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.