Portal Home > Knowledgebase > Articles Database > Apache Optimazation ???
Apache Optimazation ???
Posted by map007, 10-13-2009, 07:28 AM |
Hi,
I am facing problem regarding my site. I have dedicated server with WHM/cPanel, i have integrated tomcat with apache , the apache processes are too high aroung 1200-1400, So please guide me howto optimize my apache for better performance.
root@trick [/]# ps aux | grep -c httpd
1403
root@trick [/]# ps aux | grep -c mysql
3
root@trick [/l]# free -m
total used free shared buffers cached
Mem: 4053 3408 645 0 220 1890
-/+ buffers/cache: 1297 2756
Swap: 4094 0 4094
---------------------------------------------
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
StartServers 10
MinSpareServers 10
MaxSpareServers 20
ServerLimit 1000
MaxClients 600
MaxRequestsPerChild 0
------------------------------------------------
Thank you.
|
Posted by benthetech4u, 10-13-2009, 07:55 AM |
Hope this page helps you.
http://www.devside.net/articles/apac...ormance-tuning
|
Posted by inspiron, 10-13-2009, 08:29 AM |
Also try to check using the command "netstat -anp | grep 80 this will show the process and the IPs connected to the server.
|
Posted by assistanz247, 10-13-2009, 09:04 AM |
You need to increase your server's hardware capacity. Apache with Tomcat needs more hardware, with a normal hardware you can have around 100 tomcat connections. If you have more than 100 connections from tomcat then check your hardware.
|
Posted by p-root, 10-16-2009, 08:58 AM |
Hi,
Our server has Intel(R) Xeon(R) CPU X3230 @ 2.66GHz Quad core processor with 4GB of RAM,so there is no need to upgrade server hardware,also earlier our Tomcat and Apache was run perfectly or faster more then 2 times in dual core processor with 2GB RAM ,so please guide me how to optimize..
Thanks
|
Posted by barry[CoffeeSprout], 10-20-2009, 09:50 AM |
assistanz,
I've run Tomcat instances way over 250 connections concurrent on lesser hardware without problem.
First of all I notice a few things:
1 You have KeepAlive on (is this required?)
2 You are using prefork, not worker (worker is more efficient and will spawn less processes)
It could also be that you are just seeing a large influx of visitors for some reason, along with the KeepAlive this may be keeping your processes open way too long.
|
Posted by p-root, 10-22-2009, 04:54 AM |
Hi,
Thanks..Bvs.
please help me with your second option, we are using prefork,how can & where we use worker instead of prefork,so please do needful...
Thanks
|
Posted by barry[CoffeeSprout], 10-22-2009, 05:09 AM |
Hi,
First of all, backup every file that you touch; I'm not responsible if you hose your system :-)
I'm going to assume you use CentOS (which I use as well) and are using the default apache (not sure if cPanel replaces it)
mod_jk is by default thread safe, so you can use the worker MPM
stop apache: sudo service httpd stop
To enable in CentOS you must edit: /etc/sysconfig/httpd
It will contain the following:
#
# The default processing model (MPM) is the process-based
# 'prefork' model. A thread-based model, 'worker', is also
# available, but does not work with some modules (such as PHP).
# The service must be stopped before changing this variable.
#
#HTTPD=/usr/sbin/httpd.worker
Just uncomment this line.
You can then start apache again and see what kind of problems it sees.
Some modules are not thread safe (mod_php for example) and apache will complain loudly in that case.
If some of these modules are not needed you can turn them off by editing them out in httpd.conf
|
Add to Favourites Print this Article
Also Read