Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-30-2011, 01:57 PM
|
#1
|
Member
Registered: Nov 2010
Posts: 38
Rep: 
|
apache high cpu load on high traffic
i have a Intel Quad Core Xeon X3440 (4 x 2.53GHz, 8MB Cache, Hyper Threaded) with 16gig and 1tb harddrive with a 1gb port and my apache is causing my cpu to go up to 100% on all four cores heres my http.config
<IfModule prefork.c>
StartServers 10
MinSpareServers 10
MaxSpareServers 15
ServerLimit 1000
MaxClients 1000
MaxRequestsPerChild 5000
</IfModule>
<IfModule worker.c>
StartServers 35
MaxClients 200
MinSpareThreads 30
MaxSpareThreads 305
ThreadsPerChild 255
MaxRequestsPerChild 0
</IfModule>
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 800
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 2
|
|
|
10-02-2011, 12:39 AM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Can you post the output of top for the machine in a busy time period,
preferably w/ threads turned on(man top; /threads)?
Cheers,
Tink
|
|
|
10-02-2011, 02:24 AM
|
#3
|
Member
Registered: Sep 2011
Posts: 52
Rep: 
|
Are your websites using PHP? Most likely you have some bad php script or someone abuses it.
You can also check the active connections to apache using mod_status to see whatever is running at the time of the high cpu usage
RMI
Last edited by zackwasa; 01-12-2012 at 01:10 AM.
|
|
|
10-02-2011, 07:44 AM
|
#4
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,151
|
Certainly, Apache most often uses trivial amounts of CPU. You have a very capacious machine. Look at the Apache logs for any clues as to what the requests might be asking Apache to do.
|
|
|
10-02-2011, 11:14 PM
|
#5
|
Member
Registered: Nov 2010
Posts: 38
Original Poster
Rep: 
|
this is a screenshot of my htop on a busy day busy ill say 400 people online http://i.imgur.com/q4NW4.png
|
|
|
10-03-2011, 01:09 PM
|
#6
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by awww
|
Looking at that shot (of htop's output, which doesn't show iowait)
I'd say the CPUs are bored out of their tree on each individual task,
and I'll hazard the guess that the I/O subsystem of your MySQL
database is the bottleneck in this scenario. What exactly ARE you
running on the machine, what is the hard-disk subsystem (controller
type, how many disks, which raid level,...)?
Cheers,
Tink
|
|
|
10-03-2011, 09:25 PM
|
#7
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,365
|
Quote:
Originally Posted by Tinkster
I'd say the CPUs are bored out of their tree on each individual task,
|
Say what ?. They're all running flat out - mainly userspace code.
I wonder if the sort has been inverted. @awww hit F4 to check the sort of the CPU%.
|
|
|
10-03-2011, 09:59 PM
|
#8
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally Posted by syg00
Say what ?. They're all running flat out - mainly userspace code.
I wonder if the sort has been inverted. @awww hit F4 to check the sort of the CPU%.
|
Sorry, wasn't specific; not a single task was sitting at high CPU;
and yes, I didn't consider a reversed sort order - that wouldn't
make too much sense imho. Unfortunately the ntop shot doesn't
show "waits", which is what I suspect will be high on the box.
Cheers,
Tink
|
|
|
10-04-2011, 02:22 PM
|
#10
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Sorry, but those all look like they're taken at different times, and
none of these have a load that gets close to what your first shot
showed us. For future reference: can you please, instead of using
screenshots on an external site just copy & paste the text into code-blocks?
Makes life so much easier and quicker for people willing to help you.
|
|
|
All times are GMT -5. The time now is 10:00 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|