473,796 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Apache and Tux running together

Hi all,

I'm wondering if anyone has tried a scenario that I'm thinking of. At
my job we've got a web based product provided by Apache running PHP
that accesses MySQL. This web application is hosted by multiple servers
behind a load balancer because of the user load on the system. However,
we've still had times when the servers got over run and Apache maxes
out on the number of httpd processes (257) and falls behind to the
point of timing out. When this happens and I look at the servers with
top, they aren't particulary busy, but with 257 big httpd process (PHP
and MySQL totalling 15 Megs of ram), the server is bound up.

So here's my question; has anyone tried running the tux kernel based
web server alongside Apache with the goal of freeing Apache from
serving up static files and increasing it's capacity to handle dynamic
requests? I had one of the guys on our team try to set this up.
Essentially configuring tux so it would serve all static content and
pass on other requests (php pages) to Apache. Both processes are
running on the same server. We got this working, but didn't see much of
an improvement in the capacity of the server.

If anyone has tried this, or had any experience with this, I'd
appreciate knowing.

Thanks in advance,
Doug

Jul 14 '06 #1
5 2305
Hello,

I am new to PHP but I think that you need to play around with Apache
source code and recompile to do what you needed done. I might be wrong, but,
for some reason, it was the first answer on my brain-- maybe long lost
memory-.
<wr******@chart er.netwrote in message
news:11******** **************@ 75g2000cwc.goog legroups.com...
Hi all,

I'm wondering if anyone has tried a scenario that I'm thinking of. At
my job we've got a web based product provided by Apache running PHP
that accesses MySQL. This web application is hosted by multiple servers
behind a load balancer because of the user load on the system. However,
we've still had times when the servers got over run and Apache maxes
out on the number of httpd processes (257) and falls behind to the
point of timing out. When this happens and I look at the servers with
top, they aren't particulary busy, but with 257 big httpd process (PHP
and MySQL totalling 15 Megs of ram), the server is bound up.

So here's my question; has anyone tried running the tux kernel based
web server alongside Apache with the goal of freeing Apache from
serving up static files and increasing it's capacity to handle dynamic
requests? I had one of the guys on our team try to set this up.
Essentially configuring tux so it would serve all static content and
pass on other requests (php pages) to Apache. Both processes are
running on the same server. We got this working, but didn't see much of
an improvement in the capacity of the server.

If anyone has tried this, or had any experience with this, I'd
appreciate knowing.

Thanks in advance,
Doug

Jul 14 '06 #2
JDS
On Fri, 14 Jul 2006 11:51:24 -0700, writeson wrote:
So here's my question; has anyone tried running the tux kernel based
web server alongside Apache with the goal of freeing Apache from
serving up static files and increasing it's capacity to handle dynamic
requests? I had one of the guys on our team try to set this up.
Essentially configuring tux so it would serve all static content and
pass on other requests (php pages) to Apache. Both processes are
running on the same server. We got this working, but didn't see much of
an improvement in the capacity of the server.
I'm pretty sure that the desired setup that you describe was the impetus
behind creating Tux in the first place. I'd be surprised if you didn't
find information about this in a Google search.

I think you'll havta run the two servers on different ports, though.

later...
--
JDS

Jul 14 '06 #3
wr******@charte r.net wrote:
I'm wondering if anyone has tried a scenario that I'm thinking of. At
my job we've got a web based product provided by Apache running PHP
that accesses MySQL. This web application is hosted by multiple servers
behind a load balancer because of the user load on the system. However,
we've still had times when the servers got over run and Apache maxes
out on the number of httpd processes (257) and falls behind to the
point of timing out. When this happens and I look at the servers with
top, they aren't particulary busy, but with 257 big httpd process (PHP
and MySQL totalling 15 Megs of ram), the server is bound up.
Whoa, you're rather jumping the gun aren't you? Picking a solution before
you really know what the problem is.

Using an LAMP stack, when it reaches a performance limit at any point in the
stack, the system rapidly saturates and throughput takes a nosedive. Now,
this can happen because of multiple reasons.

I would recommend that you start monitorning the system at all times and
chart the number of httpd processes (if possible the number of active httpd
processes) vs memory used to check that you've got max processes at its
optimal value (i.e. not resulting in lots of paging).

You should also be logging mysql slow queries, along with counting the
number of connections to the mysqld server and the length of the mysql
processlist. Slow queries should be fixable. A long processlist can be more
tricky but could still point to saturation on the DB as the problem.
Generally getting the schema right gives far greater performance benefits
than tinkering with the hardware - but the latter can be an issue on some
configurations.

Also watch out for plain bad php - unfortunately I don't know any way of
measuring this other than going through the most popular and the slowest
urls by hand to see if they can be made faster. You are using a PHP
accelerator aren't you?

