Memory usage much higher on production server than on local install

Events happening in the community are now at Drupal community events on www.drupal.org.
marcus178's picture

When using devel to view the memory use on a page, my production server is reporting a memory of anywhere between 70MB to 90MB, however the same site installed locally on MAMP the memory use is around 20MB which is much better. Both have apc installed, so is this difference due to the hardware or do I have a problem on my production server?

Comments

Memory footprint 70 to 90 Mb

valthebald's picture

Memory footprint 70 to 90 Mb is almost for sure is a sign of a problem. A tool like xhprof (http://techportal.ibuildings.com/2009/12/01/profiling-with-xhprof/, integrates well with devel module) can help you to find its probable source

Before you go down the route

dalin's picture

Before you go down the route of xhprof first make sure that APC is working well on the production server. Find the version of apc.php
http://svn.php.net/viewvc/pecl/apc/tags/RELEASE_3_0_19/apc.php?revision=...
applicable to the version that you are running on production and load up the script. Make sure that fragmentation is low and that the cache full count is close to zero.

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

Glad you said that as been

marcus178's picture

Glad you said that as been struggling to work out getting xhprof working

From what you have said it would seem I have an issue with apc
Fragmentation: 100.00% ( 9.3 MBytes out of 9.3 MBytes in 94 fragments)
Cache full count 1843

Ok increasing the apc memory

marcus178's picture

Ok increasing the apc memory sort of helped, but now over the course on an hour or so the fragmentation keeps going up til it hit 100% at which point the Cache full count increases by 1. Is this normal?

Here are my apc settings

; Enable apc extension module
extension = apc.so
; Options for the apc module
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=256M
apc.ttl=0
apc.user_ttl=7200
apc.num_files_hint=1024
apc.mmap_file_mask=/dev/zero
apc.enable_cli=1
apc.cache_by_default=1
apc.rfc1867 = 1

Cache is getting full with a

dalin's picture

Cache is getting full with a 256MB cache? How many sites are running on this machine? Is APC actually using all 256MB?

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

Just 2 Drupal sites and 1

marcus178's picture

Just 2 Drupal sites and 1 Wordpress. Guessing that's not good.

Ton of modules?

gchaix's picture

How many modules are you running? What modules are they? There may be something in there that is eating cache.

I run a 512MB cache on my system and it usually hovers around 384Mb used, but I'm also several hundred sites so my experience is likely atypical.

-Greg

About 70 modules

marcus178's picture

The site which I believe is this issue has about 70 modules, some of the main ones being Ubercart, Node gallery, Drupal for facebook. As I mentioned though in my original post, the memory use is about half on my local install to the production server, so have the feeling it's more a server problem, but I may be wrong.

Just had to increase APC's

marcus178's picture

Just had to increase APC's memory limit, seems to be ok now

Same problem different setup

muli's picture

I've got a similar problem here. On my local MAMP installation drupal uses 10 to 20MB.

On my production site it is about 30 to 64+ MB but I'm on shared hosting and 64MB is all I got :(

Is it possible to install xhprof on shared hosting just with ftp-access? Is there something else I can try besides the things devel offers?

If you're on shared hosting

dalin's picture

If you're on shared hosting then you'll need to contact your host to see if they will install a PHP op-code cache (highly unlikely). XHProf is just a tool that you can use to help find where memory/CPU time is being used. You typically install it on your development machine (not your production server).

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: