Jump to content

Memory usage?


jeremyapp

Recommended Posts

Hi,

 

I was wondering, if there is such a thing, what would be considered a "good" level of memory usage.  I have a social-network project that performs multiple queries per request, which in itself, isn't such a bad thing. 

 

However, I have noticed that the average memory usage is 3.85MB per request.  Is this considered high?  Caching output isn't an option, because each page needs to be dynamically loaded and changes are frequent.

 

I'm not sure what other information I should give to help someone answer, so if I'm missing anything, please let me know.  If anyone has a big project and would care to share the amount of memory they use, that would also be a big help. 

 

Thanks!

 

Link to comment
Share on other sites

I don't know if it will affect anyone yet.  I haven't opened the site to the public, so my question is whether or not this will become an issue as traffic builds.

 

So yes, it does matter, because if 3.85MB is a high amount of memory to be using, my site won't scale well.  My question is whether or not this is the case.

Link to comment
Share on other sites

You should think of it this way

 

 

1) Am I using so much bandwidth that when I meet my user goal my server will crash?

2) Am I sending so much data per transfer that users are discouraged by wait times or is it worth it?

 

 

If you are satisfied with those you aren't using too much memory

 

If you are on a shared hosting plan make sure you are within your limits set forth by the hosting company

Link to comment
Share on other sites

If it uses a little under 4mb per request, with 1000 users on at once would my site be using 4gb of memory, or does it not add up that way.  On a shared host, that much usage would surely pose a problem, which was the purpose of my question.

 

Edit: I fully understand that this does not affect the user.  My question is about server-side memory usage.  The pages being served are not unusually large.

Link to comment
Share on other sites

I think this is correct:

 

When you make a request that request starts to eat memory as the php is processed once something is echoed out or var_dumped or mysql_closed etc. it is freed from the resources and so when the requested is done the memory is freed.

 

 

So using output buffer will make it eat that memory for longer along with unclosed mysql connections (this is less of a problem because mysql auto closes usually)

 

 

 

You can't quantifiy it that simply you need to arbirtray look at the site and get user feedback and your system resource logs and then answer it.

Link to comment
Share on other sites

So besides data that persists throughout a session, most memory is being freed at the end of a request?  So it seems that it's more a question of memory being retained than the overall usage per request.  That still leaves some unknowns, but I think that pretty much answers it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.