Note that a lot of your memory is probably being used up by apache processes
just hanging around while data gets fed down a slow socket. While you can't
speed up somebody elses network connection you can reduce the load by
moving it away from the httpd processes. It is this where using Tux would
be of benefit - it would use less memory per connection. However splitting
the traffic might not be that simple. More conventionally one would put a
reverse proxy in front of the webservers - squid is a good choice. There's
also an apache module designed specifically for handing over the datafeed
to a less memory hungry process - the name escapes me for now but its
probably easy to find on google.
behind a load balancer
Oh dear. This always sets the alarm bells ringing for me. It usually means
that somebody has got a vendor certificate and somebody got some lunches
bought for them.

I could go on for hours. But I'd have to charge you for it.

Try to work out where your problem is first.

C.
Jul 16 '06 #4

JDS wrote:
On Fri, 14 Jul 2006 11:51:24 -0700, writeson wrote:
So here's my question; has anyone tried running the tux kernel based
web server alongside Apache with the goal of freeing Apache from
serving up static files and increasing it's capacity to handle dynamic
requests? I had one of the guys on our team try to set this up.
Essentially configuring tux so it would serve all static content and
pass on other requests (php pages) to Apache. Both processes are
running on the same server. We got this working, but didn't see much of
an improvement in the capacity of the server.

I'm pretty sure that the desired setup that you describe was the impetus
behind creating Tux in the first place. I'd be surprised if you didn't
find information about this in a Google search.

I think you'll havta run the two servers on different ports, though.

later...
--
JDS
JDS,

Thanks for the reply. We did in fact set this up on two different
ports: TUX is running on port 80 and Apache is on port 8080. TUX just
passes requests for things that aren't static files onto Apache at port
8080. Just to be compulsive, both TUX and Apache are running on the
same server.

Doug

Aug 4 '06 #5
Colin,

Thanks for your reply. Since you had lots of good information, I'll
inject my comments in the body of your reply. :)

Colin McKinnon wrote:
wr******@charte r.net wrote:
I'm wondering if anyone has tried a scenario that I'm thinking of. At
my job we've got a web based product provided by Apache running PHP
that accesses MySQL. This web application is hosted by multiple servers
behind a load balancer because of the user load on the system. However,
we've still had times when the servers got over run and Apache maxes
out on the number of httpd processes (257) and falls behind to the
point of timing out. When this happens and I look at the servers with
top, they aren't particulary busy, but with 257 big httpd process (PHP
and MySQL totalling 15 Megs of ram), the server is bound up.

Whoa, you're rather jumping the gun aren't you? Picking a solution before
you really know what the problem is.
I think I know what the problem is, I'm not sure what's causing it or
how to address it at the moment. When one of our servers gets locked up
I look at it and see that it has 257 httpd processes running, each of
which is big in terms of memory space. The processors themselves don't
seem all that busy, so I'm thinking I'm memory bound. I think this
because if I increase the number of max_clients in the Apache config it
doesn't improve things, and looks like those additional httpd processes
are being paged to disk. Because this one server is serving up both
dynamic pages, and the multiple static files (graphics) that are on
those pages, I think each httpd process is growing to capacity to do
the PHP and MySQL work, but then remaining in memory for many, many
requests that are just static files.
>
Using an LAMP stack, when it reaches a performance limit at any point in the
stack, the system rapidly saturates and throughput takes a nosedive. Now,
this can happen because of multiple reasons.

I would recommend that you start monitorning the system at all times and
chart the number of httpd processes (if possible the number of active httpd
processes) vs memory used to check that you've got max processes at its
optimal value (i.e. not resulting in lots of paging).
What you're suggesting sounds very good, I'm still kind of new to
linux, so can you recommend a good way to get the actual memory size of
a process/total size of all like processes (httpd)?
>
You should also be logging mysql slow queries, along with counting the
number of connections to the mysqld server and the length of the mysql
processlist. Slow queries should be fixable. A long processlist can be more
tricky but could still point to saturation on the DB as the problem.
Generally getting the schema right gives far greater performance benefits
than tinkering with the hardware - but the latter can be an issue on some
configurations.
We have the Zend Studio so we can profile the PHP, which would help us
find the bottlenecks there and in the MySQL queries. I'll take a look
at the docs to figure out how to look for slow queries in the system
other than using Zend Studio. We have had problems in the past where my
DBA guy hasn't indexed database tables, which has really slowed things
down.
>
Also watch out for plain bad php - unfortunately I don't know any way of
measuring this other than going through the most popular and the slowest
urls by hand to see if they can be made faster. You are using a PHP
accelerator aren't you?
We aren't using a PHP accelerator unfortunately, though I'd like to. Do
you recommend one? We are caching the output of the PHP code so that
what gets delivered to the customer is mostly static content, except
for a few runtime things that have to be performed by PHP every page
request.
>
Note that a lot of your memory is probably being used up by apache processes
just hanging around while data gets fed down a slow socket. While you can't
speed up somebody elses network connection you can reduce the load by
moving it away from the httpd processes. It is this where using Tux would
be of benefit - it would use less memory per connection. However splitting
the traffic might not be that simple. More conventionally one would put a
reverse proxy in front of the webservers - squid is a good choice. There's
also an apache module designed specifically for handing over the datafeed
to a less memory hungry process - the name escapes me for now but its
probably easy to find on google.
behind a load balancer
The load balancer seems to have very good performance, my testing
revealed nearly linear capacity increases with additional identical
servers. This showed me that the load balancer introduced very little
processing overhead. We're using the Piranha load balancer from RedHat,
which is an offshoot of the Linux Virtual Server project. We didn't buy
a Cisco or Microsoft load balancer thing. :)
>
Oh dear. This always sets the alarm bells ringing for me. It usually means
that somebody has got a vendor certificate and somebody got some lunches
bought for them.

