1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can anyone please help me make sense of this?

Discussion in 'Site & Server Administration' started by glasshoper, Apr 17, 2007.

  1. #1
    My site is very slow reaching almost 100% CPU; through shell i found this. But i don't know what these means. How can i relate the PID with specific files? Any help will be highly appreciated.

    [root@dedicated ~]# top
    top - 15:55:37 up 26 days, 13:41, 2 users, load average: 42.93, 42.98, 42.98
    Tasks: 376 total, 43 running, 332 sleeping, 0 stopped, 1 zombie
    Cpu(s): 98.7% us, 1.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si
    Mem: 514924k total, 501824k used, 13100k free, 22728k buffers
    Swap: 2096472k total, 886580k used, 1209892k free, 61708k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    814 apache 25 0 23812 8024 3668 R 3.6 1.6 4:59.57 httpd
    11254 apache 25 0 23820 4604 3728 R 3.3 0.9 76:11.60 httpd
    16227 apache 25 0 24336 4844 3976 R 3.3 0.9 24:15.46 httpd
    19609 apache 25 0 23832 4612 3724 R 3.3 0.9 34:34.90 httpd
    20591 apache 25 0 23872 4664 3792 R 3.3 0.9 26:51.95 httpd
    22710 apache 25 0 23752 4648 3772 R 3.3 0.9 25:27.06 httpd
    22736 apache 25 0 23880 4608 3732 R 3.3 0.9 19:28.81 httpd
    23703 apache 25 0 23856 4664 3788 R 3.3 0.9 23:32.68 httpd
    24618 apache 25 0 23912 4660 3792 R 3.3 0.9 16:13.84 httpd
    26777 apache 25 0 23848 4592 3724 R 3.3 0.9 18:02.03 httpd
    29543 apache 25 0 23892 4608 3732 R 3.3 0.9 17:04.23 httpd
    949 apache 25 0 23872 4596 3712 R 3.3 0.9 14:50.28 httpd
    1333 apache 25 0 23844 4596 3720 R 3.3 0.9 14:32.26 httpd
    2716 apache 25 0 23772 4524 3608 R 3.3 0.9 13:57.96 httpd
    2968 apache 25 0 23804 4592 3700 R 3.3 0.9 13:46.46 httpd
    3376 apache 25 0 23924 4608 3732 R 3.3 0.9 12:24.16 httpd
    3823 apache 25 0 23916 4660 3784 R 3.3 0.9 12:51.87 httpd
    4998 apache 25 0 23884 5128 3760 R 3.3 1.0 12:39.09 httpd
    6023 apache 25 0 23924 4684 3820 R 3.3 0.9 11:47.81 httpd
    6926 apache 25 0 23964 4676 3800 R 3.3 0.9 11:43.23 httpd
    7119 apache 25 0 23904 4648 3768 R 3.3 0.9 11:50.71 httpd
    8802 apache 25 0 23900 4604 3728 R 3.3 0.9 11:06.53 httpd
    10395 apache 25 0 23812 4572 3672 R 3.3 0.9 10:52.72 httpd
    29982 apache 25 0 23920 6328 3792 R 3.3 1.2 5:11.56 httpd
    32270 apache 25 0 23828 5340 3680 R 3.3 1.0 5:12.20 httpd
    495 apache 25 0 23932 8212 3724 R 3.3 1.6 4:57.64 httpd
    1330 apache 25 0 23928 8196 3688 R 3.3 1.6 4:56.35 httpd
    1801 apache 25 0 23756 7760 3592 R 3.3 1.5 4:50.04 httpd
    1965 apache 25 0 23832 8212 3780 R 3.3 1.6 4:32.50 httpd
    25889 apache 25 0 23964 7764 3800 R 2.0 1.5 5:23.91 httpd
    1252 root 17 0 2908 1080 732 S 0.7 0.2 6:49.99 top
    25869 root 17 0 3164 1148 760 R 0.3 0.2 0:04.83 top
    1 root 16 0 2456 464 436 S 0.0 0.1 0:03.83 init
    2 root 34 19 0 0 0 S 0.0 0.0 0:00.38 ksoftirqd/0
    3 root 5 -10 0 0 0 S 0.0 0.0 0:00.32 events/0
    4 root 5 -10 0 0 0 S 0.0 0.0 0:00.01 khelper
    5 root 15 -10 0 0 0 S 0.0 0.0 0:00.00 kacpid
    19 root 5 -10 0 0 0 S 0.0 0.0 0:00.06 kblockd/0
    40 root 12 -10 0 0 0 S 0.0 0.0 0:00.00 aio/0
     
    glasshoper, Apr 17, 2007 IP
  2. agnivo007

    agnivo007 Peon

    Messages:
    4,290
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Which version of apache are you running ? (type httpd --version)

    The culprit is apache spawning too much child processes that remain spare(inactive) even when they are not in use...(MaxSpareServers in httpd.conf)

    Also seems to me that an old version of apache causing memory leaks...
     
    agnivo007, Apr 17, 2007 IP
  3. glasshoper

    glasshoper Peon

    Messages:
    373
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yaar, apache version is 2.0.59

    how do i fix them?
     
    glasshoper, Apr 17, 2007 IP
  4. Artisan

    Artisan Well-Known Member

    Messages:
    611
    Likes Received:
    32
    Best Answers:
    1
    Trophy Points:
    128
    #4
    Most probably you have something like the infinite cycle somewhere in your PHP code thus you should check the code which you have placed on the site just prior to this CPU usage surge.
     
    Artisan, Apr 17, 2007 IP