Web Hosting Talk







View Full Version : Apache Problems, please help


Jedito
04-01-2002, 06:08 PM
I have a problem with apache in one of my box.
it load all the pages extremally slow, worst than that, I think that the problem is that it keep all the request in like a "waiting list" to show the page.
The server load its pretty low (0.3), The httpd.conf seems ok.


MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Server-pool size regulation. Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request. If there are fewer than MinSpareServers, it creates
# a new spare. If there are more than MaxSpareServers, some of the
# spares die off. The default values are probably OK for most sites.
#
MinSpareServers 15
MaxSpareServers 30

#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 5

#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients 500

#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies. The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources. On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
# request per connection. For example, if a child process handles
# an initial request and 10 subsequent "keptalive" requests, it
# would only count as 1 request towards this limit.
#
MaxRequestsPerChild 0


but when I try to see in the server-status page, it only show 28 alive request all the time.

This not happen if I reboot the server and I don't try to restart apache, but as soon I restart apache (through WHM I get an apache failed error), and through /etc/rc.d/init.d/httpd stop and start, this problem start.
I have to do 3 times at least etc/rc.d/init.d/httpd stop to get the not pid running message, I tried doing that and killing all the httpd, but doesn't help.

Anybody have an idea of what could be wrong? I'm totally lost.
The box its running RH 7.2 with WHM/Cpanel.

Thanks in advance.

allera
04-01-2002, 06:55 PM
Here are the settings our servers use:

MinSpareServers 30
MaxSpareServers 100
StartServers 15
MaxClients 256
MaxRequestsPerChild 0

Two of our servers are quite heavily used. MaxClients can't go over 256 unless you alter the Apache source code.

Hope that helps!

Jedito
04-01-2002, 07:12 PM
I noticied that Tomcat its the source of the problem, I don't know why is lagging all the requests.
I'm looking 1 by 1 in each account with private instances to see if are any of them or if a shared tomcat instance.

Shyne
04-01-2002, 07:31 PM
Tomcat does take a lot of resources since it's JSP/Servlets.
I would check Tomcat logs and see what scripts are causing this.

Jedito
04-01-2002, 07:36 PM
but the strange in all this, is that the server load its very low.
I think that 1 instance its creating some kind of loop calling apache, but the alive request are few too (28).

Shyne
04-01-2002, 07:47 PM
A low server load doesn't always mean that the server is running fine.

bitserve
04-01-2002, 08:02 PM
There is no point in starting less servers than you have your minspareservers set to. StartServers and MinSpareServers should be the same value.

If you think that one of your children is getting carried away, it would help to set a value for MaxRequestsPerChild, so that the child will die.

Shyne
04-01-2002, 10:37 PM
You can also kill the child with a pipe.

webx
04-02-2002, 01:14 AM
Have you checked what is the memory usage of the processes? May be your private JVMs are taking up lot of memory?

Jedito
04-02-2002, 01:59 AM
Hi Masood
I've checked, and I have more tan 300 MB free still, the problem was with the shared tomcat instance, I'm working now to identify which site is the one who has caused all this mess

bitserve
04-02-2002, 02:37 AM
Originally posted by Shyne
You can also kill the child with a pipe.

Yes, you can kill children with pipes. But mostly I've just seen people kill baby seals with pipes.

Jedito
04-02-2002, 07:17 PM
Anyone experienced with Tomcat? I'm out of ideas after work 14 hours.

This is the scene.
Apache running fine, then I start tomcat, everything keeps fine, but as soon I restart apache it start to crawl.

Nothing strange at apache logs, nothing strange at tomcat logs either.
200 MB RAM Free, server load low..
Anybody have a remote idea of what could be wrong?

webx
04-02-2002, 08:03 PM
Which version of Tomcat? Have you checked their website for possible bugs?

Jedito
04-02-2002, 08:49 PM
Tomcat 4.0.1
Yes, I'm in the tomcat mailing list, but never saw something like this before.

webx
04-02-2002, 09:53 PM
Try moving to 4.0.3 (current production quality) and send in question on their mailing list, may be someone there can help you with similar problem.

Jedito
04-03-2002, 02:37 AM
I tried that, also changed JVM from IBM to Sun, but nothing help.

bitserve
04-03-2002, 11:18 AM
Are you using mod_webapp or mod_jk? Did you compile it, or are you using the binary version?

Jedito
04-03-2002, 01:41 PM
I'm using both (mod_webapp and mod_jk) both compiled.

bitserve
04-03-2002, 09:00 PM
Well then I would get started seeing if it was mod_webapp or mod_jk that was causing the problem through the process of elimination.

You may need to take an indepth look at apache, the way it was built, and the way it was configured, as well as the same for your jakarta stuff.

It seems to me like a problem with JSP container. If tomcat runs fine without apache, and apache runs fine without tomcat.

You might consider contacting Cpanel.net for help at this point.

Jedito
04-03-2002, 09:14 PM
I tried that too.
What I did now, and more or less solved the problem, was a clean tomcat installation, now, seems to work, but, I had to set a cron restarting tomcat every 10 minutes, or I get the catalina.out filled of OutofMemory messages

Ahmad
04-04-2002, 02:13 AM
Try this ..

When you want to restart apache, use this sequence:

stop tomcat
stop apache
start apache
start tomcat

I hope that this helps, as I've never used apache with tomcat on a Unix box before.

Jedito
04-04-2002, 04:49 AM
It seems that its a memory leak.
No mather what I do, catalina.out start to fill with OutOfMemory messages.
Even If I leave 1 empty site in the server.xml and httpd.conf.

bitserve
04-04-2002, 05:42 AM
Originally posted by Jedito
I tried that too.
What I did now, and more or less solved the problem, was a clean tomcat installation, now, seems to work, but, I had to set a cron restarting tomcat every 10 minutes, or I get the catalina.out filled of OutofMemory messages

Well don't keep it to yourself. Does the problem continue if you're just using mod_webapp? What about if you're just using mod_jk?

Have you contacted cpanel.net for help? I only ask, because it's going to take an indepth examination of your entire build and configuration of tomcat and apache to determine the problem. I don't think it's going to be resolved on a forum, anymore.

webx
04-04-2002, 01:02 PM
I'll suggest go back to Tomcat 3.3.1 for the time being. And check with developers about this problem with 4.