Questions and Answers

How do I collect points?

  • +4
    Chosen as best answer
  • +1
    Posted answer
  • +1
    Posted question
  • +1
    Thumb up
  • -1
    Thumb down
10

by Gary in Coding about January 4, 2012 canceled - report

CPU usage at server

I keep getting "Resource Limit Reached" error messages from my server. Their techs say the index.php page has a really high CPU usage when it loads. I'm looking for ideas to optimize? Has anyone else had this problem?

Answers: 4  •  Score 2  •  Views: 1856

4 Answers
Browse by
  • 17

    by Medici Medici about January 21, 2012

    Here is what I did:

    Get specifics from your hosting company about what they expect your performance characteristics to be on your server, you may have to ask specifically for this.

     

    Make sure you are running in production mode.

     

    Started with my home page with everything turned on as normal.

    Looked at the server CPU stats for my site (in my case LunarPages - which sadly doesn't allow you to manually refresh, but it updates every couple of minutes) - turn off a module or deactivate a plugin, and check again.

     

    By reducing the number of images displayed on the home page by about half I got under the point where the host was concerned about my resource usage on a shared server.

     

    Make a spreadsheet of your options turned on and off one at a time and see what each module costs in terms of load time and performance (the diagnostics on Firefox and Safari are both pretty good for load times)

     

    • Score: 0
  • 33

    by cp ccp about January 5, 2012

    Mine is from Spammers.   They are not getting past the sign up or sign in stage but they hammer at it over and over again. Mainly IP's from China.  It's very bad and takes up a lot of resources.

    People need to understand that when creating one of these sites, that you will need to spend a lot of money to host it so it will stay up and running.  Most everyone will buy 15 or more plugins because they are pretty much standard and needed. These bog down the system as they really shouldn't but they do.  Everyone who gets SE is looking for a cheap way to run the site but there really isn't any way.  It takes a lot of work and money.

    1 comment
    • Nick
      by Nick
      January 5, 2012

      I've noticed plugin Blogs is used by spammers only in most of cases :)

  • 400

    by Nick about January 5, 2012

    There are usually few reasons for this problem (listed by popularity from the most popular):

    1. A lot of modules.

    Try to keep number of modules less then 15. Test all 3rd party modules (with data). 

    2. Weak server or incorrect configuration.

    Check log files for clues (errors, warnings, out of memory situations), enable caching, make sure php runs as apache mod rather than cgi.

    3. A lot of visitors (including spam bots)

    Introduce moderation. Add Re-Captcha. Consider installing nginx server in addition to apache.

     

  • 395

    by Kapil Jain about January 4, 2012

    Hi Gary,

     

    Well there is no straight forward answer to this.There can be multiple reasons for this issue and some of reasons can be:

    1. User load on your site is higher so you must consider high hardware resources (RAM/Processors)

    2. Bad practices followed by custom developers thats the main reason its taking high resources.

    3. Configuration settings for server/database.

    4. Spammer who are hammering your site

     

    There can be other reason as well So I recommend you hire some professional to audit your site and come up with the solutions.

     

    Cheers,

    Kapil

    6 comments
    • cp ccp
      by cp ccp
      January 5, 2012

      Many of us would love to know what "bad practice by custom developers" is. We wouldn't have a clue what is right or wrong or what is almost right but not. It is very important to find developers who do things correctly but what do you ask?

    • Kapil Jain
      by Kapil Jain
      January 5, 2012

      totally agreed that its really difficult for non-technical person to judge the developers until faced situation like this. I think one should also ask for performance report for hundreds of concurrent users as well apart from the functionality.

    • cp ccp
      by cp ccp
      January 5, 2012

      True Kaplin! I think badly written software is sometimes bad because of the hardware it runs on throughout the world. From your hosting server to a users computer, to it's browser. I think that software is ahead of the hardwares limit. There is so much ...  more

    • Gary
      by Gary
      January 17, 2012

      Wow people - thanks for some good ideas to look at - the url to my site is <a href="http://A420Nation.com" target="_blank" rel="nofollow">http://A420Nation.com</a> - I've stripped most the plugins and mods until I...  more

Question was cancelled.