Advertisement:

Author Topic: 100% Cpu usage  (Read 21676 times)

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
100% Cpu usage
« on: March 10, 2005, 12:20:20 AM »
I have 256mb of ram on my server, which is a P4 3ghz machine running fedora core 1 with PLESK. According to plesk I am using 100% of the cpu and all the ram. But when I run top, and status and show full processlist in mysql I do not see that much usage going on. I'm averaging about 40 users right now, no more than usual. But my usage has been 100% for over 5 hours, usually its around 60%. I've tried rebooting. I am using php 4.3.8 and mysql 4.0.23. Here are my stat pages:
http://www.goosemoose.com is the site
http://www.goosemoose.com/phpinfo.php
http://209.216.209.81/wistatus has apache stats
here is a recent top while maxed at supposedly at 100%
Quote
52 processes: 48 sleeping, 2 running, 2 zombie, 0 stopped
CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle
           total   22.0%    0.0%    6.4%   0.0%     0.0%    0.0%  370.8%
           cpu00   10.7%    0.0%    4.0%   0.0%     0.0%    0.0%   85.2%
           cpu01    2.2%    0.0%    0.2%   0.0%     0.0%    0.0%   97.5%
           cpu02    5.1%    0.0%    1.4%   0.0%     0.0%    0.0%   93.4%
           cpu03    3.3%    0.0%    0.7%   0.0%     0.0%    0.0%   95.9%
Mem:  8275180k av, 7762648k used,  512532k free,       0k shrd, 2159116k buff
      2936816k active,            3792868k inactive
Swap: 16386292k av, 1122200k used, 15264092k free                 2143924k cached

  PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND
 7122 apache    18   0     0    0     0 Z     1.7  0.0   0:00   0 httpd <defunct>
13282 root      13   0  1072 1072   740 R     1.1  0.0   0:06   0 top
20631 mysql      9   0 32628  31M  3444 S     0.1  0.3   0:19   0 mysqld
    1 root       8   0   460  460   412 S     0.0  0.0   0:04   1 init
21529 root       9   0   544  544   468 S     0.0  0.0   0:01   0 syslogd
21893 named      9   0  2520 2516  1940 S     0.0  0.0   0:01   1 named
22259 root       9   0  1524 1524  1392 S     0.0  0.0   0:01   3 sshd
25401 root       9   0  4984 4980  4828 S     0.0  0.0   0:03   2 httpsd
25811 root       8   0   580  580   508 S     0.0  0.0   0:01   3 crond
26003 root       9   0   684  684   588 S     0.0  0.0   0:00   0 saslauthd
28666 root       0   0 10904  10M 10748 S     0.0  0.1   1:11   1 httpd
20600 root       9   0   948  944   816 S     0.0  0.0   0:00   0 safe_mysqld
 7698 psaadm     9   0     0    0     0 Z     0.0  0.0   0:00   3 httpsd <defunct>
 3232 root       9   0  2296 2292  1856 S     0.0  0.0   0:00   0 sshd
 3980 root       9   0  1168 1168   972 S     0.0  0.0   0:00   3 bash
 7595 qmailr     9   0   344  340   260 S     0.0  0.0   0:00   1 qmail-rspawn
12929 qmailr     9   0   956  952   772 S     0.0  0.0   0:00   3 qmail-remote

Here is mysql status
Quote
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6206 to server version: 4.0.23a

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> status;
--------------
mysql  Ver 12.22 Distrib 4.0.23a, for pc-linux-gnu (i686)

Connection id:          6206
Current database:
Current user:           dmaricic@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Server version:         4.0.23a
Protocol version:       10
Connection:             Localhost via UNIX socket
Client characterset:    latin1
Server characterset:    latin1
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 5 hours 54 min 8 sec

Threads: 1  Questions: 219050  Slow queries: 99  Opens: 2055  Flush tables: 1  Open tables: 64  Queries per second avg: 10.309

