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.

how to remove apache unwanted modules using easyapache?

Discussion in 'Workarounds and Optimization' started by LAZer, Apr 21, 2011.

  1. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    hi , i am compiling apache on my server again using /scripts/easyapache from shell.
    i want to remove unwanted modules from apache to reduce memory consumption because i have high traffic websites on the server and every apache request is using too much memory.

    Code:
     ----- MEMORY USAGE REPORT FOR 'apache' -----
    PID Count: 229
    Shared Mem usage: 136 MB
    Total Resident Set Size: 8655 MB
    Mem/PID: 37 MB
    
    or : 
    
    PID Count: 193
    Mem usage: 27919 MB
    Mem/PID: 144 MB
    
    and in top i see this on every apache connection :
    nobody    15   0  136m  38m 3044 S  1.3  0.5   0:01.11 httpd
    so VIRT of every apache connection is around 136 MB and for every mysql connection VIRT is around 300 MB
    
    so i want to remove unwanted apache modules to reduce memory usage.
    when i compile apache with easyapache with the following configuration , after compiling when i type httpd -l it shows many modules that i set not to be compiled :( what should i do to remove excessive modules from apache ?

    Code:
    Apache: 
      optmods: 
        Access: 1
        Actions: 1
        Alias: 1
        Asis: 1
        AuthAnon: 0
        AuthDB: 0
        AuthDBM: 0
        AuthDigest: 1
        AuthLDAP: 0
        AuthnAlias: 0
        AuthnAnon: 0
        AuthnDBD: 0
        AuthnDBM: 0
        AuthnDefault: 0
        AuthnzLDAP: 0
        AuthzDBM: 0
        AuthzHost: 1
        AuthzOwner: 0
        Autoindex: 1
        Bucketeer: 0
        Cache: 1
        CaseFilter: 0
        CaseFilterIn: 0
        CernMeta: 0
        CharsetLite: 1
        DAVFs: 0
        DAVLock: 0
        DBD: 0
        DIR: 1
        Dav: 0
        Deflate: 1
        DiskCache: 1
        Distcache: 0
        Dumpio: 1
        Echo: 1
        Env: 1
        Expires: 1
        ExtFilter: 0
        Fastcgi: 1
        FileCache: 1
        Fileprotect: 1
        Frontpage: 0
        Headers: 1
        Ident: 0
        Imagemap: 0
        LDAP: 0
        LogAgent: 0
        LogConfig: 1
        LogForensic: 0
        LogReferer: 0
        MPMEvent: 0
        MPMLeader: 0
        MPMPerchild: 0
        MPMPrefork: 1
        MPMThreadpool: 0
        MPMWorker: 1
        MemCache: 1
        Mime: 1
        MimeMagic: 1
        MmapStatic: 0
        Negotiation: 1
        OptionalFnExport: 0
        OptionalFnImport: 0
        OptionalHookExport: 0
        OptionalHookImport: 0
        PHPAsUser: 1
        Proxy: 0
        RaiseFDSetsize: 0
        RaiseHardServerLimit: 0
        Rewrite: 0
        Setenvif: 1
        Speling: 0
        Status: 1
        UniqueId: 1
        Userdir: 1
        Usertrack: 0
        Version: 0
        VhostAlias: 1
      version: 2_2
    Cpanel::Easy::EAccelerator: 1
    Cpanel::Easy::IonCubeLoader: 1
    Cpanel::Easy::ModBandwidth: 1
    Cpanel::Easy::ModGzip: 0
    Cpanel::Easy::ModJk5: 0
    Cpanel::Easy::ModMono: 0
    Cpanel::Easy::ModMono2: 0
    Cpanel::Easy::ModPerl: 0
    Cpanel::Easy::ModSec: 1
    Cpanel::Easy::PHP4: 0
    Code:
    root@server2 [~]# httpd -l
    Compiled in modules:
      core.c
      mod_authn_file.c
      mod_authn_default.c
      mod_authz_host.c
      mod_authz_groupfile.c
      mod_authz_user.c
      mod_authz_default.c
      mod_auth_basic.c
      mod_file_cache.c
      mod_cache.c
      mod_disk_cache.c
      mod_mem_cache.c
      mod_dumpio.c
      mod_echo.c
      mod_include.c
      mod_filter.c
      mod_charset_lite.c
      mod_deflate.c
      mod_log_config.c
      mod_logio.c
      mod_env.c
      mod_mime_magic.c
      mod_expires.c
      mod_headers.c
      mod_ident.c
      mod_unique_id.c
      mod_setenvif.c
      mod_version.c
      mod_proxy.c
      mod_proxy_connect.c
      mod_proxy_ftp.c
      mod_proxy_http.c
      mod_proxy_scgi.c
      mod_proxy_ajp.c
      mod_proxy_balancer.c
      mod_ssl.c
      prefork.c
      http_core.c
      mod_mime.c
      mod_status.c
      mod_autoindex.c
      mod_asis.c
      mod_info.c
      mod_suexec.c
      mod_cgi.c
      mod_vhost_alias.c
      mod_negotiation.c
      mod_dir.c
      mod_actions.c
      mod_userdir.c
      mod_alias.c
      mod_rewrite.c
      mod_so.c
    root@server2 [~]#
    

    for example look at mod_auth or mod_proxy files which i set no to be compiled but they are still available in my apache installation :( . any helps would be appreciated.
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    Some modules are inbuilt with apache. I donot thinks these modules will be causing memory consumption. A proper tweak for Apache service will resolve the issue.
     
  3. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    the thing that i want is to reduce VIRT of apache threads to less than current around 140 MB , i have searched in my customer hosts , i have disabled all ini_set for them , and set memory limit of 32 to 64 mb in their php.ini files . but still no changes . even after restarting apache processes still take around 130 MB . :(
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Which PHP handler are you using? Also, are you using any MPM such as Event, Prefork or Worker with Apache?

    There are modules you simply cannot remove as they are required modules for Apache to function in a cPanel environment, so removing modules that are not selectable during EasyApache compile would mean those modules are required and should not be removed. As LinuxTechie already suggested, you should instead look into optimization for Apache.
     
  5. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    70
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    at net :D
    i have followed many tutorials regarding apache , mysql , php optimization . i use mpm prefork as the main mpm but worker is also compiled because i wanted to seperate request processing for static and dynamic files ( which yet i couldnt achieve ) .
    the php 5 is working in SUPHP mode. my server load despite the very heavy traffic is normal because server hardware is a strong one. ( 2 * xeon quad core cpu , hdd SATAII with hardware raid 10 , 12 gb RAM ddr3 ) load is around 3 4 , which till 8 is normal , and some times during FTP backup on remote server and some script malfunctions ( new wp/nuke modules or rapidleech scripts which users use ) load goes as high as 14 15 , which just reduces the server page load speed. but yet it donot swap on hdd and memory is still enough for the users. also i have caching and eaccelerator active on the server...

    the page views of the sites on my server is more than 2,000,000 page views per day , with many sites with global alexa ranks of under 200,000 so this is why i want to reduce apache VIRT , so that i can support the growth of those sites with current server. thanks in advanced.
     
Loading...

Share This Page