Pages

Thursday, 24 October 2013

Internal server error(Cloud linux server)

Symptoms: Internal server error while accessing the website.

The apache error log will be similar to the following:
=====
Cannot allocate memory: couldn't create child process: /opt/suphp/sbin/suphp for /home/abcd/public_html/index.php, referer: http://www.abcd.com/
 =====


From the logs, we can understand that the issue is due to lack of memory. So, we need to check the memory usage of the cPanel user. The following command will show the cPanel users which are affected by memory limits. 



lveinfo --by-fault=mem --display-username

Sample output is given below:


===
root@test [~]# lveinfo --by-fault=mem --display-username
ID aCPU mCPU lCPU aEP mEP lEP aVMem mVMem lVMem aPMem mPMem lPMem EPf VMemF PMemF
abcd 0 0 12 0 0 20 672.5M 1.1G 1.1G 153.6M 153.6M 1.1G 0 4 0
root@test [~]#
===



a-average
m-maximum
l-limit
VMem - virtual memory

The values will refresh every minute. If it doesn't, then it means that virtual memory is cached somewhere.

We can clear the cache temporarily using the command given below.

for i in `ipcs -m|grep <user> |awk '{print $2}'`; do ipcrm -m $i; done

Note: please replace <user> with the correct cPanel username.


Sample output is given below:

===
root@test [~]# for i in `ipcs -m |grep abcd |awk '{print $2}'`; do ipcrm -m $i; done
root@test [~]#
===




No comments:

Post a Comment