473,412 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

100% CPU load : how to investigate?

Hello

Someone I know is running some Web 2.0-type web site that lives on a
shared host, and is experiencing 100% CPU load after a few hours. At
this point, his provider couldn't tell if it's due to a DoS attack, or
a bug in his application.

1. For the DoS thing, I assume looking at the log files should be
enough to tell if it's the problem is due to a suspicious rise in the
number of connections at some point.

2. As for bugs, are there tools available for PHP that can monitor an
application and reveal bugs that could explain this CPU load?

Thank you.
Mar 13 '07 #1
9 2748
Vincent Delporte wrote:
Hello

Someone I know is running some Web 2.0-type web site that lives on a
shared host, and is experiencing 100% CPU load after a few hours. At
this point, his provider couldn't tell if it's due to a DoS attack, or
a bug in his application.
Web2. A very vague description. :P
>
1. For the DoS thing, I assume looking at the log files should be
enough to tell if it's the problem is due to a suspicious rise in the
number of connections at some point.
Yes.
Simply check the number of requests. A DDos should be found easily (before
crashing).
>
2. As for bugs, are there tools available for PHP that can monitor an
application and reveal bugs that could explain this CPU load?
Yes. A few debuggers/profilers are out there.
just type 'debugger php' in google to get them.
A very well known one is the DBG debugger.

I understood Zend has a good one, but you have to buy it.
I didn't buy Zend Studio (yet), but am considering it. I hear only good
things from people in here. :)

or check here: http://drupal.org/node/1466

Regards,
Erwin Moller
>
Thank you.
Mar 13 '07 #2
On Tue, 13 Mar 2007 15:52:25 +0100, Erwin Moller
<si******************************************@spam yourself.comwrote:
>Web2. A very vague description. :P
Some kind of social site :-)
>Simply check the number of requests. A DDos should be found easily (before
crashing).
Will do.
>Yes. A few debuggers/profilers are out there.
just type 'debugger php' in google to get them.
A very well known one is the DBG debugger.
Thanks for the info. I assume it's more a profiler than a debugger.
Hopefully, they're easy to add to a production site without breaking
anything, and that it will easily show what is causing this surge in
CPU load after hours of normal operation.
Mar 13 '07 #3
Vincent Delporte wrote:
Someone I know is running some Web 2.0-type web site that lives on a
shared host, and is experiencing 100% CPU load after a few hours.
I would suggest that the number one thing to check is:

/usr/bin/top

to establish exactly what process is causing the big CPU usage. Your next
stage of investigation will depend on what "top" tells you.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 13 '07 #4
Vincent Delporte wrote:
Some kind of social site
These sorts of things usually develop into having some pretty big database
tables.

Do you have any "big" tables (say, 2000 rows or more)? Which columns do
you routinely query those big tables by, or join them on? Are those columns
indexed?

Are you using inappropriate data types? (e.g. Storing dates in a varchar
field, which although possible, is very inefficient for queries.)

Do you unnecessarily use "SELECT * FROM ..." when "SELECT x, y FROM ..."
would suffice?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 13 '07 #5
On Tue, 13 Mar 2007 15:16:49 +0000, Toby A Inkster
<us**********@tobyinkster.co.ukwrote:
>These sorts of things usually develop into having some pretty big database
tables.
Will forward your suggestions, including "top" (although it's a shared
host, so probably no shell).

FWIW, it works fine for hours at a time, and poof. At this point, it
is unknown if it's a DoS or some bug in the code that would only show
after... a while.
Mar 13 '07 #6
Vincent Delporte wrote:
although it's a shared host, so probably no shell
If it's a shared host, then what makes you think that it's your friend's
site that is using all the CPU? It could be another customer's site on the
same server.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
Mar 13 '07 #7
On Tue, 13 Mar 2007 17:51:09 +0000, Toby A Inkster
<us**********@tobyinkster.co.ukwrote:
>If it's a shared host, then what makes you think that it's your friend's
site that is using all the CPU? It could be another customer's site on the
same server.
According to the hoster, it's his site that's causing the problem. I
assume they have monitoring tools that tells them whose processes are
using the host's resources.
Mar 13 '07 #8
Erwin Moller kirjoitti:
Vincent Delporte wrote:
>Hello

Someone I know is running some Web 2.0-type web site that lives on a
shared host, and is experiencing 100% CPU load after a few hours. At
this point, his provider couldn't tell if it's due to a DoS attack, or
a bug in his application.

Web2. A very vague description. :P
I suppose the performance hit comes from the extrem popularity of the
website, after all, it's web 2.0 for crying out loud! ;)
--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Mar 16 '07 #9
On Tue, 13 Mar 2007 21:00:58 +0200, Kimmo Laine <sp**@outolempi.net>
wrote:
>I suppose the performance hit comes from the extrem popularity of the
website, after all, it's web 2.0 for crying out loud! ;)
Nope. The same site would crawl to a snail's space with about 40
concurrent users, while it can easily handle 200 users after being
moved to an hoster, even though both servers where shared. Guess it
was due to configuration.

We still have to investigate why the new host sometimes ends up using
100% CPU time, though.
Mar 18 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: P Verbakel | last post by:
Hello, I just installed MS SQL 2000 Enterprise on a Windows 2000 Server machine with 2 CPU's. After starting the MS SQL takes 2 x 100% of all CPU power. I do NOT load the DB in any way with...
1
by: Abbas | last post by:
I am running a t-sql script which makes a bunch of calls to stored procedures, updates few tables and inserts records. I do this in Begin Tran and commit. The problem I am having is that SQL Server...
3
by: Jibba Jabba | last post by:
How much traffic/load can a database server running MS SQL server take before it can't handle it anymore? And when that time comes, what are the recourses? Am I able to load balance it between...
8
by: Whugster | last post by:
I have this really frustrating problem when calling XmlDocument.Load(string filename). Whenever I call this method in a web application in my Windows XP development PC, I get the following error: ...
4
by: Urs Vogel | last post by:
Hi My appserver (winservice.exe, runs as a Windows Service), made of 100% .Net C# code, crashes occasionally (on one machine only), giving the following DrWatson message: Ereignistyp: ...
4
by: Craig Kenisston | last post by:
Is this possible ? I have a code that does this : if ((Request.IsAuthenticated == false)) { LeftPane.Controls.Add(Page.LoadControl("~/_AccessControl.ascx")); LeftPane.Visible = true; }
9
by: peter.mosley | last post by:
Hello again I'm still wrestling with Python / Tkinter / PIL. I have almost got it to work - on a Fedora Core 1 system I can now display images in a Tkinter window. But I also run a Fedora Core...
39
by: Gilles Ganault | last post by:
Hello, I'm no LAMP expert, and a friend of mine is running a site which is a bit overloaded. Before upgrading, he'd like to make sure there's no easy way to improve efficiency. A couple of...
1
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.