Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

We've been having a problem with a commercially-hosted Drupal website maxing out server memory.

I talked to our Drupal/PHP guy and he went through his rule of thumb, which is, every page loaded by a relatively complex Drupal site will take at least 10MB and maybe as much as 25MB.

I don't normally consider this kind of calculation -- it's only because $work doesn't do Drupal and we had to host outside that it even came up.

Does that seem right to Monks? It sounds like an enormous amount of memory to me to load a page which is less than 100Kb when it gets to the browser.

What does a site like Perlmonks use, per page impression, as a comparison? Is PHP particularly memory-hungry? Is MySQL to blame? Or is that amount of RAM per page quite normal? Or is his rule of thumb wrong?

Why am I asking here? Because Monks are smart, and because I know our PHP/Drupal guy won't see the question if I ask it here...

  • Comment on OT: How much memory does a database-backed website use?

Replies are listed 'Best First'.
Re: OT: How much memory does a database-backed website use?
by dHarry (Abbot) on Dec 15, 2009 at 10:14 UTC

    Beside the fact that it has "not much" to do with Perl, your question is also too general (versions of PHP, Drupal and mySQL? what hardware? were certain patches applied? what is "relatively complex"? etc. etc.). The memory consumption depends on how the application is coded and how it is used. In my limited experience with PHP and mySQL they are not memory hungry at all. My experience with Drupal is less positive and I don't use it anymore. See measuring-memory-consumption-by-drupal-bootstrap-and-modules for ideas. I think you should post your question in a PHP/Drupal/mySQL forum, they can help you better.

    Cheers

    Harry

Re: OT: How much memory does a database-backed website use?
by Anonymous Monk on Dec 15, 2009 at 05:36 UTC

    it might be because of any reason you mentioned, I cannot really tell because I haven't used drupal before

    but as for the memory, 10MBytes per load isn't too much I guess I've seen some other well known PHP scripts "vBulletin" using up to 64Mbytes on its own (I guess it depends on what stuffs are installed into it).

    You shouldn't be having problems unless your system has something like 128MB of memory and those drupal process that consumes 10M are never shutdown (stuck process).

    You can monitor the memory consumption by process using the "top" command ... pressing "SHIFT + m" will list those process by memory usage ... keep monitoring it to see if it's really about 10M per page or 100M as this zero would really make a difference.