473,320 Members | 1,910 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,320 software developers and data experts.

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 2275
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******@charter.netwrote in message
news:11**********************@75g2000cwc.googlegro ups.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******@charter.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******@charter.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
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...
3
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...
0
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...
0
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...
3
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...
2
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. ...
2
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...
5
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.