Title: PHP memory usage &amp; speed problems
Last modified: May 23, 2018

---

# PHP memory usage & speed problems

 *  Resolved [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/)
 * Hi,
 * We’ve been trying to track down PHP memory problems on our site, so I started
   looking at our plugins.
 * According to Query Monitor normal page load on our site is 82 000KB and takes
   1,72s — if I turn Simple Blog Stats off it drops down to 41K and 0,72s. I noticed
   this as Query Monitor was reporting that the query sbs_word_count_all()
    wp-content/
   plugins/simple-blog-stats/simple-blog-stats.php:294 was very slow.
 * I was using SBS to display [sbs_posts], [sbs_approved], and [sbs_word_count_all]
   in the footer.
 * I’d love to keep using this plugin but at the moment it seems it’s putting a 
   lot of strain on the database.
 * Can you let me know if this is normal and intended usage or a bug? I’m using 
   the 20180508 version of the plugin.
 * Many thanks,
    Adam
    -  This topic was modified 8 years ago by [AdamDobay](https://wordpress.org/support/users/adamdobay/).

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10314153)
 * Hi Adam,
 * Glad to help. This definitely sounds like a bug. I will investigate and try to
   resolve in the next plugin update. Thank you very much for reporting the issue.
 * Regards,
    Jeff
 *  Thread Starter [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10314473)
 * Hi Jeff,
 * If it helps, I tried individually shutting off [sbs_posts], [sbs_approved], and[
   sbs_word_count_all] to see if they contribute on their own to the problem, but
   it seems even if one is used, the memory usage shoots right up.
 * I’ve removed the plugin for now to keep our site from crashing, but please let
   me know if you’ve managed to fix it because I’d love to put it back.
 * Thanks,
    Adam
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10314476)
 * Hi Adam,
 * Thanks for the infos. Because this is the only report of excessive memory usage,
   can you let me know how much memory is available on your server, and also if 
   possible which version of PHP you are using. That info would really be useful,
   thank you.
 *  Thread Starter [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10314997)
 * Hi Jeff,
 * My host tells me my VPS package has 10GB of RAM and the version of PHP in place
   is 5.5. (That memory sure sounds a lot but we have anywhere from 60 to 100K visitors
   a month, so we need to keep usage low not to overload the server, especially 
   in peak times.)
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10315058)
 * Cool thanks. And from the description of the reported issue, it sounds like your
   site probably has a large number of posts and/or posts that contain a large number
   of words. Does that sound accurate?
 *  Thread Starter [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10315100)
 * Exactly. As of last count we had 3583 posts, 66725 comments and 2,275,825 words.
 * I’m wondering if there’s a simple way to have the plugin query this information
   once, cache it, and only update it once every day/week/month. That would solve
   the memory issue immediately.
 * What I really need as a function is to have an easy stat shortcode so we don’t
   have to update our post count each time there’s a new post — and the rest of 
   the stats basically just look neat. At the end of the day, none of these really
   need to be accurate by the second.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10315125)
 * Yeah that makes sense then. And I agree, some sort of caching would be required
   to avoid memory issues when so many posts/words are involved. I will see what
   I can do to implement caching via transients, maybe as an option. I think it 
   would be a good feature to add. Thanks again for taking the time for this, it
   really helps.
 *  Thread Starter [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10315130)
 * Thank you for taking the time to look at this issue and on such short notice!
   You might be surprised but this is the smoothest exchange I’ve had with a WP 
   plugin developer reporting a bug, so I’m very happy to help you with any input
   you need. 🙂
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10315151)
 * Lol I hear you, and thanks 🙂
 * Also please keep an eye on this thread, as I will update it when the plugin is
   ready for sites with lots of posts and content.
 * Cheers!
 *  Thread Starter [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [8 years ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10315157)
 * Brilliant, thanks mate.
 * And good luck with sorting this out!
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10607930)
 * Just to follow up with this. The plugin now uses transients (caching) to improve
   performance for shortcodes like `[sbs_posts]`, `[sbs_approved]`, `[sbs_word_count_all]`,
   and others. New version should be available later today or tomorrow!
 *  Thread Starter [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * (@adamdobay)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10609808)
 * Wow, cool! Looking forward to trying it. 🙂

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘PHP memory usage & speed problems’ is closed to new replies.

 * ![](https://ps.w.org/simple-blog-stats/assets/icon-256x256.png?rev=1473961)
 * [Simple Blog Stats](https://wordpress.org/plugins/simple-blog-stats/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-blog-stats/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-blog-stats/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-blog-stats/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-blog-stats/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-blog-stats/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [AdamDobay](https://wordpress.org/support/users/adamdobay/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/php-memory-usage-speed-problems/#post-10609808)
 * Status: resolved