WordPress memory usage problem
Recently some WP pages have been exceeding the 8MB memory limit of my PHP install (especially wp-admin/post.php after a page update). I know it is possible to increase the memory limit in the php.ini (e.g. memory_limit = 16M) but I don’t want to do this as it seems obsurd that WP should be using more than 8MB! The blog has been going successfully for nearly a year, I haven’t recently installed any extra plugins… Is it something to do with the DB size? Is it going to get gradually worse over time?
I’m running WP 1.5.2, but it’s for a client who had only just got used to 1.5.2 when v2 came out so I am yet to switch him over. I’m running various plugins such as phpexec, SpamKarma 2, TinyMCE WP, CG-Amazon, BDP-Referal tracker, wp-cache, WP-Cron and WP DB backup – but like I said none of these have been installed recently and they’ve all worked fine until now!
Any idea what could be going wrong?
I’ve always had problems running <8MB. Never sure why, what the real memory overhead of PHP itself is in a given process, etc.
There are numerous queries that could use up memory, including the base page query, anything BDP-Referral might be doing, SpamKarma might be doing, CG-Amazon if you’ve got a big list that you are randomizing from, etc.
But, I think that WP overall needs some serious performance and memory-use profiling, ASAP. I don’t know if the core devs understand where bottlenecks (cpu) and usage (ram) really are — and I can promise you that the next tier of devs (plugin coders, theme coders, etc.) likely don’t. I admit I don’t! 😉
I should note that you usually are told where you are running out of memory. That’s useful information — it’ll tell you the allocation that failed, for instance…
Yes, please mister and missus developers: please find a way to have WP not eat so much server. 🙂
I have this problem too on small WP sites that don’t have lots of ppl visiting…
“I’ve always had problems running <8MB.”
I think most people are in that camp, whether they use WP or not. From my experience, I haven’t encountered any non-trivial application which ran comfortably in only 8mb.
Memory is cheap.
…Memory is cheap…
I beg to differ.
The vast, absolute majority of users of software like WP will not run their own or co-located servers. They will have to contend with what their shared/virtual hosts allot them, and with 100 or 200 account users on a server, memory isn’t cheap anymore, it’s a finite commodity and your host is going to suggest a dedicated server to you, if you exceed that allotment.
I agree that WP does have to do an overhaul of its memory and ressources management. Though I haven’t had host problems with my WP installations, I noticed instead that from one major version to the next WP has become slower and clunkier.
And no, it’s not normal for a CMS to need 16 MB instead of 8. I’ve installed and worked with most there are, and it’s the ‘nukes which have that problem. Crystalclear why, there. NOT a good calling card.
“And no, it’s not normal for a CMS to need 16 MB instead of 8.”
We agree to disagree then. In my 6 years of web development, I have never seen any useful large application which actually ran without any problems in only 8mb. And you’d have to agree, WP is pretty large.
Yes, I agree that there are “cheapie” hosts out there who stick a hundreds of accounts on their servers and then point the finger at whatever applications are using “too much” in memory. As per usual, you get what you pay for, though.
It is not reasonable to expect something like WP to run smoothly in only 8mb. Lots of functionalty requires lots of code. Lots of code needs lots of RAM. If your host provider is only prepared to allocate 8mb then consider someone else.
I still disagree. I installed and had running smoothly such CMS as Typo3, Mambo/Joomla, redaxo, Spip, Drupal or phpWebsite under 8MB, and each and every of those is a tad larger and functionwise much more sophisticated than WP. Especially Typo3 is as convoluted and empowered as you can get with OSS CMS and absolutely beyond any comparison with WP, still it behaved well in a restricted surrounding.
The only ones I ran into trouble with were of the closer ‘nukes family and such far removed but really taxing systems as XOOPS or Xaraya.
I install also many Nucleus and Textpattern blogs and with those I never encountered any trouble either. Both are also way faster than WP by the way.
While I agree with you that a larger memory allotment is beneficial, I also say that a blog software like WP should be able to work with less. And no, WP in my book is not a portal or wikitype CMS, even if you can get it to act like one with lots of tweaking.
To me there is no real benefit in refusing to accept that some performance tuning is sorely needed, else WP will go the same route as quite a couple of the clunkier CMS went. And that’s not really advisable.
I’ve had a problem recently where wordpress locks up my computer when I use IE and attempt to update posts/pages. My CPU usage goes up to 100% and IE freezes.
Oddly enough firefox seems to get around whatever is causing the issue and I can update my site. Thank god IE is not the only option… still though, it’s odd because I only use IE and this only became a problem recently as I started putting more info on my site.
“I still disagree.”
Yes, I know.
“a blog software like WP should be able to work with less”
Why? In practical terms, is this true at all? Where are the tangible benefits if it were to do that?
“there is no real benefit in refusing to accept that some performance tuning is sorely needed”
All applications need performance tuning. It just depends on how much time you have and how perfect you want to make the system. WP is a very usable, flexible and powerful system. Clearly one of the best out there. It seems to me that only a very small percentage of users are complaining about it’s performance. Now that doesn’t mean that the WP developers should ignore that small percentage but it does mean that the WP developers have got it right and for that they should be applauded.
BTW: I’m not on the WP development team but I’m an experienced software developer, so I’m purely relating to the necessary practicalities with any application system.
I’m an experienced software dev as well, but I’m not so hasty to draw conclusions… 😉
I don’t know why other systems CAN run under the 8MB bar. They’re more streamlined? Less ‘dynamic’? Caching to HTML? Only loading minimalist code on the front-end? Dunno.
I don’t know WHAT sits in a PHP-execution footprint. What does ‘php’ itself take of that 8MB? What’s the BASE overhead? What’s the overhead of the opcode compiler, and then the opcode data itself, as well as stack and runtime stuff? What’s the overhead of opening up a MySQL connection? What’s the overhead of retrieving a query? What’s the overhead of output buffering? And so on…
I’m sure an advanced web developer, who does this for a living, in PHP, for a number of years, probably has some answers… But not all. For instance, if a shared server is running an opcode cache/accelerator, that’d make a potentially huge difference in memory and speed. So different servers could easily hit different limits based on modules, settings, etc…
Hi again, pizdin_dim,
…Why? In practical terms, is this true at all? Where are the tangible benefits if it were to do that?…
Quite baldly put:
OS software is (nowadays) mainly used by people not able to fork out the dough for commercial software like Movable Type for instance. Someone who can’t or won’t pay 200 bucks for a commercial software also is highly unlikely to pay huge amounts for hosting.
That’s the core customer group of OSS like WordPress. Yes, I know all about the original background of Opensource. Yes, I also know quite many “because of the philosophy”-users of Opensource. Yes, I also know many coders who prefer using Opensource because of the access to the code.
BUT: the core customer group is the one I mentioned above.
If you have such a pronounced specific usergroup you had better heed its needs. It’s truly that simple. And if you are an experienced software developer, you should have this adage written in fiery letters somewhere atop your workspace.
We wouldn’t be getting such support posts here (and more and more often lately, by the way), if this weren’t the case. And no, I am not under the impression that only a few are complaining or having problems. If you read the forums closely, there are many performance and ressources related tickets here. Decidedly more e.g. than with Nucleus and TP (whose forums I also follow).
It’s also not as if that problem wasn’t known among webmasters, as one such I have read many complaints over the past year (especially since WP2.0 surfaced) about these issues. They tend to stick to one’s mind. WP still hasn’t come back to first choice and it won’t if “clunkiness” and “ressources-eating” attach themselves to its name more and more.
I like WP and I have defended it quite a couple of times and suggested it even more often, inspite of that “Google-thang” and the constant niggling between WP and TP, both of which really caused lots of people to backpaddle. If non-usability for the core usergroup is added to that…
And it’s not necessary. A twist of mindset is all that’s needed. To know one isn’t as superior as one assumes, or in other words, a bit of humility in that respect, won’t do any harm, que no? The moment one accepts the above facts and sets forth to deal with them, that’s the moment you really better things.
“but I’m not so hasty to draw conclusions”
“I don’t know why other systems CAN run under the 8MB bar. They’re more streamlined? Less ‘dynamic’? Caching to HTML? Only loading minimalist code on the front-end? Dunno.”
I think you’ve answered your own questions there, intentionally or otherwise. The answers are obviously yes, yes, yes and yes. Then again, there are a number of other applications which need 16mb or more. It just depends.
Personally, I don’t see what the concern is with having to run comfortably in only 8mb. I’m sure the WP developers have a number of more important things to do. Perhaps this is an opportunity for those folks out there who are concerned about the WP memory requirements to assist?
Maybe V3 would be the ultimate version then?
Wow, didn’t expect that many replies by the morning! Just to add my 2p: I think that streamlining WP should actually be one of the developers priorities as a lot of people run it on shared hosting that will have the default 8MB memory allocation and they expect it to work on that!
As I mentioned in my initial post, I have run WP successfully for nearly a year now on the 8MB setup (and previously for some time on some £11/year shared hosting!), it is only now I’m getting problems – the main one being the wp-admin/post.php page not reloading after making a change to a page. Reading these forums I found plenty of people reporting this problem, but no answers – it was only when checking my error-logs that I realised what was happening! This is the kind of problem that would make your average user just give up on it, if WP wants to continue to succeed as an open source, but easy to manage blogging package then it is imperitive that it sorts out these memory issues.
Finally, my main question was not “Why doesn’t WP work properly on 8MB?” but “Why doesn’t it work properly anymore?!” Is it something to do with DB scaling problems?
Anyway, glad to have instigated this debate – it’s time to put some pressure on!
Well, I think my problems with memory usage and WP are well-documented on this forum.
I was using PHP-Nuke for 4 years for a website and never had any problems. One month ago I switched the site to WP, and while staying on the identical server, VPS, etc., I immediately had problems with my host. Ever since January, when i started using WP (changed all my sites form Movabletype), EVERY site that used to run fine on Movabletype, Nuke, or mambo have now large server usage problems. None of these sites have really anymore people than before and the pages are about the same size–the only difference in the CMS.
I really really like WP. It is like creamy butter compared to the rusty engine of Movabletype. WP just flows so smoothly and the add-ons are fantastic, the support forum is awesome, and if I could hug each one of you, I would. But something must be done asap to help WP maintain its greatness…
Google +php +memorty_limit and you’ll get over 400,000 results, so this “problem” is widespread. In fact, these applications have all had trouble running in only 8Mb or memory, at some time, for some folks. Read for yourselves:
If you make the effort to read what folks are saying in the above links I posted, you’ll soon realise this is not a WP issue at all. This is in fact an Apache/PHP/MySQL issue. But most of all this is a “host providers running dirt-cheap hosting plans and then whingeing that your application is using too much of their measly resources” issue.
Your experience may be different, but mine shows that 32Mb is the norm and in fact any host provider who still insists in 2006 on 8Mb is “running on the cheap”, doesn’t understand modern web applications and should be avoided. Sadly, there are a number of these around but just shop around until you find someone who is better equipped.
- The topic ‘WordPress memory usage problem’ is closed to new replies.