473,397 Members | 2,033 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,397 software developers and data experts.

PHP eating up server resources!

Hello all-

Apologies to everyone for what's probably a very inchoate and
uninformed question, but I've been thrust into the position about
having to learn more about PHP very quickly. (I'm also posting to
alt.comp.lang.php, since I'm not sure what the difference is between
the two groups.)

Basically, I run a Web site that includes two PHP-based subsites -- one
WordPress site and one PHPBB site. I get traffic that strikes me as
heavy but not out of control -- it's been steadily building, currently
at about 12,000 pageviews and 6,000 unique visitors on the average
weekday, with 90 percent of the pageviews on the WordPress site. All
of this is hosted on a shard server with a hosting company. I know
just enough about PHP programming to hack around in the premade
templates and customize my apps, and next to nothing about how PHP
works on the server end.

Yesterday, my Web host informed me that my domain was eating up a lot
of server resources, and that PHP was the root cause. If I understand
him right, PHP processing loads are causing Apache to fork lots of
additional processes. He was unable to tell me whether this was a
sudden spike or whether things had been steadily building and had
crossed some threshhold. I upgraded both WordPress and PHPBB to their
most recent versions in case there was some bug or vulnerability, but
this did not solve the problem.

I found the following article online that, if I understand it right
(and again, I very well may not), says that PHP can often overload
default Apache installs:

http://tabo.aurealsys.com/archives/2...n-from-apache/

So my question is, does this sound like the sort of thing that might be
a result of just Apache and PHP getting a lot of traffic? Or could it
be a bug or something in one of my apps? I'm posing this question in
WordPress and PHPBB forums, but thought I'd see if any PHP maven would
take pity on me and tell me if the problem is at that end.

Enormous thanks in advance for any help anyone can offer. For what
it's worth I'm running PHP 4.4.2; Apache 1.3.34 (Unix); and Linux
(kernel version 2.6.9-34.ELsmp) on an x86 server of some sort.

Oh, and my web host sent me the following "listing of the top
apache/php processes" (though they all look like HTML GET processes to
me):

Srv PID Acc M CPU SS Req Conn Child Slot Host VHost Request
0-5 6930 0/23/15201 G 0.24 1 0 0.0 0.12 186.87
169.237.42.155 (unavailable) GET /h2videos/aow2.mp4 HTTP/1.1
1-6 7515 0/11/15278 _ 0.36 2 197 0.0 0.49 181.53
67.170.155.199 www.joshreads.com GET /images/0604/i060418getfuzzy.png
HTTP/1.1
2-6 7523 0/11/15327 W 0.58 1 0 0.0 0.19 180.29
66.98.198.49 www.joshreads.com GET /wp-rss2.php HTTP/1.0
3-6 7535 0/14/15351 _ 0.26 2 828 0.0 0.14 197.07
65.161.109.99 www.numatek.com GET
/pphlogger/pphlogger.php?id=winchest&referer=http%3A//www.w
4-6 7547 0/15/15212 W 0.59 2 0 0.0 0.08 164.51
72.30.133.109 www.talkxbox.com GET
/forum/showthread.php?mode=hybrid&t=1730 HTTP/1.0
5-6 7508 0/20/14816 W 0.43 1 0 0.0 0.08 169.51
67.64.115.226 www.joshreads.com GET / HTTP/1.1
6-6 7513 0/9/15285 _ 0.86 3 4490 0.0 0.10 190.84
66.98.198.49 www.joshreads.com HEAD http://joshreads.com/wp-rss2.php
HTTP/1.0
7-6 7557 0/13/15239 W 0.95 10 0 0.0 0.06 177.00
85.255.45.42 www.squackle.com GET /images/CornBL.jpg HTTP/1.1
8-6 7565 0/19/15332 _ 1.69 12 38 0.0 0.23 200.75
131.107.0.74 www.joshreads.com GET /images/0604/i060425apt3g.jpg
HTTP/1.1
9-6 7571 0/11/15100 _ 0.61 3 5191 0.0 0.16 180.45
131.107.0.74 www.joshreads.com GET / HTTP/1.1
10-6 7517 0/13/15219 _ 0.40 2 7085 0.0 0.30 206.82
216.180.36.115 www.kisantech.com GET /brochures/path-inst-manual.pdf
HTTP/1.1
11-6 7518 0/8/15126 _ 0.17 17 192 0.0 0.07 191.08
131.107.0.74 www.joshreads.com GET /images/0604/i060425fbofw.png
HTTP/1.1
12-6 7578 0/18/15023 _ 0.21 24 0 0.0 0.09 212.55
69.128.101.82 www.joshreads.com GET
/wp-content/themes/beeblebrox-tweak/print.css HTTP/1.1
13-6 7583 0/10/15115 _ 0.41 11 907 0.0 0.50 184.53
72.30.110.88 www.talkxbox.com GET
/forum/showpost.php?p=40381&postcount=15 HTTP/1.0
14-6 7588 0/10/15177 _ 0.33 6 0 0.0 0.09 196.61
67.176.145.50 www.gregjesse.com GET /misc/ds_blk.jpg HTTP/1.1
15-6 7595 0/9/15203 W 0.27 6 0 0.0 0.06 209.70
156.98.182.137 www.joshreads.com GET / HTTP/1.1
16-4 29955 0/2345/15112 G 58.49 2 0 0.0 24.36 204.50
87.16.226.236 (unavailable) GET /dl/sc2ost/02/09_-_Healing_Winds.mp3
HTTP/1.1
17-6 7510 0/33/15349 W 0.61 2 0 0.0 0.18 166.79
148.241.64.15 www.technologynewsdaily.com GET /node/596 HTTP/1.0
18-6 7511 0/20/15472 _ 0.76 7 120 0.0 0.11 184.87
69.128.101.82 www.joshreads.com GET
/wp-content/themes/beeblebrox-tweak/local.css HTTP/1.1
19-6 7599 0/8/15191 _ 0.59 15 0 0.0 0.05 195.20
69.128.101.82 www.joshreads.com GET
/wp-content/themes/beeblebrox-tweak/style.css HTTP/1.1
20-6 7610 0/7/15255 W 0.05 3 0 0.0 0.09 182.90
193.110.187.231 www.psxe.co.uk GET /index.php HTTP/1.1
21-6 7512 1/18/15277 W 0.75 2 5029 0.0 1.08 172.44
69.128.101.82 www.joshreads.com GET / HTTP/1.1
22-6 7615 1/8/15133 W 0.17 6 509 25.6 0.26 221.50
131.107.0.74 www.joshreads.com GET /images/0604/i060420drabble.gif
HTTP/1.1
23-6 7616 1/4/15112 W 0.14 9 0 36.8 0.10 190.17
131.107.0.74 www.joshreads.com GET /images/0604/i060419middletons.jp

