The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

very less ram

Discussion in 'General Discussion' started by abhilashtt01, Oct 7, 2011.

  1. abhilashtt01

    abhilashtt01 Member

    Joined:
    Oct 13, 2010
    Messages:
    14
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    I am having centos server with ffmpeg installed. This is used as our main shared server. Server is having 12GB ram.
    I can see that there is very less free memory in the server which causes the server crash.

    When the free memory reduces to less than 100, I used to clear the cache memory. Always there will be nearly 6GB cache memory.
    But when the free memory is exhasted, server crashes.


    Now I have upgraded the ram to 24Gb. Still experiencing same issues. We are having r1soft backup running in the server.

    ============================================
    31133 mysql 15 0 3355m 1.7g 5408 S 47.1 7.0 39:09.64 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=m
    78710 root 15 0 372m 17m 1928 S 27.2 0.1 49:32.93 /usr/sbin/r1soft/bin/cdp -s -c /usr/sbin/r1soft/conf/agent_con
    458812 user 16 0 217m 32m 15m D 12.9 0.1 0:06.10 /usr/bin/php /home/user/public_html/cron/grabDeals.php
    383013 xuser 15 0 45940 5236 1216 S 7.3 0.0 1:09.62 wget -r -A mp3,avi,3gp,sis,sisx,nth,thm,jar,jad,mp4,jpg,gif,pn
    368903 xuser 15 0 45860 5036 1216 R 7.0 0.0 1:57.80 wget -r -A mp3,avi,3gp,sis,sisx,nth,thm,jar,jad,mp4,jpg,gif,pn
    459005 user 15 0 211m 34m 24m S 5.6 0.1 0:00.17 /usr/bin/php /home/user/public_html/wp-content/plugins/gen
    458999 user1 15 0 0 0 0 Z 5.3 0.0 0:00.16
    PHP:
     <defunct>                                               
     
    459004 user1  15   0     0    0    0 Z  4.0  0.0   0:00.12 [php] <defunct>                                               
      
    79950 root      15  -1     0    0    0 S  3.0  0.0   1:05.69 [hcp_copy/1/7]   

    ============================================

    Any ideas why the memory gets exhausted..???
     
  2. Eric

    Eric Administrator
    Staff Member

    Joined:
    Nov 25, 2007
    Messages:
    746
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Texas
    cPanel Access Level:
    Root Administrator
    Howdy,

    The ps output you posted has a lot of items that could be the cause of your ram use. wget with -r uses a LOT of memory and I see two running. Also find out why those php processes are going defunct. PHP could be creating a coredump which will use a lot of memory.

    You could stop the kernel from caching so much by forcing it to dump memory now and again.

    Code:
    sync; echo 3 > /proc/sys/vm/drop_caches
    
    Should do it.

    Thanks!
     
  3. abhilashtt01

    abhilashtt01 Member

    Joined:
    Oct 13, 2010
    Messages:
    14
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    Thank you for your reply.

    but our 24Gb ram is getting drained very quickly. I have already done

    sync; echo 3 > /proc/sys/vm/drop_caches

    I am not sure how this much memory is lost.... When I check the defunct process, its already dead. Cant locate wtih PID.

    today also same issues happended twice

    ================================================

    ks: 540 total, 3 running, 535 sleeping, 0 stopped, 2 zombie
    Cpu(s): 6.7%us, 2.6%sy, 0.7%ni, 65.3%id, 24.4%wa, 0.0%hi, 0.2%si, 0.0%st
    Mem: 24625292k total, 24553052k used, 72240k free, 19359248k buffers
    Swap: 14352376k total, 228k used, 14352148k free, 2587544k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    131628 mysql 15 0 2634m 459m 4760 S 42.4 1.9 1:06.66 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=m
    135472 user1 16 0 213m 35m 20m S 14.6 0.1 0:00.44 /usr/bin/php /home/user1/public_html/index.php
    113646 root 33 18 122m 28m 3504 D 11.6 0.1 0:45.39 cpanellogd - updating bandwidth for domain
    135470 user2 17 0 211m 29m 17m S 7.0 0.1 0:00.21 /usr/bin/php /home/user2/public_html/user.com/index.php
    135481 user3 15 0 211m 34m 24m S 6.0 0.1 0:00.18 /usr/bin/php /home/user2/public_html/wp-content/plugins/gen
    135476 user 15 0 0 0 0 Z 4.6 0.0 0:00.14
    PHP:
     <defunct>                                               
     
    135484 user  15   0  208m  33m  24m S  4.6  0.1   0:00.14 /usr/bin/php /home/user2/public_html/index.php             
     135451 user    17   0  207m  17m 9752 S  3.6  0.1   0
    :00.18 /usr/bin/php /home/user/public_html/view_video.php          
      94368 root      18   0  178m 117m  696 D  3.3  0.5   0
    :51.25 /sbin/quotacheck -user -F vfsv0                             
     135432 userm  16   0  206m  17m  10m D  2.6  0.1   0
    :00.15 /usr/bin/php /home/userm/public_html/abercrombieparisoutlet
     135479 user41  18   0  205m  14m 8012 D  2.0  0.1   0
    :00.06 /usr/bin/php /home/user41/public_html/index.php             
     135480 user31  18   0  185m  14m 8092 D  2.0  0.1   0
    :00.06 /usr/bin/php /home/user31/public_html/search_result.php     
     135482 usert2  18   0  205m  14m 8252 D  2.0  0.1   0
    :00.06 /usr/bin/php /home/user2/public_html/404.php               
     135483 user32  18   0  205m  14m 8264 D  2.0  0.1   0
    :00.06 /usr/bin/php /home/user32/public_html/user.net/watc
     135485 user23  15   0  205m  15m 9272 D  2.0  0.1   0
    :00.06 /usr/bin/php /home/user23/public_html/www.user.org/inde
    ============================================================
    ----------------------------------------
     
  4. cwalke32477

    cwalke32477 Well-Known Member

    Joined:
    Mar 2, 2010
    Messages:
    94
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Atlanta, Georgia
    cPanel Access Level:
    Root Administrator
    How many sites is your server hosting? How do you have /etc/my.cnf configured?
    Are you using any page caching techniques? What about SPI firewalls with massive amounts of iptables?
    It's all a balancing act. Security/cpu/disk io/ram/number of accounts. In order to save your RAM, you may need to sacrifice some cpu or disk io. However, based on your wa% your io wait is getting a bit on high side. I've also noticed you have alot of processes, but most of which are sleeping.
     
    #4 cwalke32477, Oct 11, 2011
    Last edited: Oct 11, 2011
  5. minosjl

    minosjl Well-Known Member

    Joined:
    Jun 4, 2011
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    Root Administrator
    hi ,

    I think your php scripts are not detaching the used memory.Thats why you have high usage of RAM.Check your domains home directories for core dumb files.If you have any inspect these files and modify your php scripts accordingly.
     
  6. abhilashtt01

    abhilashtt01 Member

    Joined:
    Oct 13, 2010
    Messages:
    14
    Likes Received:
    1
    Trophy Points:
    1
    Location:
    India
    cPanel Access Level:
    Root Administrator
    @cwalke32477 , we have hosted nearlty 300 accounts on this server. My.cnf can be veiwed at
    #3009881 - Pastie

    We are not using any page caching techniques. We are using csf firewall in our server.

    =================


    root@server [~]# iostat
    Linux 2.6.18-338.19.1.el5.lve0.8.36 (server.com)

    avg-cpu: %user %nice %system %iowait %steal %idle
    8.29 3.60 4.76 3.24 0.00 80.12

    Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
    sda 204.68 6809.32 1860.19 52012603766 14208930538
    sda1 0.00 0.03 0.00 231014 3330
    sda2 204.68 6809.28 1860.19 52012364368 14208927208
    dm-0 789.37 6809.25 1860.05 52012084098 14207881568
    dm-1 0.02 0.04 0.14 279352 1045640
    ======================
    Is there anyway to have a permanent fix to this. I have killed sleeping process still its coming. How can we prevent this?
     
Loading...

Share This Page