Support » Fixing WordPress » 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?

Viewing 15 replies - 16 through 30 (of 43 total)
  • Actually… there will be a bunch of streamlining in the upcoming version. There was mention, a couple months ago, in one of the dev blogs about it.

    Darned if I can find it now… but hey, there’s hope!

    All I’ll say is, take an average sized WP weblog, pop in print_r($_GLOBALS), copy and paste the array it prints into a text file and weight it. Also marvel at the headscratching amount of stuff in there. If I undertsand correctly, WP shoots this missile into PHP’s brain on *every page load*.

    Also ask yourself why the template tag that creates a list of authors and a count of their entries hits the database an exponentially growing number of times with every additional author. (I was up to like a bazillion SQL queries for that so I had to write my own which does the trick in one… and I run that on a CRON and include the output. Waste not want not.)




    I really hope there is streamlining on queries very very soon. I am willing to pay money to WP developers to have something done, really.

    This seems like a silly conversation to me. I mean, it’s like asking why Windows XP won’t run on my old 486 PC.

    Get some decent hosting, people. Hosting is dirt cheap.

    Hi Viper007Bond,

    sorry, but your response is pretty callous.

    Many people don’t have 10+ USD per month for hosting. Even if you consider that “dirt cheap”, to them it isn’t.

    Blogging software, such as WP, especially OSS, often are used as a (political/societal/journalistic) expression tool for people else devoid of a means to do so. For many of these people paying 120+ bucks per year is a major expense.

    So maybe the shoe is on the other foot: a good, quality software had better get its act together regarding usability (sic!) and see to it, that it’s no ressources hog.

    I am on my own dedicated server, which costs me a packet and is no meagre affair (dual 3.0 GHZ xeon, 2 giga RAM ), I host quite a few WP blogs for customers and I too see serious, very recent problems and demands made by WP since version 2.0.0. The server can deal with it, but I most certainly am NOT happy with that either. Especially when I compare these installations with those I run of Nucleus or TP. It’s needless expenditure of ressources and this kind of thing is one of the points which broke a couple of other softwares’ necks.

    Why be second or thirdclass if it’s just a question of optimizing?

    Don’t forget that streamiling database queries isn’t just an application issue. There are a number of factors which contribute to the overall performance. Assuming your host uses the MySQL “query cache”, ask them these questions:

    1. How is the query cache configured: is it “always on” or “on demand”?
    2. How large is the cache: both the “individual query” and the “total queries” size for all queries?
    3. How many applications (apart from yours) is the MySQL server actually serving?

    If your host isn’t even using the MySQL query cache, don’t even bother whinging about WP performance issues. Goto another host provider who actually understands databases and not some shonky operator doing it on the cheap.

    Hi Pizdin_Dim,

    I don’t “get” your approach at all.

    Many, yes, MANY people here have noticed the recent problem WP creates in this department. It’s highly unlikely that they all are on the same server. Nor is it likely that all are on cheap hosts. I noticed it and I pay nearly 500 bucks for my own, and run WP for customers also, on hosts ranging from 20 bucks/year up to 50 bucks/month accounts.

    The ressources/performance problem can be noticed on ALL of them since the latest major update (2.0). Some have trouble due that change, others can (still) stomach it.

    But it’s totally beside the point to blame servers, db setups, or the money available to users. It’s a problem WP has/creates.

    As was said by many here, and as I can see daily in my stats, there are excellent blog softwares, competitors of WP, and even fullblown CMS which don’t create such a problem. I go one step further, if such a problem were to surface in one of their usergroups and came to the awareness of the devs, people would – instead of a continueing attempt to excuse the software – snap to to remedy it.

    So what is your goal in this debate? Make WP some sort of elitist thing which can only be used by people on a hot server paying a load of money? Because that’s exactly how you sound.

    “even fullblown CMS which don’t create such a problem”

    Not true at all. Have a look at some specific examples I posted above.

    “totally beside the point to blame servers, db setups, or the money available to users”

    I wasn’t attributing any “blame”, at least that’s not how I read it. I’m merely stating what should be the obvious to the more experienced members of this forum: a database application needs to have the database configured correctly for query optimisation. Most major databases have the ability to cache queries, including MySQL. Yet, my experience has been that the majority of host providers either don’t enable it or don’t configure it correctly. Why? Usually, ’cause they don’t know how, so they just accept the defaults, which is to be expected from the “cheapie” hosts. After all, the universal law states that you almost always get what you pay for. And some say, what you therefore deserve.

    “So what is your goal in this debate? Make WP some sort of elitist thing which can only be used by people on a hot server paying a load of money? Because that’s exactly how you sound.”

    See my post about the really important questions about the database cache to ask your host, from above. That spells it out nicely.

    As for not “getting” my approach: I have to admit that I don’t “get” yours either. You seem to be pointing the finger at only the application yet you simultaneously seem to be aware of the importance of the underlying infrastructure which supports it.



    Again, I think my posts on other threads speak for themselves. But I will, again, notify you of my problem:

    I have a WP site with about 4000-5000 pageviews a day. Quite low. The site used to sit on a VPS that cost US$15/month. Then my host complained and shut me down, so I moved the site to my own dedicated server. I am seeing big problems, still, on my own dedicated server.

    I just moved the site from movabletype to WP a few months ago. The site on MT had the same amount of daily visitors for the 2 years it ran on the VPS and on MT, but I never had a problem.

    I currently host a number of semi-popular blogs on VPSs. One blog does NOT use WP and has about 20,000 page views a day and doesn’t cause any problem. However, on the exact same server at my host, I have 2 other VPS that ARE running WP and both of them, even with only 2000-3000 page views a day each, are causing major problems on the server.

    I 100% understand that the problem also lies with mysql/php/apache, however when I have a site running the perl package from Movabletype and another site with 20000 pageviews running PHP/mysql without a problem, I have to look at WP as the best thing to change in order to be better.

    Listen, Microsoft has for years placed the blame elsewhere as its public relations people pass the buck on their company’s software problems, but I hope that the community here can not worry about their “face” so much and work together to pinpoint some areas where we can make WP a better product.

    Also, I am running WP-cache on all my WP sites, but I still have major problems…

    “I am seeing big problems, still, on my own dedicated server.”

    Tell me, How is your cache configured?

    Without a question of a doubt, I can (from personal experience) assure you that after you have finished tweaking the database cache, you will see significant improvements. I have experienced this with Drupal, Xoops, Nucleus, TikiWiki and Mambo.

    Now that you have your dedicated server, take the time to read up on the MySQL cache and spend a few days analysing and tuning things yourself.

    BTW: Has anyone actually proven that WP2.0.x is slower than WP1.5.x? I don’t have any experience with WP2.0.x, nor have I looked at the code differences, but I doubt it would be significantly more database-intensive. Does anyone know if that’s true?

    Also: I thought that MT effectively works off “static” files, instead of database queries, so comparing the two on performance is irrelevant. At least until the MySQL database for WP is configured correctly.

    Hi Pizdin-Dim,

    why don’t you READ what WordPress China, I and others here write?

    We both run WP on own dedicated well-setup, well-configued and certainly WELL-ENDOWED servers. We both run also such software as Nucleus, TP, Joomla, SMF, etc. etc. (and yes, I absolutely, completely disagree with your statement regarding other software. I DID install the same on lesser accounts without a fraction of the trouble WP makes under these circumstances! Not once, I did so repeatedly and they run well and don’t hog ressources).

    And we notice – ON THE SAME ACCOUNT/SERVER – that WP has a memory/ressources usage problem.

    I will be more precise yet: this problem started with version 2.0.0. I have a testbed 1.5 installation running (STILL ON THE SAME SERVER) and it DOES NOT cause this problem.

    All of that is pretty conclusive.

    So – stop mumbling about DB-configuration and cheap hosting, we talk (in my case) of a 500,-/month server and we talk of the same server with various reactions to WP 1.5, WP 2.0 and Nucleus/TP and others. And the “bad boy” is indeed WP.

    Thus, instead of coming up with countless excuses, maybe you can suggest HOW WORDPRESS NEEDS TO BE CHANGED to stop hogging ressources?! Because otherwise all which you have been saying is quite simply: “f..k you, if you can’t put it on an expensive account.”

    If users need to host a simple blogging software or CMS on an account which could stomach a chatserver, so sorry, pizdin_dim, then you’ve got to adjust your specs on realities a bit, because this is pretty ridiculous.

    “why don’t you READ what WordPress China, I and others here write?”

    Yes, I have. Have you read what some others who oppose your point of view have written?

    “So – stop mumbling”

    Funny that you should use the term “mumbling” to describe what I had to say. Obviously you mean that I’m difficult to understand. If that’s the case, it’s a shame because I thought I made myself very clear. Perhaps it also tells us a little about you, no? So, let me rephrase it:


    Post the values right here, go on.

    pizdin_dim – I think you’re completely missing the point here! I have no doubt that optimising my database would make a difference, but that’s not the point. When I originally chose WP what attracted me to it was the fact that it ran smoothly and quickly, even on the £11/year hosting I was on at the time! (I’m now paying significantly more for much better hosting, but that’s beside the point)

    The majority of WP users do not want to be paying hundreds of pounds/dollars a year for hosting or spending days optimising their database – WP gained popularity because it was incredibly easy to install (The famous one step install!), lightweight, easy to manage and of course free! Having to buy expensive hosting or tune up databases really negates the whole point of it!

    Also, one of my original points was that WP was getting worse over time – it used to work fine but as the site grows it is noticably slowing down and consuming more memory.

    “I think you’re completely missing the point here.”

    That’s only true if your point of view is the only valid one, which it isn’t. Both arguments are valid, see below.

    “Also, one of my original points was
    that WP was getting worse over time – it used to work fine but as the site grows it is noticably slowing down and consuming more memory.”

    Exactly right. And it just proves that WP is like all software. As you add features, the codebase gets bigger. As the codebase gets bigger, the application requires more resources. Take any software application in history and you’ll find this to be the case. So, why should, and how could WP be any different?

    1. To expect WP to continue to work in only 8MB of memory throughout it’s evolution is foolish.

    2. To expect WP to continue to work as efficiently with 10,000 requests/day as it does with 1,000 requests/day, without adjusting the database settings to accomodate the increase in workload is foolish.

    We can continue to argue about “how it once was” but the practicality of software evolution is that things change. If you want them to remain the same, don’t upgrade. Nobody says you have to.

    As I’ve said a number of times: upping the memory limit to 32MB and spending some time on configuring a proper cached database environment will solve most of your complaints. You must realise that WP is a database-driven application, not static pages, like MT. I’d still very much like to see any one of you people who’ve been complaining about performance to tell me what your host has configuted the database cache. But it looks like nobody is prepared to post the numbers. Why? Is it because your cheap host can’t supply them?

    The way I see it you still have a couple of choices, even if the good folks behind the WP development can’t accomodate your complaints that WP2.0.x “needs fixing”: if WP1.5.x was so much better, just revert back. Otherwise, put a bit of pressure on your hosts to improve their infrastructure.

    Sorry pizdin_dim – please read what I write! “it used to work fine but as the site grows it is noticably slowing down and consuming more memory.” – I’m talking about the site growing, not the software! As explained in my original post, I have never upgraded WP from 1.5.2, it’s other people that have brought in issues regarding v2 etc… I know nothing about them.

    The version of WP I’m now having problems with on an expensive VPS is the same version I ran with no problems on £11/month shared hosting. My original question was not questioning how much memory it uses, but questioning how the memory usage had seemingly inexplicably gone up! The visitor numbers have crept up slightly over time but not significantly – it only gets about 1000 hits a day.

    To expect WP to continue to work in only 8MB of memory throughout it’s evolution is foolish.

    If the majority of WP users are using hosting with memory limit set to 8MB then WP coders have to cater for this. I’m a webdesigner by trade and whilst I prefer a high screen resolution on my computer I still have to cater for people that only have 800×600 monitors – I can’t just rule them out because they won’t or can’t upgrade! It’s the same in this case, you have to compromise some things in order to reach the mass market.

Viewing 15 replies - 16 through 30 (of 43 total)
  • The topic ‘WordPress memory usage problem’ is closed to new replies.