Here is SHOW FULL PROCESSLIST (it pretty much stays like this 99% of the time)
Quote
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6232 to server version: 4.0.23a

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW FULL PROCESSLIST;
+------+----------+-----------+-----------------+---------+------+-------+-----------------------+
| Id   | User     | Host      | db              | Command | Time | State | Info                  |
+------+----------+-----------+-----------------+---------+------+-------+-----------------------+
| 6231 | dmaricic | localhost | goosemoose3_com | Sleep   | 5    |       | NULL                  |
| 6232 | dmaricic | localhost | NULL            | Query   | 0    | NULL  | SHOW FULL PROCESSLIST |
| 6234 | dmaricic | localhost | goosemoose3_com | Sleep   | 0    |       | NULL                  |
+------+----------+-----------+-----------------+---------+------+-------+-----------------------+
3 rows in set (0.00 sec)


Anyone understand what here could be causing 100% usage of cpu and memory?

Thanks
« Last Edit: March 10, 2005, 12:29:32 AM by goosemoose »

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: 100% Cpu usageb
« Reply #1 on: March 10, 2005, 12:26:23 AM »
What are your load averages?

Full memory usage, especially with only 256 megs, is normal and not alarming.

-[Unknown]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: 100% Cpu usageb
« Reply #2 on: March 10, 2005, 12:29:15 AM »
My current load averages are:
load average: 0.31, 0.90, 1.43
although they were averaging 3-6 earlier.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: 100% Cpu usage
« Reply #3 on: March 10, 2005, 12:30:41 AM »
That may be where it's getting it from.  Was this half an hour ago?  If so, it might have been midnight server time, which suggests many things might be scheduled for right them - e.g. updatedb.

-[Unknown]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: 100% Cpu usage
« Reply #4 on: March 10, 2005, 12:31:58 AM »
The 100% cpu and memory usage has been going on for about 5 hours. The machines are also pacific time so its only 9:30 here.

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: 100% Cpu usage
« Reply #5 on: March 10, 2005, 12:32:33 AM »
Currently memory is only using 50%, but the cpu is still at 100%

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: 100% Cpu usage
« Reply #6 on: March 10, 2005, 12:38:18 AM »
Well, 0.31 isn't that horrid or anything, but it's not awesome.

You do have defunct processes.  Try restarting Apache, MySQL, and etc.

-[Unknown]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: 100% Cpu usage
« Reply #7 on: March 10, 2005, 12:41:07 AM »
I've done all that. The problem resumes. How can you tell their are defunct process. And does the top seem to equal 100% usage? I look at things from a windows perspective since I'm a windows admin, and I was ripping into my host for things only adding up to 20% usage or so, even though plesk shows 100%.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: 100% Cpu usage
« Reply #8 on: March 10, 2005, 01:11:18 AM »
52 processes: 48 sleeping, 2 running, 2 zombie, 0 stopped

7122 apache    18   0     0    0     0 Z     1.7  0.0   0:00   0 httpd <defunct>

Zombies are not good things to be waltzing about.  However, the Apache status doesn't suggest that high of load:

http://209.216.209.81/wistatus

I do notice you're still on RC2..... but still, you shouldn't be having these sorts of server problems, especially with just 23 users online.

But, Windows isn't Linux.  Linux generally utilizes ram as well as possible, because swap is obviously slow.  I'm not the best expert on Linux, though, although I can guess from your specs that a bit more ram might help.

-[Unknown]

Offline Goosemoose

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,400
  • Gender: Male
    • Goosemoose.com
Re: 100% Cpu usage
« Reply #9 on: March 10, 2005, 01:19:24 AM »
I'm actually using 1.0.1 but I'm using an older mambo bridge and I haven't updated the files in the bridge.

Offline Ben_S

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,725
  • xxx
Re: 100% Cpu usage
« Reply #10 on: March 10, 2005, 11:21:18 AM »
What is it thats telling you your cpu useage is at 100%?

Your top output shows the cpu to be pretty nothing.
Liverpool FC Forum with 14 million+ posts.