The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Issues with Apache - A lot of child processes

Discussion in 'Workarounds and Optimization' started by bin_asc, May 22, 2011.

  1. bin_asc

    bin_asc Well-Known Member

    Jul 18, 2005
    Likes Received:
    Trophy Points:
    I have a server that I`m trying to optimize. It went from a standalone script to getting a cluster modification.
    So now, we have a main server, and 2 smaller ones for transcoding.
    The issue is, apache is using ALOT of memory, and it spans child processes like crazy.
    Here is the prefork :

    <IfModule prefork.c>
        StartServers 5
        MinSpareServers 2
        MaxSpareServers 5
        MaxClients 50
        MaxRequestsPerChild 0
    We`re also running nginx with this.

    user  nobody;
    # no need for more workers in the proxy mode
    worker_processes  4;
    error_log  /var/log/nginx/error.log info;
    worker_rlimit_nofile 28000;
    events {
     worker_connections 18000; # increase for busier servers
     use epoll; # you should use epoll here for Linux kernels 2.6.x
    http {
     server_name_in_redirect off;
     server_names_hash_max_size 10240;
     server_names_hash_bucket_size 1024;
     include    mime.types;
     default_type  application/octet-stream;
     server_tokens off;
     sendfile on;
     tcp_nopush on;
     tcp_nodelay on;
     keepalive_timeout  5;
     gzip on;
     gzip_vary on;
     gzip_disable "MSIE [1-6]\.";
     gzip_proxied any;
     gzip_http_version 1.1;
     gzip_min_length  1000;
     gzip_comp_level  6;
     gzip_buffers  16 8k;
    # You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU
     gzip_types    text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml;
     ignore_invalid_headers on;
     client_header_timeout  3m;
     client_body_timeout 3m;
     send_timeout     3m;
     reset_timedout_connection on;
     connection_pool_size  256;
     client_header_buffer_size 256k;
     large_client_header_buffers 4 256k;
     client_max_body_size 200M;
     client_body_buffer_size 128k;
     request_pool_size  32k;
     output_buffers   8 32k;
     postpone_output  1460;
     proxy_temp_path  /tmp/nginx_proxy/;
     client_body_in_file_only on;
       proxy_buffers     16 32k;
       proxy_busy_buffers_size 64k;
       proxy_temp_file_write_size 64k;
     log_format bytes_log "$msec $bytes_sent .";
     include "/etc/nginx/vhosts/*";

    Can anyone explain why it`s spanning so many apache child processes ?

    root@host [~]# ps aux | grep httpd | wc -l

Share This Page