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.

Apache - GET files / High CPU Usage

Discussion in 'Workarounds and Optimization' started by Massoud, Mar 13, 2011.

  1. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    I recently purchased a VPS/WHM/Cpanel with 2GHz CPU, 4GB RAM, I use CMS and try to optimize the code in perfect mode, My problem is a lot of cpu usage of Apache GET, sometimes GET an image or JS or CSS consume more that 3% of cpu, How can I reduce that? what's wrong with this?
    When I have more that 100 visitor at the same time my cpu usage get to highest 90%
    I've been trying different PHP Handler and find DSO has the best performance but there is no different in SuPHP or FCGI in matter of CPU usage.
    here is my Apache Status while the cpu usage and load is high:
    Your kind advices is highly appreciated:


     
  2. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    any ideas why apache consume alot of cpu usage for GET a file on a server ?
     
  3. 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
    The CPU usage could be high if the image is large. Optimize the images to reduce the size for one way to reduce CPU and memory.

    Another way would be to use mod_deflate to help optimize and compress website content:

    EasyApache Deflate Module - cPanel Inc.

    This option is in WHM > EasyApache (Apache Update) (or using /scripts/easyapache in root SSH) under "Apache Built-in Modules" on Step 6's Exhaustive Options List. It is listed as Deflate there.

    Upon recompiling Apache to add mod_deflate, you will then have an option in cPanel called Optimize Website that will allow you to configure that for each specific account.
     
  4. Massoud

    Massoud Active Member

    Joined:
    Feb 20, 2011
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    6
    Thank you for your answer, but all of the images on my website have jpeg comression and I can see one image that has just 3kb consume 20% of cpu usage, I think there is something wrong with it but I can not see anything in php or apache error log, by the way thank you for your help I'm going to install the mod DEflate and I'll inform you about the result.
     
Loading...

Share This Page