Wordpress Site shutdown for cpu usage, need help

by ErnieB
67 replies
Ive had many wordpress sets and most if not all use the same plug ins. Ive even had ones with more disk usage and 5X more traffic but for some reason this one keeps getting shut down for cpu usage. ( main index page )

Anyone have any ideas of what I can try or look for to correct the problem? ( Im using reseller hosting from hostgator )
#cpu #shutdown #site #usage #wordpress
  • Profile picture of the author Norma Rickman
    Are you using a caching plugin? That will help a lot with your CPU usage.

    HostGator recommends this one:

    WordPress › W3 Total Cache « WordPress Plugins

    I've used WP-Super Cache too, but W-3 Total Cache is not as resource intensive.
    Signature

    {{ DiscussionBoard.errors[3399330].message }}
  • Profile picture of the author Fernando Veloso
    Are you using THAT MUCH plugins? Cause thats a weird case, I have hundreds of WP sites and never had a problem.

    Have you looked into your theme files carefully?
    Signature
    People make good money selling to the rich. But the rich got rich selling to the masses.
    {{ DiscussionBoard.errors[3399344].message }}
  • Profile picture of the author nxtgencreative
    Either upgrade your account or get another account and off load the website onto its own account. Or you could get a virtual/dedicated server which should also eliminate the problem.

    How these hosting providers work is that they run a ton of sites on a single computer. When one sites uses to many resources they limit/shut down the site.
    {{ DiscussionBoard.errors[3399346].message }}
  • Profile picture of the author Christian Little
    The reason it's sucking up CPU power is because every pageview on a wordpress blog takes 10-15 mysql queries. If you are getting say 1000 page views/day, that's 10,000 - 15,000 mysql queries throughout the day. That actually puts a lot of strain on a shared box.

    Even if the blog in question gets less traffic, maybe you're running some kind of plugins on it that cause even more database queries to be run on every pageview. I have a blog running that does about 40 queries/page view for example.

    The best thing you can do is look at one of the caching plugins, ideally one that will create static .html files and will force your blog to serve those instead. That way mysql is only touched when you update the site somehow.

    This will take you huge CPU usage down to practically nothing and fix your problem
    {{ DiscussionBoard.errors[3399413].message }}
    • Profile picture of the author Fernando Veloso
      Originally Posted by Christian Little View Post

      The best thing you can do is look at one of the caching plugins, ideally one that will create static .html files and will force your blog to serve those instead. That way mysql is only touched when you update the site somehow.
      Christian, any recommendation? I've been using WP Super Cache but never used the .html function.
      Signature
      People make good money selling to the rich. But the rich got rich selling to the masses.
      {{ DiscussionBoard.errors[3399449].message }}
      • Profile picture of the author Christian Little
        Originally Posted by Fernando Veloso View Post

        Christian, any recommendation? I've been using WP Super Cache but never used the .html function.
        I use "W3 Total Cache" because it lets you cache more than just "everything", you can tell it just to cache database queries, or objects, or everything. It even lets you setup your blog to host images on a CDN like Amazon. It works really well for me.

        EDIT: It's also worth pointing out that when I was using HostGator and a blog started using too many resources, this is the plugin they suggested. Given how overloaded their servers are, it's probably one of the better options if they're telling people to use it.

        Here's the link: WordPress Optimization | W3 Total Cache | W3 EDGE | Boston, MA
        {{ DiscussionBoard.errors[3399628].message }}
        • Profile picture of the author jminkler
          WP is so under-optimized if you don't install the right plugins. There is no built in caching, no js and css compression, and no js and css combining, none of the themes I have seen use any sprites, very poor top to bottom.
          {{ DiscussionBoard.errors[3399678].message }}
          • Profile picture of the author ErnieB
            I have the W3 cache plugin installed and they have stated that I have it properly set up as well. One email response I got said something about 404 errors, I did have about 30 links to pages that I hadnt created yet, would that really cause the problem? I have since corrected that situation by pointing them all to a coming soon page but hostgator has yet to unsuspend my site for me to see if it has helped. They also recommended cloudflare and I have installed/used it now too but have yet to see if it helped due to them still not unsuspending my site.

            They take 8 hrs to respond to my emails and then its always a different person and instead of listening to what I said I did to try to correct the problem and unsuspending the account to see if it worked, they tell me they need my ip so they can unblock me so I can fix the problem. Its a never ending cycle that has been going on for 2 days now.

            Any other suggestions of what may be the cause/fix besides using W3 cache ( that was already there and didnt help )
            {{ DiscussionBoard.errors[3401023].message }}
        • Profile picture of the author cryptone24
          I am having a hard time understanding W3 Cache. Can you share your settings with us?

          Originally Posted by Christian Little View Post

          I use "W3 Total Cache" because it lets you cache more than just "everything", you can tell it just to cache database queries, or objects, or everything. It even lets you setup your blog to host images on a CDN like Amazon. It works really well for me.

          EDIT: It's also worth pointing out that when I was using HostGator and a blog started using too many resources, this is the plugin they suggested. Given how overloaded their servers are, it's probably one of the better options if they're telling people to use it.

          Here's the link: WordPress Optimization | W3 Total Cache | W3 EDGE | Boston, MA
          {{ DiscussionBoard.errors[3821923].message }}
          • Profile picture of the author Christian Little
            Originally Posted by cryptone24 View Post

            I am having a hard time understanding W3 Cache. Can you share your settings with us?
            Enable the following:

            -Page Cache (this is the biggest load saver)
            -Minify
            -Browser Cache (this is the 2nd biggest load saver)


            There's 3 others that are optional:

            -Object Cache (useful if you have a huge number of objects, but not a big deal)
            -Database Cache (useful if you are making a lot of posts every day, I leave it off usually)
            -CDN (use this if you have an Amazon CDN account)
            {{ DiscussionBoard.errors[3823618].message }}
  • Profile picture of the author indolesman
    I use godaddy and I have never had a problem, sounds like you need to change hosts
    {{ DiscussionBoard.errors[3399495].message }}
  • Profile picture of the author Christian Little
    ErnieB - how much traffic does this site get? Seems to be a lot of hoops they're making you jump through to fix this.

    Are you able to access you files and everything right now? Can you login to cPanel? If so, do a complete backup of EVERYTHING. HG may just close you account down and you want to make sure you are backed up and can move easily.
    {{ DiscussionBoard.errors[3401115].message }}
    • Profile picture of the author ErnieB
      I can access the wp-admin and the site itself ( including forum ) but cannot access cpanel or webmail. I could probably send another email and tell them this and they would grant access but then not release my site, lol. I also have ftp access through filezilla.

      I really want to see if the latest changes I made fix/help solve the problem.
      {{ DiscussionBoard.errors[3401161].message }}
      • Profile picture of the author jminkler
        Originally Posted by ErnieB View Post

        I can access the wp-admin and the site itself ( including forum ) but cannot access cpanel or webmail. I could probably send another email and tell them this and they would grant access but then not release my site, lol. I also have ftp access through filezilla.

        I really want to see if the latest changes I made fix/help solve the problem.
        What plugins do you have installed?
        {{ DiscussionBoard.errors[3401526].message }}
        • Profile picture of the author ErnieB
          Plugins installed are ...

          Akismet
          Contact Form 7
          Easy Privacy Policy
          Exec-Php
          Google Analytics for Wordpress
          Google XML Sitemaps
          Gregs High Performance Seo
          MaxBlogPress Ping Optimizer
          Onlywire for wordpress
          phpbay lite
          W3 Cache
          {{ DiscussionBoard.errors[3402082].message }}
          • Profile picture of the author jminkler
            Originally Posted by ErnieB View Post

            Plugins installed are ...

            Akismet
            Contact Form 7
            Easy Privacy Policy
            Exec-Php
            Google Analytics for Wordpress
            Google XML Sitemaps
            Gregs High Performance Seo
            MaxBlogPress Ping Optimizer
            Onlywire for wordpress
            phpbay lite
            W3 Cache
            What kind of code you doing with exec-php?
            {{ DiscussionBoard.errors[3402215].message }}
            • Profile picture of the author ErnieB
              its needed for the phpbay lite to work ( at least it was a year or 2 ago when I learned about it ) Its used so ebay auctions can be displayed on my pages/posts
              {{ DiscussionBoard.errors[3402266].message }}
        • Profile picture of the author scwilko
          Hi ErnieB,

          We have had similar trouble in the past with HostGator's reseller hosting as well as SEO Hosting(by HostGator).

          Here's some plugins to use and some to avoid or delete:

          Use:
          • GD Press Tools Lite(Dev4Press | GD Press Tools: Download) - to check how many queries are running and what plugins are responsible, to clean up your Database tables and mass delete spam and post revisions etc. (Dashboard > GD Press Tools: Additional Options Admin Bar)
          • Chennai Central (Chennai Central) - saves bandwidth by telling search engine bots to "go away" if nothing has changed.
          • (W3 Total Cache)

          Delete:
          • Broken Link Checker
          • AskApache Crazy Cache

          To use GD Press Tools Lite to check how many queries your plugins are running on your homepage:
          Go to GD Press Tools > Settings > Debug and in SQL Queries select Enable logging of SQL queries and Add SQL queries at the end of the blog pages.
          Then clear your browser cache and load your homepage. Scroll down the bottom and you will see how many queries were run and by which plugins.
          Deactivate any unnecessary plugins that run too many queries.

          When you talk to HostGator support, tell them everything you have done and why you think this should have resolved the load on their cpu. Also tell them you are happy to do anything else they suggest and they should reactivate your account.

          Hope that helps.

          Shane
          {{ DiscussionBoard.errors[3402345].message }}
          • Profile picture of the author ErnieB
            Originally Posted by scwilko View Post

            Hi ErnieB,

            Use: [LIST][*]GD Press Tools Lite(Dev4Press | GD Press Tools: Download) - to check how many queries are running and what plugins are responsible, to clean up your Database tables and mass delete spam and post revisions etc. (Dashboard > GD Press Tools: Additional Options Admin Bar)

            To use GD Press Tools Lite to check how many queries your plugins are running on your homepage:
            Go to GD Press Tools > Settings > Debug and in SQL Queries select Enable logging of SQL queries and Add SQL queries at the end of the blog pages.
            Then clear your browser cache and load your homepage. Scroll down the bottom and you will see how many queries were run and by which plugins.
            Deactivate any unnecessary plugins that run too many queries.

            Shane
            Thanks, The first time I view a page I have about 100-150 queries ( depending on the page i viewed ), when i refresh its down to about 10-20 queries. I dont understand how to read the queriy lines or if this is normal or high amount.
            {{ DiscussionBoard.errors[3402647].message }}
            • Profile picture of the author scwilko
              Thanks, The first time I view a page I have about 100-150 queries ( depending on the page i viewed ), when i refresh its down to about 10-20 queries. I dont understand how to read the queriy lines or if this is normal or high amount.
              Try clearing your Page cache in W3 Total Cache as well as your browser cache, then reload the front page. If that doesn't work, the number of queries you see on other pages should be a good guide.

              My guess is the number of queries goes down when you refresh because your browser is loading from it's cache. Always delete the browser cache when you reload the page.

              Deactivate any plugins you suspect one at a time and reload a page to see if the number of queries drops a lot. I think 118 queries is high, I get about 30 to 50 with sites that have a good number of plugins running.

              Shane
              {{ DiscussionBoard.errors[3402793].message }}
            • Profile picture of the author Christian Little
              Originally Posted by ErnieB View Post

              Thanks, The first time I view a page I have about 100-150 queries ( depending on the page i viewed ), when i refresh its down to about 10-20 queries. I dont understand how to read the queriy lines or if this is normal or high amount.

              100-150 queries per pageload is obscene, there's gotta be something fishy going on there.

              Can you list off which plugins you have installed and running right now?

              What theme are you using?
              {{ DiscussionBoard.errors[3403896].message }}
            • Profile picture of the author jminkler
              Originally Posted by ErnieB View Post

              Thanks, The first time I view a page I have about 100-150 queries ( depending on the page i viewed ), when i refresh its down to about 10-20 queries. I dont understand how to read the queriy lines or if this is normal or high amount.
              My guess is the exec-php or ebay plugin, which plugins did it say were running the queries?

              100-150 is obscene. You really want < 5 per page. If you have the caching plugins, something isn't right at all.
              {{ DiscussionBoard.errors[3403930].message }}
  • Profile picture of the author pc101seo
    Originally Posted by ErnieB View Post

    Ive had many wordpress sets and most if not all use the same plug ins. Ive even had ones with more disk usage and 5X more traffic but for some reason this one keeps getting shut down for cpu usage. ( main index page )

    Anyone have any ideas of what I can try or look for to correct the problem? ( Im using reseller hosting from hostgator )
    Try to upgrade your Server, here are the criteria.


    Amount of web space
    File type and size limitations
    Bandwidth allotment
    Reliability and speed of access
    Data Transfer (Traffic/Bandwidth)
    Technical support
    FTP, PHP, Perl, SSI, .htaccess, telnet, SSH, MySQL, crontabs
    SSL (secure server), Shopping Cart
    Email, Autoresponders, POP3, Mail Forwarding
    Control Panel
    Multiple Domain Hosting and Subdomains
    {{ DiscussionBoard.errors[3402366].message }}
  • Profile picture of the author wayfarer
    Get a professional to optimize it, or else get a virtual private server so you can dedicate more resources to it. This is often what happens when you try to solve all your problems by just adding more plugins. Without solving at least SOME of your problems in a custom manner, you're always going to be creating the "splinter effect", in which layers and layers of unnecessary bloat code are added to solve only a limited set of problems.

    My vote/guess also goes to the exec-php in combination with the ebay plugin
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[3404422].message }}
  • Profile picture of the author ErnieB
    I have multiple queries like this will just the bolded number changed. 35 of the 56 queries were this code below ( just number changed )

    # Call originated from: require, require_once, include, get_header, locate_template, load_template, require_once, wp_nav_menu, wp_get_nav_menu_items, get_post_meta, get_metadata, update_meta_cache, W3_Db->query
    Execution time: 0.000116109848022
    SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (285)

    I dont recognize any plugin names on almost zero queries. One query looks to be maxblogpingoptimizer cause it references ping but the rest are all wp and meta keyword related
    {{ DiscussionBoard.errors[3404548].message }}
    • Profile picture of the author jminkler
      Originally Posted by ErnieB View Post

      I have multiple queries like this will just the bolded number changed. 35 of the 56 queries were this code below ( just number changed )

      # Call originated from: require, require_once, include, get_header, locate_template, load_template, require_once, wp_nav_menu, wp_get_nav_menu_items, get_post_meta, get_metadata, update_meta_cache, W3_Db->query
      Execution time: 0.000116109848022
      SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (285)

      I dont recognize any plugin names on almost zero queries. One query looks to be maxblogpingoptimizer cause it references ping but the rest are all wp and meta keyword related
      This is the problem right here, not hosting, or javascript, or anything else. This is poorly executed cause what it should be doing (if it should do anything at all) is querying ALL the posts that it needs to work with at the same time in a "IN" clause. Instead it appears that it is running a query for each post that is on the page, to update the meta tags.

      If you have the WP cache (whichever one) running correctly, these pages should not be running ANY php at all. What should be happening is the caching plugin creates an HTML file, and adds it to the .htaccess rewrites to hit the HTML file directly.

      Any sitemap plugin or cacher will update the cache on new posts or new plugin updates and installs.

      *** If this is not happening on your site you have something configured wrong **
      {{ DiscussionBoard.errors[3404984].message }}
  • Profile picture of the author SteveJohnson
    One thing that I've not seen addressed here is the theme you're using - a poorly-written theme can add a LOT of overhead in terms of db calls and resources used.

    If you want to do a quick and dirty check, load the old Classic theme and check the number of queries.
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3404618].message }}
  • Profile picture of the author Evan-M
    whats the page in question? im willing to bet its throttle time that is getting your site shut down.


    throttle time is usually caused by a bad JavaScript or missing JavaScript that is trying to load.

    open your site in ie, and see if there are any errors on the page ( it will say "done but with errors") or something along them lines in the corner,

    click the error and it will tell you what script is causing the issue.

    i cannot see it being based on database calls. frig most dynamic sites ( including this one) have multiple calls to the database on every page load. I really doubt thats the issue.


    youi still should really consider optimizing your pages, as 150 queries is TOO much , but not anywhere near what would get your site shut down.
    Signature

    Evan-M

    Easily The Worlds Best Wordpress Popup plugin

    Visit Website Design Firm For All Your Wordpress Coding Needs

    {{ DiscussionBoard.errors[3404639].message }}
  • Profile picture of the author wayfarer
    Originally Posted by Amys101place View Post

    I had a similar issue that was being caused by the google xml sitemaps plugin you're running.
    You can always do without a sitemaps plugin. Wordpress blogs don't need a sitemap, because they use a ping service that tells search engines and directories about new content.

    A sitemap is only useful if parts of your site are not linked to, or you need to tell search engines about new content. Wordpress's ping solves both of these problems.
    Signature
    I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
    {{ DiscussionBoard.errors[3404668].message }}
    • Profile picture of the author jminkler
      Originally Posted by Amys101place View Post

      Agreed! I had the same thought when I started having my memory problems. I got rid of the xml sitemap plugin altogether and saw a huge improvement.
      Sitemap and other posting updates should have ZERO effect on memory with normal usage (normal traffic).

      After the xml file is updated it's complete. Schedule a cron to post your updates at night/early morning if you can.
      {{ DiscussionBoard.errors[3405006].message }}
      • Profile picture of the author jminkler
        Originally Posted by Amys101place View Post

        Not true in my case. I can launch the building of my sitemap and launch my live memory script and watch one sitemap cause an increase of over 15MB. If you're rebuilding thousands of records (over 100,000 for one site of mine), it will affect memory. Your traffic has nothing to do with your sitemap being rebuilt.. normal or otherwise.. but a running process will use memory every time and I track mine by PID so I know this is the reason. Try that on a shared hosting plan with GoDaddy who gives you a max of 32MB (last I heard anyway). You can use a SSH tool to verify this is accurate. It's the whole reason I've been trying out both a VPS and cloud solution for migration.

        I do agree with doing all cron jobs in early morning though. That makes a substantial difference.
        But that's my point, even if you had 10,000 records, your not dumping your whole site with 10,000 NEW records, it should just be adding the new one everytime.

        Time to invest in some better programming, not more exp monthly costs, just for a sitemap!
        {{ DiscussionBoard.errors[3405871].message }}
        • Profile picture of the author jminkler
          Originally Posted by Amys101place View Post

          That's not the proper way to build a sitemap. In my case, I have sites that delete hundreds of records a day that are older than 60 days and insert hundreds of new records a day. Simply adding to a sitemap wouldn't work. Consider the ever popular wprobot3 plugin or classified ads websites. You would need to delete the older records... often hundreds or thousands.. and recreate your entire sitemap for it to be valid.

          Regardless of what it should be doing, if you take a look at what the WordPress Sitemaps plugin does, it creates a static sitemap file right in your wordpress directory and recreates it every time. I'm just offering suggestions on what might help based on past experiences.
          Well that's why you don't put every file in the sitemap but allow the bot to find the articles from a given point, say a category or author. Take a look at how ezinearticles does it.
          {{ DiscussionBoard.errors[3406606].message }}
          • Profile picture of the author ErnieB
            Cant get firebug to download, takes me to a directory of files instead of downloading
            {{ DiscussionBoard.errors[3406616].message }}
            • Profile picture of the author jminkler
              Originally Posted by ErnieB View Post

              Cant get firebug to download, takes me to a directory of files instead of downloading
              Firebug

              Top right "Install Firebug"

              Click - Firebug 1.6: Recommended
              firebug-1.6.2.xpi
              {{ DiscussionBoard.errors[3406624].message }}
      • Profile picture of the author jminkler
        Originally Posted by Amys101place View Post

        Not true in my case. I can launch the building of my sitemap and launch my live memory script and watch one sitemap cause an increase of over 15MB. If you're rebuilding thousands of records (over 100,000 for one site of mine), it will affect memory. Your traffic has nothing to do with your sitemap being rebuilt.. normal or otherwise.. but a running process will use memory every time and I track mine by PID so I know this is the reason. Try that on a shared hosting plan with GoDaddy who gives you a max of 32MB (last I heard anyway). You can use a SSH tool to verify this is accurate. It's the whole reason I've been trying out both a VPS and cloud solution for migration.

        I do agree with doing all cron jobs in early morning though. That makes a substantial difference.
        None of you, SERIOUSLY, none of you should be looking at cloud hosting solutions, even amazon to host images or your sites. The reason your having all these problems is WP not your hosting. You need the right plugins, and perhaps some better coded ones.

        I mean unless your doing MILLIONS of visitors a day, and you are already on a VPS. With WP caching setup correctly, and a FULLLY optimized page (compressed files -gzip, compressed js and css, and COMBINED, and icons made to sprites, and js on bottom of page, etc etc) at that point you should be serving at most 1 html file (no php ran), 1 css file, 1-2 js files (analytics) , 1 icon sprite, and possibly 1-2 images (optimized!) per post.

        Seriously I look at what some of these sites load up in Firebug, 134 requests for the site we are looking at here, that's 134 different objects the browser has to load up to show the page. Most browsers by DEFAULT only load 4 objects at a time per domain. Now, most of you don't even take advantage of your amazon CDN's by CODING them correctly. What's the point of having amazon hosted images when they are still being blocked from all the other garbage being loaded? All those images are blocking anyways, why not mix it up too? some hosted on amazon, some on the domain. Are you specifying the width and height of each image? if not, the browser has to spend time to re-render the page.

        There are TONS of things you can do to optimize your site, going to the cloud is not one of them for wordpress ..
        {{ DiscussionBoard.errors[3405945].message }}
        • Profile picture of the author ErnieB
          When I clicked the link to my page from your post i ended up with 17 queries. As for your mentioning not needing cloud stuff or images on amazon. I got no clue about any of that stuff, I just signed up for them cause it was mentioned as a possible solution. I dont know how to do anything your suggesting, lol. I know just enough to get myself into trouble as you see. I have no clue if what I signed up for is set up/working properly or not.

          And i dont understand any of the technical mumbo jumbo of optimizing my js this php that. I do understand image size but dont know how to incorporate it like you say to "optimize it" or make it so it isnt "blocked"

          Originally Posted by jminkler View Post

          None of you, SERIOUSLY, none of you should be looking at cloud hosting solutions, even amazon to host images or your sites. The reason your having all these problems is WP not your hosting. You need the right plugins, and perhaps some better coded ones.

          I mean unless your doing MILLIONS of visitors a day, and you are already on a VPS. With WP caching setup correctly, and a FULLLY optimized page (compressed files -gzip, compressed js and css, and COMBINED, and icons made to sprites, and js on bottom of page, etc etc) at that point you should be serving at most 1 html file (no php ran), 1 css file, 1-2 js files (analytics) , 1 icon sprite, and possibly 1-2 images (optimized!) per post.

          Seriously I look at what some of these sites load up in Firebug, 134 requests for the site we are looking at here, that's 134 different objects the browser has to load up to show the page. Most browsers by DEFAULT only load 4 objects at a time per domain. Now, most of you don't even take advantage of your amazon CDN's by CODING them correctly. What's the point of having amazon hosted images when they are still being blocked from all the other garbage being loaded? All those images are blocking anyways, why not mix it up too? some hosted on amazon, some on the domain. Are you specifying the width and height of each image? if not, the browser has to spend time to re-render the page.

          There are TONS of things you can do to optimize your site, going to the cloud is not one of them for wordpress ..
          {{ DiscussionBoard.errors[3406009].message }}
          • Profile picture of the author jminkler
            Ernie, if you dont have Firebug for firefox get it. Also, YSlow! plugin from yahoo, or Page Speed from google.

            The "Net" tab is your friend. In the YSlow! plugin it will tell you how to optimize the page. Just follow all the links or read here ..

            Best Practices for Speeding Up Your Web Site

            Who suggested amazon as a solution? Your hosting provider?
            {{ DiscussionBoard.errors[3406427].message }}
            • Profile picture of the author ErnieB
              someone in this thread suggested that images can use a lot of resources and that optimizing them or uses something like S3 could help.

              Thanks for the recommendations I will check them out and see if I can figure out how to use them.
              {{ DiscussionBoard.errors[3406437].message }}
              • Profile picture of the author jminkler
                Originally Posted by ErnieB View Post

                someone in this thread suggested that images can use a lot of resources and that optimizing them or uses something like S3 could help.

                Thanks for the recommendations I will check them out and see if I can figure out how to use them.

                The images themselves are not using resources. Its FINDING the images to use, which post, which thumbnail, etc...
                {{ DiscussionBoard.errors[3406617].message }}
                • Profile picture of the author guitarjosh
                  Originally Posted by jminkler View Post

                  The images themselves are not using resources. Its FINDING the images to use, which post, which thumbnail, etc...
                  Images don't use resources?!!! [scratching my head....] New to the web?
                  {{ DiscussionBoard.errors[3406833].message }}
                  • Profile picture of the author Evan-M
                    Originally Posted by guitarjosh View Post

                    Images don't use resources?!!! [scratching my head....] New to the web?

                    they use hard drive space and bandwidth , but not so much cpu processing. in some cases where people add a image without the width and height ex:

                    <img src="pic.jpg">

                    instead of

                    <img src="pic.jpg" width="46" height="26">

                    the cpu has to do a little work ( it can get to large amounts on sites with allot of images) but no where near enough to cause a problem like this without being in combination with other factors.
                    Signature

                    Evan-M

                    Easily The Worlds Best Wordpress Popup plugin

                    Visit Website Design Firm For All Your Wordpress Coding Needs

                    {{ DiscussionBoard.errors[3406957].message }}
                  • Profile picture of the author jminkler
                    Originally Posted by guitarjosh View Post

                    Images don't use resources?!!! [scratching my head....] New to the web?
                    No not new to the web at all, read the thread. Perhaps sipping on the guru Kool-aid?
                    {{ DiscussionBoard.errors[3407059].message }}
    • Profile picture of the author DavidBratvold
      ErnieB,

      I'm in the same boat you are. I'm trying to find the culprit, and here's what I've been doing that seems to be helping:

      I copied the site to a beta site so I could tear it apart.
      Installed GD Press Tools
      DEactivated W3 Total cache (so I could see real numbers - since cache doesn't always optimize a page load & makes it so the numbers aren't consistent)

      Then, I'm looking at my homepage. Everytime I hit refresh, I look at this line (from GD Press Tools) at the bottom of my page:
      "Total number of queries: 89"
      I'll deactivate something & see how many queries it saves. Here's my grid:

      Function - How many queries it uses
      --------------------------------------------------------
      all plugins - 16 queries
      Top Navigation menu - 8
      bottom nav menu - 7
      Blog list of 20 latest posts (homepage) - 59 !!

      Just start tearing your BACKUP site apart, to see what decreases the queries. I deactivated/deleted:
      All plugins
      All widgets
      All menus
      Sidebars (facebook boxes)
      Footer (comments/tag cloud)

      Then (I have a little php knowledge), I was still getting 89 queries on homepage (I started at 298!), I started deleting lines from my template's index.php file. It turns out, there's a php function called: the_post_thumbnail() that uses 3 queries for each post (20 posts * 3 = 60 queries on homepage!)

      That's where I'm at. Still looking for more...
      {{ DiscussionBoard.errors[3405750].message }}
      • Profile picture of the author jminkler
        Originally Posted by DavidBratvold View Post

        ErnieB,

        I'm in the same boat you are. I'm trying to find the culprit, and here's what I've been doing that seems to be helping:

        I copied the site to a beta site so I could tear it apart.
        Installed GD Press Tools
        DEactivated W3 Total cache (so I could see real numbers - since cache doesn't always optimize a page load & makes it so the numbers aren't consistent)

        Then, I'm looking at my homepage. Everytime I hit refresh, I look at this line (from GD Press Tools) at the bottom of my page:
        "Total number of queries: 89"
        I'll deactivate something & see how many queries it saves. Here's my grid:

        Function - How many queries it uses
        --------------------------------------------------------
        all plugins - 16 queries
        Top Navigation menu - 8
        bottom nav menu - 7
        Blog list of 20 latest posts (homepage) - 59 !!

        Just start tearing your BACKUP site apart, to see what decreases the queries. I deactivated/deleted:
        All plugins
        All widgets
        All menus
        Sidebars (facebook boxes)
        Footer (comments/tag cloud)

        Then (I have a little php knowledge), I was still getting 89 queries on homepage (I started at 298!), I started deleting lines from my template's index.php file. It turns out, there's a php function called: the_post_thumbnail() that uses 3 queries for each post (20 posts * 3 = 60 queries on homepage!)

        That's where I'm at. Still looking for more...

        Seems this is the case across the board as I am starting with a fresh install ..

        Ernie,
        How many queries run on this page?
        Playsets » Spartan Bloks
        {{ DiscussionBoard.errors[3405879].message }}
        • Profile picture of the author DavidBratvold
          Is there a way to find out exactly which file, script, page, etc... is causing the majority of a WP site's CPU usage?
          {{ DiscussionBoard.errors[3411106].message }}
          • Profile picture of the author Evan-M
            Originally Posted by DavidBratvold View Post

            Is there a way to find out exactly which file, script, page, etc... is causing the majority of a WP site's CPU usage?
            you could run your site through one similar to below and determine load speeds of each element, you can pretty much guess the culprit in most cases based on the stats

            Web Page Analyzer - free website optimization tool website speed test check website performance report from web site optimization
            Signature

            Evan-M

            Easily The Worlds Best Wordpress Popup plugin

            Visit Website Design Firm For All Your Wordpress Coding Needs

            {{ DiscussionBoard.errors[3411135].message }}
          • Profile picture of the author jminkler
            Originally Posted by DavidBratvold View Post

            Is there a way to find out exactly which file, script, page, etc... is causing the majority of a WP site's CPU usage?
            If your running VPS you could install the xdebug php extension. Or, you could download your site, and mysql backup and run it locally.
            {{ DiscussionBoard.errors[3411389].message }}
            • Profile picture of the author DavidBratvold
              Originally Posted by jminkler View Post

              If your running VPS you could install the xdebug php extension. Or, you could download your site, and mysql backup and run it locally.
              I downloaded my WordPress 3.0x site locally, to my Win 7 computer (just a normal desktop - not a 'server' or anything). MySQL db too.

              I installed Xampp. I've got my site working on localhost/wordpress/

              What specifically do I do, to diagnose it? I just have my Task Manager (Performance tab) open, watching CPU Usage as I navigate to each page. I don't find it too helpful, as it spikes to 10-50% on every page load (for 1/2 sec maybe) for a fresh, vanilla, install of WP. As I programmed a lot of the plugins myself, I would like to see where I've done a 'poor job.'

              Thanks Jarret,

              -David
              {{ DiscussionBoard.errors[3411690].message }}
  • Profile picture of the author jminkler
    Originally Posted by Amys101place View Post

    I had a similar issue that was being caused by the google xml sitemaps plugin you're running. I had a couple sites with 75,000 - 100,000 pages and with every new entry, it was rebuilding that sitemap... which took several minutes each time. I was using cron to create new entries every hour, so the server was working very hard just to keep up with the sitemap. Not sure how big your blogs are though...
    Yes, in this case when your running it every hour, and probably before it finishes the previous time, you can run into memory problems. If you know FOR SURE that you are not deleting any posts, you could probably optimize it to only append new entries to the end of the files saving TONS of processing.
    {{ DiscussionBoard.errors[3405034].message }}
  • Profile picture of the author ErnieB
    Ive got rid of the sitemaps plugin and the theme I am using is called "Graphene". Ive looked at the site with internet explorer and do not notice it saying any errors.

    As for the query I posted above, it is from a page and not a post or front page so there should be no reference to any posts in my mind?

    It seems that there is quite a few queries at first, but then the cache kicks in and on future page views it is down to a more managable. Isnt that suppose to be how it works?

    I am using the W3 cache plugin and have all the boxes checked to enable all the different cahce and have selected "disk" as the method. No clue really on how to set it up properly

    With the GD tools, will it display the queries for all visitors at bottom of page or just me? I dont have it currently set to display them but anyone can view the site ( and I can turn it on if you want ) spartanbloks.com
    {{ DiscussionBoard.errors[3405070].message }}
    • Profile picture of the author jminkler
      Originally Posted by ErnieB View Post

      It seems that there is quite a few queries at first, but then the cache kicks in and on future page views it is down to a more managable. Isnt that suppose to be how it works?
      No that's browser cache, not server cache. Cache should be already "primed" before the first visitor. Unless different plugins work different ways, caching the first visitor visit "priming" the cache.

      I haven't looked into how each one works at the code level.

      JavaScript has nothing to do with this, JavaScript is run at the client's computer.

      What plugins do you have creating/updating meta tags?
      {{ DiscussionBoard.errors[3405228].message }}
      • Profile picture of the author ErnieB
        I have no clue, these are the current plug ins. At the advice of the tech support I signed my site up for cloudflare and its running through it ( I think ) I also moved all images to Amazon S3.

        Akismet
        Contact Form 7
        Cloudflare
        Easy Privacy Policy
        Exec-Php
        Google Analytics for Wordpress
        GD PressTools
        Gregs High Performance Seo
        MaxBlogPress Ping Optimizer
        No Right Click Images plugin
        Onlywire for wordpress EDITE: Just saw above post and deactivated this
        phpbay lite
        W3 Cache
        {{ DiscussionBoard.errors[3405268].message }}
        • Profile picture of the author jminkler
          Originally Posted by ErnieB View Post

          I have no clue, these are the current plug ins. At the advice of the tech support I signed my site up for cloudflare and its running through it ( I think ) I also moved all images to Amazon S3.

          Akismet
          Contact Form 7
          Cloudflare
          Easy Privacy Policy
          Exec-Php
          Google Analytics for Wordpress
          GD PressTools
          Gregs High Performance Seo
          MaxBlogPress Ping Optimizer
          No Right Click Images plugin
          Onlywire for wordpress EDITE: Just saw above post and deactivated this
          phpbay lite
          W3 Cache
          Will look into Greg's plugin, MaxBlog, and W3 Cache (for proper settings)

          btw. the right click image plugin
          http://s3.amazonaws.com/media.sparta...Images/Arbitor Fig.jpg
          (link doesn't work cause of space in filename)
          Useless if somebody really wants your images....
          {{ DiscussionBoard.errors[3405353].message }}
          • Profile picture of the author Evan-M
            Originally Posted by jminkler View Post

            Will look into Greg's plugin, MaxBlog, and W3 Cache (for proper settings)

            btw. the right click image plugin
            http://s3.amazonaws.com/media.sparta...Images/Arbitor Fig.jpg
            (link doesn't work cause of space in filename)
            Useless if somebody really wants your images....
            i was just going to say that

            i was able to grab a image in 3 seconds, if you inspect elements, it will show the link for each image in the code, that is click-able and can right click/save, adds about 3 seconds to the stealing process lol.

            Signature

            Evan-M

            Easily The Worlds Best Wordpress Popup plugin

            Visit Website Design Firm For All Your Wordpress Coding Needs

            {{ DiscussionBoard.errors[3405435].message }}
            • Profile picture of the author ErnieB
              I know but kids are either not that smart or too lazy to waste those precious 3 seconds, lol

              The gregs plug in was recommended by them to replace my all in one seo pack. The W3 was also recommended by them but I already had it installed ( no clue on configuring tho ). Really no clue of the maxblogpress ping plug in, I just remember it being recommended a long time ago so I keep installing it on all my sites.

              BTW just wanted to say thanks to all of those that have taken time to comment and try to help me. I really appreciate it.


              EDIT: anyone seeing the queries listed at the bottom of the page/s?
              {{ DiscussionBoard.errors[3405477].message }}
              • Profile picture of the author Evan-M
                Originally Posted by ErnieB View Post

                I know but kids are either not that smart or too lazy to waste those precious 3 seconds, lol

                The gregs plug in was recommended by them to replace my all in one seo pack. The W3 was also recommended by them but I already had it installed ( no clue on configuring tho ). Really no clue of the maxblogpress ping plug in, I just remember it being recommended a long time ago so I keep installing it on all my sites.

                BTW just wanted to say thanks to all of those that have taken time to comment and try to help me. I really appreciate it.


                EDIT: anyone seeing the queries listed at the bottom of the page/s?
                I would have stuck with the seo all in one plugin ( one of the only I install on all sites)

                http://perishablepress.com/wpseo-vs-aioseo/

                you would also be amazed what kids will do when you tell them you can't lol. when i was a kid i would have stole your images just because i knew you didn't want me to lol.
                Signature

                Evan-M

                Easily The Worlds Best Wordpress Popup plugin

                Visit Website Design Firm For All Your Wordpress Coding Needs

                {{ DiscussionBoard.errors[3405518].message }}
              • Profile picture of the author jminkler
                Originally Posted by ErnieB View Post

                I know but kids are either not that smart or too lazy to waste those precious 3 seconds, lol

                The gregs plug in was recommended by them to replace my all in one seo pack. The W3 was also recommended by them but I already had it installed ( no clue on configuring tho ). Really no clue of the maxblogpress ping plug in, I just remember it being recommended a long time ago so I keep installing it on all my sites.

                BTW just wanted to say thanks to all of those that have taken time to comment and try to help me. I really appreciate it.


                EDIT: anyone seeing the queries listed at the bottom of the page/s?
                Try disabling the greg's plugin, that seems to me to be the culprit. **Edit, no it's probably not**

                No, we don't see the Queries, probably only admin logins can see. **Edit: which page do you see 150 queries? **
                {{ DiscussionBoard.errors[3405597].message }}
              • Profile picture of the author ErnieB
                everything seems to be at about 20 or less queries... At least the site hasnt been suspended yet, lol. Guess I will just have to wait and see.

                I did deactivate the gregs but didnt notice any real changes so I reactivated it.
                {{ DiscussionBoard.errors[3405709].message }}
      • Profile picture of the author ErnieB
        I also just restored the listing of queries so it probably will show at the bottom of the page if you view it again to see it all
        {{ DiscussionBoard.errors[3405313].message }}
    • Profile picture of the author Evan-M
      Originally Posted by ErnieB View Post

      Ive got rid of the sitemaps plugin and the theme I am using is called "Graphene". Ive looked at the site with internet explorer and do not notice it saying any errors.

      As for the query I posted above, it is from a page and not a post or front page so there should be no reference to any posts in my mind?

      It seems that there is quite a few queries at first, but then the cache kicks in and on future page views it is down to a more managable. Isnt that suppose to be how it works?

      I am using the W3 cache plugin and have all the boxes checked to enable all the different cahce and have selected "disk" as the method. No clue really on how to set it up properly

      With the GD tools, will it display the queries for all visitors at bottom of page or just me? I dont have it currently set to display them but anyone can view the site ( and I can turn it on if you want ) spartanbloks.com
      Are you sure your just aren't getting too much traffic for your current hosting package. Took a look at the site, and its really not all that bad, things could use some optimizing, but I don't really think its so much the page, but the traffic/bandwidth and your current host.
      Signature

      Evan-M

      Easily The Worlds Best Wordpress Popup plugin

      Visit Website Design Firm For All Your Wordpress Coding Needs

      {{ DiscussionBoard.errors[3405253].message }}
      • Profile picture of the author jminkler
        Originally Posted by Evan-M View Post

        Are you sure your just aren't getting too much traffic for your current hosting package. Took a look at the site, and its really not all that bad, things could use some optimizing, but I don't really think its so much the page, but the traffic/bandwidth and your current host.
        Evan, his site is doing 150 queries per page. This is not a hosting problem.
        {{ DiscussionBoard.errors[3405257].message }}
        • Profile picture of the author jminkler
          What is the Onlywire plugin your using for sharing? its horrific on the client side page load, disable it for faster load times or pick only 3-4 "shares". It's blocking the page loading significantly, and will mess up your analytics (analytics is loaded last and these images are blocking the page load by 1s per image).

          That has nothing to do with CPU usage, just an observation.
          {{ DiscussionBoard.errors[3405263].message }}
  • Profile picture of the author Johnny12345
    I've heard that your permalink structure can cause problems, as well.

    If you use a very short structure -- such as postname alone -- it works the database hard and slows it down if you have a lot of content.

    John
    {{ DiscussionBoard.errors[3405299].message }}
  • Profile picture of the author phpbbxpert
    I agree with the above statement 101%!

    I say it and see it all the time.
    Along with avoid plug-ins unless it is essential to the functionality of the site.
    Then if you use such a plug-in, check the code(is it properly coded), if you can't read code, read comments about it ect...
    Find out if it functions correctly or has issues, most have issues, including loading extra files, multiple queries, etc....

    A lot of themes out there are awful as far as code also.

    Optimise the site itself first, theme, files, plug-ins, scripts, http requests...

    Recent functions from WP such as the_post_thumbnail() can have heavy loads as they are new and not optimal yet. Be careful when using them.

    The menu system is another feature that I benchmarked and is high on queries.
    Fine if you have one menu, but some themes use this everywhere and it can get heavy quick.

    Widgets can also have some high queries.

    It doesn't take long to over load a site when not paying attention to what it is doing on the backend.
    {{ DiscussionBoard.errors[3405998].message }}
  • Profile picture of the author DavidBratvold
    Ernie, I'm new & cannot reply to your PM. If you PM me your email address, I can reply to your original PM.
    {{ DiscussionBoard.errors[3406129].message }}
  • Profile picture of the author Evan-M
    another good extention ( for chrome) is monster, it analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.

    I use it in extension to firefox and it works well
    Signature

    Evan-M

    Easily The Worlds Best Wordpress Popup plugin

    Visit Website Design Firm For All Your Wordpress Coding Needs

    {{ DiscussionBoard.errors[3406658].message }}
  • Profile picture of the author phpbbxpert
    @DavidBratvold Code analysis gets a lot more technical than opening Task Manager.

    FireBug -> Net tab for HTTP requests and header, etc....
    PHPUnit & CodeCoverage for PHP unit tests (Very advanced)
    WebGrind for basic PHP coverage, process times etc... Works well.
    XDebug PHP debugger for debugging
    MySQL WorkBench can help with showing database performance

    And there are many others...

    For plug-ins make sure you use WP's standards.
    Always make a hook for JavaScripts and CSS in your plug-ins so others can disable them and add them the way they want without editing your plug-in.
    This makes it possible to compile these items to lower requests.

    Check the queries, how many database connections.
    HTTP requests, limit them as much as possible.

    Originally Posted by jminkler View Post

    The images themselves are not using resources. Its FINDING the images to use, which post, which thumbnail, etc...
    Everything on your server/site uses resources...
    Every image causes a request, what do you think delivers that request?
    The server.... Apache httpd.

    It all causes load on the server.
    {{ DiscussionBoard.errors[3412329].message }}

Trending Topics