I could go on for hours. But I'd have to charge you for it.

Try to work out where your problem is first.

C.
Again, thanks for your feedback, I really appreciate it. I'd also like
to see what you might have to say about what I've written above.

Thanks,
Doug

Aug 4 '06 #6

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

Similar topics

2
1882
by: Matthew Bates | last post by:
Hi, I'm currently running Apache 1.3.27 on Debian Woody with a PHP backport (version 4.3.4), together with Apache-SSL 1.3.27. I have been considering upgrading to Apache 2.0.48 which I now believe is recommended for production. However what is the status of the interoperability with PHP? I have read on the PHP site that it is not recommended to run Apache 2.0 with PHP but does this refer to the latest revisions or the initial...
3
2458
by: Ron King | last post by:
When I installed Mandrake 10.0 I thought I had Apache, PHP, and MySQL installed correctly. I could serve web pages, MySQL worked, and when I tried the phpinfo() function, I got a page that looked OK. I could create simple php pages and serve them up. Then I tried to install pear, and things started to be not OK after all. phpinfo() told me that the 'Configure Command' had both the following in it: --with-pear=/usr/share/pear
0
1981
by: John Murtari | last post by:
Folks, We have been running PHP 4.x on Apache 1.3.x with no problems. After the first upgrade from php3 -> php4 were were able to load both modules for php 3 and php 4 with no problem. With an AddType directive we forced php 3 execution for just those files ending in php3. Thought we could do the same with php 5. We have a lot of folks on 4 who may not be ready to upgrade yet, so we were planning on letting php 4 handle anything...
0
1554
by: Kim Gijung | last post by:
Hi all, I'm planning to make apache module. I made php code. but it's too slow to handle requests for my project. So i'm thinking if i replace php code to c and make apache module then it maybe much faster. upon above idea I have three questions. 1. Is it really worth to replace php code to c and make as apache module?
3
2191
by: Jim Johnstone | last post by:
Some details of my HOME PC. I am running the following .... Win2000 SP4; IE V6; 512MB RAM; H/Disk Space OK. In the past couple of weeks I have installed/configured from binaries for .. MySQL V4.1.5 Apache V2.0.50 PHP V5.0.2 PHPMYADMIN V2.6.0 OBJECTIVE: To use my HOME PC to run a local APACHE web server on which to
2
2138
by: John Murtari | last post by:
Folks, I work for a web provider and we would really like to start allowing people to experiment with php 5 on their websites without forcing an overall upgrade and potential code problems. Did some extensive searches and have seen ideas about running php 5 via cgi or using mod_proxy so that if folks access their site as php5.sitename.com -- we pass it through to an apache server configured for php5.
2
1793
by: John Murtari | last post by:
Folks, We are slow in rolling out PHP 5 to our users because it won't live as a module with PHP 4 in Apache 1.3.x/Linux. I have seen many workaround like running it as CGI or using a reverse proxy to forward php 5 requests to another server. Any 'php gods' out there who might know how hard that support would be to add to a future version of PHP 5, like PHP 5.1. I'm sure we are not the only hosting provider running into a problem with...
5
2819
by: Felix E. Klee | last post by:
I've set up a PHP web application where users can log in and open a connection to a NNTP-server. There is a *one-to-one* relationship between sessions and NNTP-connections (i.e. exactly one NNTP-connection per session, and exactly one session per NNTP-connection). Now, I'd like to have these connections be persistent. So I started using "pfsockopen" instead of "fsockopen" and set Apache's KeepAliveTimeout to a very high value. ...
3
3223
by: genenamg | last post by:
Hi, I am trying to run and configure Apache 2.0, php 5 and mysql on win xp professional - this is the first time I have tried to install and configure all three. I am having difficulty trying to configure them on my computer. Can somebody help me - this is what I have done so far. Installed Apache 2.0, it worked perfectly ( I checked with my browser - http://localhost) till the point where I started to point where I
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10190
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5447
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.