tags:

views:

231

answers:

4
  1. What is your average php memory usage per request . I know lots of people will say that php memory usage depends on the application , but i just want to get general idea about your data.I just created simple php framework so i want to know that do i use needless memory or it is normal .

  2. Actually , the interesting point is about my database class. I have a database class which is part of framework. For example , i have an albums table in database and albums have child objects which are songs . When i select albums from database , my database class automatically find child objects and get the data about them form database. So when this process occur , database class consumes around 1mb memory . If it is too much or you have an different method for this process please share .

+1  A: 

You can run a profiler and find out. This article has links to a few of them, and it will tell you the memory used per function.

Jeremy Morgan
A: 

It is very difficult to talk about averages here. One example comes to mind, though: A basic Wordpress 2.8 installation I had to install on a 12MB memory_limit package just about ran, but it would scratch the limit and crash in more complex tasks like the rights management plugin. Any advanced plugins wouldn't work at all. Upgrading to 32MB helped.

Pekka
A: 

If you're running an app under php-cgi, you're probably going to look at only 1-2 megabytes (max) per instance (an instance being a single hit).

If you're running the app as an Apache module, you're probably going to see numbers like 7-15 megs per Apache instance.

For the record, these numbers are based on actual figures from my site's servers over the last two months, so I'm not pulling chains here. Hope this helps!

mattbasta
A: 

Mine is run as cgi (FastCGI) and is using up to 75mb per php process... is that way too much? :/

JJJ