Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2008

    Exclamation Apache Optimazation ???


    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.

    [email protected] [/]# ps aux | grep -c httpd
    [email protected] [/]# ps aux | grep -c mysql
    [email protected] [/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

    <IfModule prefork.c>
    StartServers 10
    MinSpareServers 10
    MaxSpareServers 20
    ServerLimit 1000
    MaxClients 600
    MaxRequestsPerChild 0

    Thank you.

    Linux Blog

  2. #2

  3. #3
    Also try to check using the command "netstat -anp | grep 80 this will show the process and the IPs connected to the server.
    Support Facility | 24/7 web hosting technical support services
    Technical support | Server management | Data migration

    Technical Articles

  4. #4
    Join Date
    Nov 2004
    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

  5. #5
    Join Date
    Sep 2008

    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..


  6. #6
    Join Date
    Oct 2003
    The Netherlands

    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.

  7. #7
    Join Date
    Sep 2008


    please help me with your second option, we are using prefork,how can & where we use worker instead of prefork,so please do needful...


  8. #8
    Join Date
    Oct 2003
    The Netherlands

    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

Similar Threads

  1. How to replace apache prefork to apache worker on Centos 5??
    By toy_boy in forum Hosting Security and Technology
    Replies: 5
    Last Post: 09-09-2009, 12:59 AM
  2. Easy::Apache v3.2.0 Build 4469 Apache Config
    By jgnr in forum Hosting Security and Technology
    Replies: 1
    Last Post: 10-26-2008, 08:23 AM
  3. Apache procs constantly rise, until apache is restarted.
    By astounding in forum Hosting Security and Technology
    Replies: 14
    Last Post: 07-25-2007, 08:10 PM
  4. After upgrading apache 1.3.x to apache 2.x on redhat Linux the webs do not show.
    By jonathan184 in forum Hosting Security and Technology
    Replies: 1
    Last Post: 11-04-2005, 11:22 AM
  5. apache problem... switch from cgi to apache module URGENT!
    By needhelpcom in forum Hosting Security and Technology
    Replies: 8
    Last Post: 06-07-2004, 06:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts