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.
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.
AssistanZ - Beyond Boundaries... Cloudstack Consultancy / 24x7 Web Hosting Support / 24x7 Server Management / Infrastructure Management Services Web & Mobile Apps Development / Web Designing Services / Php, Grails, Java Development
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..
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.
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