Project

General

Profile

Actions

Bug #354

closed

CPU reached 99%

Added by Anonymous over 18 years ago. Updated about 17 years ago.

Status:
Fixed
Priority:
High
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

I use MRTG monitoring all my web servers (traffice & CPU), but CPU usage sometimes reached 99% on MRTG. Here is "top" cmd capture:

top - 21:28:23 up 186 days, 16:38, 1 user, load average: 1.03, 1.01, 1.00
Tasks: 77 total, 2 running, 75 sleeping, 0 stopped, 0 zombie
Cpu(s): 34.0% us, 66.0% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 906324k total, 897252k used, 9072k free, 382992k buffers
Swap: 979892k total, 31800k used, 948092k free, 312104k cached

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                    
22897 wwwrun 25 0 5968 4856 980 R 99.2 0.5 250:06.48 lighttpd
23887 wwwrun 16 0 71780 7508 6332 S 0.3 0.8 0:00.67 php
1 root 16 0 668 228 200 S 0.0 0.0 0:00.80 init
2 root 34 19 0 0 0 S 0.0 0.0 0:01.49 ksoftirqd

My web server OS is : Linux 2.6.11.7
Lighttpd: 1.4.6
php (fastcgi): 5.0.3
traffic about: 2~3Mbits

Even the CPU "reaches" 99%, but it doesn't affect webpages loading speed. I am wondering it could be just "displaying" bug.
i use "ps -aux" and got different result:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
wwwrun 22897 10.9 0.5 5968 4856 ? R Nov04 267:11 /usr/local/lighttpd/sbin/lighttpd -f /etc/lighttpd.conf
wwwrun 22899 0.0 0.2 71368 2316 ? Ss Nov04 0:00 /usr/local/php5/bin/php

Though it doesn't effect the service, it looks quite ugly. :)

Kenny

-- kenny


Files

cpu.png (2.05 KB) cpu.png Anonymous, 2005-11-05 13:54
cpu_week.png (4.07 KB) cpu_week.png Anonymous, 2005-11-29 11:50
Actions #1

Updated by Anonymous over 18 years ago

I seem to be having similar problems with 1.4.4,6,7,8.
I tried chenging the event handlers (poll, epoll, rtsig) didn't help.
I added fam to see if that makes any difference. Did not. Also tried "simple" stat-caching (made no diff).
I have no PHP on this box. Just plain and simple image serving. Great many small files. One page usually has 50-200 small thumbnails on them. This box server only the images for it.

One CPU is totally loaded. (running HT so it's really just half of the CPU)

-- oscar

Actions #2

Updated by Anonymous over 18 years ago

I have this same problem. Using lighttpd 1.4.8 , however it only happens after a week or two of use. Then lighttpd will use 99% of the cpu usage. Simply restarting lighttpd fixes this problem though.

-- tribunal

Actions #3

Updated by Anonymous about 18 years ago

I don't see this error message in my logs and I do have this CPU problem.
They may not be connected.

-- oscar

Actions #4

Updated by Anonymous about 18 years ago

I have this problem just serving up static web images.

-- tribunal

Actions #5

Updated by Anonymous almost 18 years ago

I too have this problem based on lighttpd-1.4.11. My machine is solely serving static images at a very high rate - no dynamic content whatsoever.

After several hours under this load on a box, the cpu usage goes way up. Memory does seem to creep up too - but not that rapidly. Eventually, one of the cpus is saturated at 100%, though images still seem to serve quickly.

User time and system time are pretty evenly split. The only thing I have found is that running a cumulative strace -a -p <pid> reveals that the average time for a call to epoll_ctl() has doubled from 5us to 10us. The first sample is when lighttpd is running stable at about 40% CPU usage. The second sample is when lighttpd is taking 99%.

Restarting lighttpd does make the problem go away temporarily, but it usually returns within hours.

My config is:
AMD64, dual core opteron, 8GB RAM
linux 2.6.9-34.ELsmp, the RedHat Enterprise 4 frankenkernel, 64bit

I should add that I have a custom build of lighttpd with source changes, but my changes do not affect the in the main event loop. I do have some plans to test on a more recent 2.6.x kernel.

-- msolo

Actions #6

Updated by jan over 17 years ago

  • Status changed from New to Fixed
  • Resolution set to fixed
Actions #7

Updated by Anonymous about 17 years ago

Actions

Also available in: Atom