Wordpress and Server RAM: Your (many) Plugin Uses (much) Memory
Wordpress is one of the most popular piece of software, especially as (free) blogging software. And it’s getting more robust and better each release. The problem is, Wordpress is notorious for using a lot of memory that used up the server’s RAM (Random Access Memory). One thing that people tend to fail to distinguish is that some or a big chunk of memory are being used for plugins. Some are hunger for memory some are pretty savvy, so you need to know which category is the plugin that you use in!
Some Popular Plugins and The Memory Being Used
To give you some illustrations, let see some of the popular plugins that I use: (I will describe the easy way to measure by yourself the use of memory of any plugin at the end of this article – it’s easy)
| Plugin | Version | Guideline Of Additional RAM needed | |
| Admin Notes | 0.2 | 0.02 | MB |
| Akismet | 2.2.7 | 0.43 | MB |
| All in One SEO Pack | 1.6.10 | 1.00 | MB |
| AskApache Google 404 | 4.7.2.2 | 0.42 | MB |
| Broken Link Checker | 0.7.4 | 1.46 | MB |
| Chap Secure Login | 1.5.1 | 0.03 | MB |
| Dagon Design Sitemap Generator | 3.15 | 0.33 | MB |
| DB Cache Reloaded | 2.0.2 | 0.32 | MB |
| Fix-RSS-feed | 1.0.3 | 0.07 | MB |
| Google XML Sitemaps | 3.2.2 | 0.09 | MB |
| HeadSpace2 | 3.6.32 | 1.17 | MB |
| HyperCache | 2.6.4 | 0.19 | MB |
| Login LockDown | 1.5 | 0.12 | MB |
| Maintenance Mode | 4.3 | 0.28 | MB |
| MaxBlogPress Ping Optimizer | 2.2.5 | 0.40 | MB |
| NoFollow For Posts | 1.0.3 | 0.01 | MB |
| Nofollow Links | 1.0.3 | 0.04 | MB |
| Secure and Accessible PHP Contact Form | 2.0WP | 0.42 | MB |
| SexyBookmarks | 2.6.1.3 | 0.59 | MB |
| Sociable | 3.5.2 | 0.41 | MB |
| Top 10 | 2.6.1.3 | 0.24 | MB |
| Twitter Tools + bit.ly+hashtag | 2.0 | 0.85 | MB |
| Wordnote | 1.1 | 0.02 | MB |
| WordPress Hashcash | 4.3 | 0.19 | MB |
| WordPress Related Posts | 1.1.1 | 0.17 | MB |
| WP Security Scan | 2.7.1.2 | 3.95 | MB |
| WP Super Cache | 0.9.8 | 1.52 | MB |
| WP Widget Cache | 0.25.2 | 0.27 | MB |
| WP-Optimize | 0.7.1 | 0.01 | MB |
| WP-SpamFree Anti-Spam | 2.1.0.9 | 1.95 | MB |
All the plugin mention above were installed, activated and setup properly in working order inside Wordpress. And this table got the data when just displaying Plugin page (wp-admin/plugins.php) on a brand new blog (so no traffic from visitor). So more or less, it was measured on “idle” condition, meaning where the plugin is not really in the middle of its action (of course it depends on the purpose of the plugin). It is the condition just by being active in Wordpress.
Just by looking at above table at a glance, you can tell there are some differences in memory usage, some use more than the other.
I myself use around 25 kind of plugins at one time that deemed necessary for the blog to function properly (not to make it prettier, but the real functionality that needed). For example: sitemap for SEO purposes is a crucial factor (then Google XML Sitemap is installed), tracking popularity of each post is important statistic(hence Top 10 plugin is a must), and caching the blog is super duper important (then HyperCache, WP Widget Cache and DB Cache Reloaded are installed always), etc.
Total additional memory for all the plugins that I use will be around 6 – 7 MB.
Your Server Has Limited Memory
There are 2 memory limit that you need to worry about when using Wordpress:
- PHP Memory Limit: set by your hosting provider unless you have access to make your own “php.ini” file.. Sometimes even they allow you to do custom “php.ini” they will not allow you to override this parameter. Some other allow you to change this parameter via .htaccess. Check with your host to be sure.
- Wordpress Memory Limit: set in wp-settings.php but you can easily define it in side your wp-config.php by using below command:
define(‘WP_MEMORY_LIMIT’, ‘128M’);
That ‘128M’ can be change to ‘40M’ or ‘32M’ or whatever value you want.
From those twos, the one really matter is the PHP Memory Limit because the web-hosting provider will “plan” for the resources of their server.
See, when you are just starting up your blog, I suggest you use managed shared server first (see this article for more detail). This means, one server is used by many user, and each user nowadays can host virtually unlimited number of website. All this website will need some memory to run and the problem is, the server can only have limited memory installed.
For example, some latest motherboard can have 6-slots of DDR3 RAM module that each worth 2GB. Meaning total physical memory that can be installed is 6 x 2GB = 12GB. Say the server overhead (for operating system, networking, etc) need 512MB, so the rest of the memory will be 11.5GB. Say there are only total 100 websites running on the server (this number is very low – but just to give you illustration) – this means if we just divided the memory pro rata for every website, then the allocation of memory will be 11500 MB / 100 = 115MB per website. So, if your Wordpress blog require 32MB, then your ‘memory quota’ will can hardly serve 4 visitor at once.
Luckily most of the website probably will have less than 10 visitor a day, so as they come at different time, even if there are more than 100 websites, the server still can have some more extra visitors.
But my point is here, it is in your interest to make the memory usage as low as possible. Because with the same ‘memory quota’ you can serve more visitor. Say you reduce the number of plugin so the usage of your Wordpress plus plugin will be around 16MB (from 32MB). Now you can serve 8 visitors at once whole day every day without your hosting provider screaming at you. (For example, if each visitor spend 2 minutes, then you can serve 30 visitor an hour or 720 a day or 21,600 a month – it should start producing you good money with that number !)
This means, you can still stay at cheap shared hosting package until you have enough customer to upgrade to VPS (Virtual Private Server) or Dedicated Server for some even more serious money !
Remember firmly, the web-hosting company will (and they do that every day) suspend your account if you are using the resources too much too many time. Beside memory / RAM the other important resources is CPU load. But we talk about this on different time.
Sort Your Plugin
Therefore, now that you know plugins use memory, and you need to use as less memory as necessary, I suggest to start categorizing your plugin into 3 categories:
- Plugins that need to run all the time: this is all the plugin that is a must. Like I mention above: the caches plugin, statistic plugin, anti-spam plugin, contact-form plugin, etc.
- Plugins that only be activated when needed: this is the plugin that there is no advantage to have it run all the time. For example: Maintenance Mode (just activate it when you are doing the maintenance, after that deactivate it again), Broken Link Checker (just do the check manually every month or so, no need to check this all the time, right?), Fix-rss-feed (probably just need it one off),etc.
Actually, all admin related plugin can be categorized on this category, for example TinyMCE Advanced that add 15 more functionality for TinyMCE editor. This probably just needed when you making apost on the admin area, the rest of the time it can be turn off (deactivated) - Plugins that can be integrated into your themes directly. Some plugins (for example Adsense’s plugin) only put Adsense’s script from Google on your sidebar. then probably it is better just modify your sidebar.php and put the code directly there. Although the resources to perform the functionality will be the same (whether as a plugin or directly put into the theme file), but it relieves some overheads of the plugin, (for example to register the hook function, checking existence of a function, etc)
How to Measure Your Plugin Memory Usage By Yourself Easily !
![RAM usage on the footer [WP-Footer display]](http://imbm.b4g.info/memoryused.jpg)
Memory usage on the footer
- Go to its setting (Memory Usage (LHS menu) => Settings) and set Show memory usage in admin footer to “Yes”
- Activate the plugin that you one to measure (one plugin at a time) and set all the parameter/setting properly. (Some plugins will not install itself properly without being correctly setup, hence will give wrong reading to you – so, just make sure it is setup properly)
- Once up and running, go to Plugin Page (wp-admin/plugins.php) and record the footer as pictured on the right. You can do this several time to get multiple reading. But usually it is pretty consistent.
- Now, deactivate that particular plugin
- Go to Plugin Page again, and record the footer as before.
- The difference between step (6) and step (3) are the memory usage of the plugin just for being activated in Wordpress
Not difficult, right ?
Final words
Now that you can measure the use of memory of any plugin by yourself, it’s time to be selective. There are many plugins made and developed out there. Some by more experienced PHP developer, some got less experience.Some really manage the memory they use, some put more focus on the functionality. But more than 1 plugins can give you the same/similar function, you then need to judge the plugin from different aspect now. The memory usage. For example: All in One SEO plugin and HeadSpace2 are doing pretty much the same thing, but HeadSpace2 is using 117kB more memory than All in One – now you can choose which one…. (Other example: Sexy Bookmarking vs Sociable, HyperCache vs WP-Super Cache, etc)
Of course, the best alternative is: if you don’t really need the plugin, don’t install it just for the sake of installing it.
OK, start sorting those, plugin, okay ? And get ready for more visitor (and then profit) without jack up your hosting cost !
Comments
2 Comments on Wordpress and Server RAM: Your (many) Plugin Uses (much) Memory
-
TPC! Memory Usage Honorable Mentions « webjawns.com on
Mon, 22nd Feb 2010 10:43
-
Mike on
Sun, 7th Mar 2010 19:32
[...] WordPress and Server RAM: Your (many) Plugin Uses (much) Memory – TPC! Memory Usage driven benchmark of memory used by popular WordPress plugins [...]
I need this, thank you for explaining the importance of memory usage.
Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!