Apr 28 '06 #1
1 1996
Hello,

on 04/28/2006 04:32 PM go****@jfruh.com said the following:
Yesterday, my Web host informed me that my domain was eating up a lot
of server resources, and that PHP was the root cause. If I understand
him right, PHP processing loads are causing Apache to fork lots of
additional processes. He was unable to tell me whether this was a
sudden spike or whether things had been steadily building and had
crossed some threshhold. I upgraded both WordPress and PHPBB to their
most recent versions in case there was some bug or vulnerability, but
this did not solve the problem.


Usually this is caused by the excessive number of static content being
served at the same time by the Apache server that also serves PHP pages.

PHP itself is not the problem, but if you use persistent database
connections and serve many static content files that do not need
database connections, you force an exceeding number of database
connections to open needlessly. Those connections consume a lot of
memory. When the RAM is exhausted, your situation agravates until the
server crashes, if you do not have anything to limit connections.

The solutions for this are, move all static content to a multithreaded
HTTP server, like thttpd, and limit the Apache server simultaneous
clients to a reasonable value that does not exhaust your RAM. This will
protect your from eventual spikes.

Here you find more details about this:

http://www.meta-language.net/metabas...ve-connections

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Apr 29 '06 #2

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

Similar topics

0
by: JShurmatz | last post by:
If anyone can shed some light on this problem I would greatly appreciate it. I am unsuccessfully trying to use a database connnection retrieved from a pool configured using Java System Web...
0
by: Cedric | last post by:
I have a WebPage with a usercontrol (webcomponent.dll). With the port 80 on the server, the webpage and the usercontrol works fine If i change the port (18802), the time of loading the usercontrol...
0
by: Phil | last post by:
I am using .NET Remoting for interaction between client/host. When my app. starts the aspnet_wp process goes from approx. 3mb to ~20mb. Each round-trip to the server adds anything from 6kb to 2.5mb...
5
by: Dave A | last post by:
I am writing an ASP.NET tool that will allow the client to create their own online froms. ie the client can add tect boxes, text, drop downs,etc with absolutely no technical skill what so ever....
0
by: Carlo Marchesoni | last post by:
My ASP.NET app works with resources for loading text to the different controls (multilingual app) and everything works fine. but from time to time I have the following error. Then I have to wait...
2
by: gavino | last post by:
REHDAT LINUX 4S PHP 4.3.9 LEGACY APP I MOVED NOW EATS MEMORY CAN ANYONE TAE A LOOK ? I FIXED ONE PARTIALLY BY CHANGING TO here are my apache settings: 1 page laoding for a few seconds eat like...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
5
by: David | last post by:
Hi, We are about to move to SQL Server 2000, as we already have a licenced copy of it. However, as i understand it you licence by the number of users (where else can i find out what the options...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.