Web Hosting Talk







View Full Version : PHP CPU Usage Question......


Gluten
06-26-2003, 01:56 AM
Hello all! This is my first post to these forums, so if this is the wrong place to post this please let me know.

I host my own website http://www.world-gaming.com, and I am having problems with our PHP setup (I think). Any of the pages that I have created with PHP take up up too 40% CPU usage on the processor when someone views our site. Now the weird thing is that when we view our forums, which run on a lot more PHP then our other sites, it doesn't even come close to 40% CPU usage. I have done some DB tests thinking maybe it's the amount of data that we are pulling our of the DB, but all the numbers we got were VERY low much to my surprise. If anyone has experienced this and FIXED it please let me know what you did, or if you have any suggestions. Thank you all for your help.

Jason Porembski
Gluten Mifflin (WGNet CEO)
http://www.world-gaming.com

Daijoubu
06-26-2003, 05:38 AM
Your script could be poorly written or not optimized
If you post up the code here, we may be able to help ;)

inverus
06-26-2003, 08:16 PM
If the CPU is mostly idle, the OS will allot many cycles to whatever task is at hand.

Try using the apache benchmark tool to compare the load times of your main site to those of your forum.

/path/to/apache/bin/ab -n 1000 -c 10 http://www.world-gaming.com

vs

/path/to/apache/bin/ab -n 1000 -c 10 http://www.world-gaming.com/forums/

If you find that the mean time per request is significantly less on the forums than on the main site, it's quite likely that there's a problem with the main site.

Gluten
06-26-2003, 11:51 PM
Unfortunetly it's a lot of code.. Also I am running a Windows 2000 Server with IIS 5.0 all patched up.

inverus
06-27-2003, 12:03 AM
If you want, you can download the win32 version of apache.. it comes with the apache benchmark "ab" tool as a windows executable.

Gluten
06-28-2003, 10:22 AM
Na I have tried the Win32 Apache and I prefer IIS much more.

inverus
06-28-2003, 01:01 PM
I meant you could download the win32 version of apache to get ahold of the apache benchmark tool.

Daijoubu
07-02-2003, 08:10 AM
Microsoft have it own tool (MS Web Application Stress Tool)
http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/itsolutions/intranet/downloads/webstres.asp?frame=true