Jump to content

php memory_limit


thedarkwinter

Recommended Posts

Hi guys

 

Just getting your opinions on changing the memory_limit in php.ini

 

I have a site that normally has about 10 concurrent users at any time, doing minimal hardware-stress work.

 

I need to add one script thats a major database export to csv, it only takes a few seconds to run but it crashes out at about 150MB of memory.

 

Is it a bad idea to set the limit to 256MB ?? Are there any major drawbacks. Seems fine on my test server.

 

Cheers,

tdw

Link to comment
https://forums.phpfreaks.com/topic/65205-php-memory_limit/
Share on other sites

The most i've seem sovar on a php/mysql server with apache is 32MB(that server has about 4GB MEM).

 

Remember the server still has to have resources to do the other processes.

 

On you're testing server 256MB might not do anything.

but try it with about two thousand connections.

Link to comment
https://forums.phpfreaks.com/topic/65205-php-memory_limit/#findComment-325587
Share on other sites

hehe, tibberous, that sounds like a dare :)

 

NArc0t1c, thats my concern... but will it just slow down everyone else, or could it actually crash apache or something?

Bearing in mind that its been running on 8MB, none of the other scripts are intensive.

Link to comment
https://forums.phpfreaks.com/topic/65205-php-memory_limit/#findComment-325590
Share on other sites

Well, If the memory limit is as high as 256MB, then php won't do anything, so apache will crash and you're server may do that as well.

I have set my limit up to 32MB once, to run a simple curl script that would post data to a page, then suddenly my apache crashed.

 

So if my memory limit there was 256MB, because I have a powerful processor it probably would not have crashed but would have lagged like hell.

Link to comment
https://forums.phpfreaks.com/topic/65205-php-memory_limit/#findComment-325680
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.