Apache Tuning

Thread Tools Search this Thread
Top Forums Web Development Apache Tuning
# 1  
Old 08-14-2009
Error Apache Tuning

Hi Friends, This regarding tuning apache. I am running 100+ LAMP on VPS. But few of them are crashing becoz it reaches to the MaxClient Limit. I thought of Tuning. Here are the specs:

OS: OpenSuse 10
Apache: Apche/2.2.8
PHP: PHP 5.x
Assuming 80% of it has been occupied by webserver (apache)

Apache Settings: These are pretty old settings. I have doubt that these needs to be recompile.

# prefork MPM
StartServers 50
MinSpareServers 5
MaxSpareServers 100
ServerLimit 50
MaxClients 50
# worker MPM
StartServers 50
MinSpareThreads 5
MaxSpareThreads 100
ThreadLimit 128
MaxClients 50
ThreadsPerChild 75
MaxRequestsPerChild 10000

whenever i run
ps -eLf|grep httpd |wc -l
It alwasys give me = 52 and in the peak hours something apache crashes saying reached the Maximun Client size.

No as per the thumb rule.

MaxClients ≈ (RAM - size_all_other_processes)/(size_apache_process)
which is like
MaxClients ≈ (RAM dedicated to Apache)/(Average of apache process)

MaxClients ≈ Total Ram 1GB - 20% for other process/ Average of RSS (1226304) in KB offcource.

(Note: For RSS i an doing ps -ylC httpd --sort:rss, and calculating the average of all 52 process)

Now, Here is the problem when i do all this calculation, i end up with a result that i am using less RAM, which is quite a numb because these servers are running for last few years with no problem.

So, i was wondering if you guys can give me some direction for the tunning..thasn that would be help.
# 2  
Old 08-14-2009
Did I understand you correctly that you only pay for 1 GB RAM?

If so, buy more. 1 GB is not enough.
# 3  
Old 08-14-2009
I had this problem abt 3years back, we set maxclients but the moment [ps -ef |grep -i httpd | wc -l) = maxclient+2 it will crash. No matter how high we set it just kept reaching that threshold and crash.

I can't remember where in the config but we finally turned it off and it solved the problem. but our app was running jboss and that too had it's own set of problems and it too started crashing.

But If you ask me this maxlclient setting is quite dumb. Turn it off if you don't need it.
# 4  
Old 08-14-2009

Thanks Neo for Replying. but My question is all of my configuration are the same. 1Gb ram and 17 to 35GB HD. some of them are running absolutely fine. More over Apache is a light weighted application....if we can tune it proper than it should not take this much of memory.[COLOR="#738fbf"]
# 5  
Old 08-14-2009
Memory is so cheap.

Normally we tune and conserve valuable resourses.

That is why I aways advise more RAM. RAM is very cheap and 1 GB RAM is small for most semi-busy web servers.

It is cheaper to upgrade RAM than to spend human resources tuning.
# 6  
Old 08-14-2009

absolutely whenever count goes MC+2 or MC+3 it crashes. I tied few things but i never stop to reach that point...and amazingly the pid count is always one of these 50,51,52

---------- Post updated at 11:11 AM ---------- Previous update was at 11:08 AM ----------

My Bad i think i forgot to mention that these are all running on VMware VPS. The configuration of the VPS is done on the basis of the contract done from customer side. So, Increasing RAM would be the last option here people will think on.
# 7  
Old 08-14-2009
Here is our MPM config, FYI:

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers         64
    MinSpareServers      64
    MaxSpareServers      128
    MaxClients           256
    MaxRequestsPerChild  0

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          256
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0

---------- Post updated at 06:30 ---------- Previous update was at 06:00 ----------

Originally Posted by r00t4u
My Bad i think i forgot to mention that these are all running on VMware VPS. The configuration of the VPS is done on the basis of the contract done from customer side. So, Increasing RAM would be the last option here people will think on.
Ah. Yes, upgrading memory might be too expensive on a contract VPS configuration.

Anyway, I can't help about VPS provisioning, because every time we use any type of shared-hosting configuration for this site, the performance is not acceptable.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Apache module development on apache 2.2

Hi, I'm new to developing modules for Apache. I understand the basics now and can develop something simple which allows a 'GET' request to happen, but what I want to do is actually 'POST' information to my site. I know the basic POST Request works and I can see that it is post by looking at... (2 Replies)
Discussion started by: fishman2001
2 Replies

2. Solaris

nxge tuning

Hi all, I would like to tune the nxge card as suggested by this link, but got some confusion. Can anyone advise me ? We have SunOS hsbc02 5.10 Generic_137137-09 sun4v sparc SUNW,Netra-CP3260 Do I have to install any patches ? The tunning link Networks - Siwiki In our nxge.conf, I... (0 Replies)
Discussion started by: dehetoxic
0 Replies

3. Shell Programming and Scripting

Tuning function

This is my function in UNIX file. In this function I am -> first replacing spaces in character 19-27 with 0 -> then if it's all zeros ( 9 zeros) replace it with space The reason I have to make it to 0 first is that my requirement is that if this field is having value of 0 , replace it... (4 Replies)
Discussion started by: varunrbs
4 Replies

4. AIX

I/O tuning for oracle

is it a good practice to enable AIO (Async I/O) and mount the oracle file system with DIO with JFS2 (Direct I/O) option? please help (3 Replies)
Discussion started by: pchangba
3 Replies

5. Web Development

MySQL Tuning Tools with mysqltuner.pl and tuning-primer.sh

We have been tuning MySQL lately and I ran accoss two useful tools that you might be interested in: mysqltuner.pl tuning-primer.sh Both of these scripts are quite useful for MySQL tuning. Here is some sample output of mysqltuner.pl >> MySQLTuner 0.9.8 - Major Hayden... (3 Replies)
Discussion started by: Neo
3 Replies

6. Solaris


hw to increse nfs perfomence tuning? (4 Replies)
Discussion started by: naresh.sun
4 Replies

7. UNIX for Advanced & Expert Users

Tuning AIX IO

Hi I am trying to investigate a disk performance issue, and we are not seem to be hitting the right direction in our analysis. This is a FC disk running on USP1000 HDS system. The application is an IO intensive application, but our opinion is that it is not performing due to perceived disk... (1 Reply)
Discussion started by: theerthan
1 Replies

8. UNIX for Advanced & Expert Users

SAS Tuning

Does anyone had perfomed a tuning with SAS on Solaris??? Performance is not so good and I found out that Share Memory an Semaphores are the same that initial instalation, I havent found info at internet Please help (1 Reply)
Discussion started by: alex blanco
1 Replies

9. UNIX for Advanced & Expert Users

Tuning Apache

I have an Apache 1.3.27 on a Solaris 8 Sun box that I am trying to tweek out for max performance. The only documentation I have run accross is on apache.org. I also have the O'Reilly Apache book. Anyone have another source I can refer to? (2 Replies)
Discussion started by: edkung
2 Replies

10. UNIX for Dummies Questions & Answers

Performance tuning.

can someone tell me a good site to go to in order to learn this. please do not recommen nay books because i dont have interest in that. if you know of any good sites with good straight forward explanation on how to split loads on machines that has excessive loading, please let me know Also,... (1 Reply)
Discussion started by: TRUEST
1 Replies
Login or Register to Ask a Question