What PHP memory_limit (php.ini) do you suggest for a VPS with 256M RAM ?
I'm using Ubuntu 10 + Apache2 + Php5 thanks
There's no generic "recommended" setting, as it's completely dependent on what you're doing with your PHP code. I'd recommend starting with it set to 64M and then if you have problems with it bumping up against that limit, then slowly raise it. Keep in mind that you'll need to restart apache after changing this value before it will take effect.
With only 256MB ram you should consider starting with 16MB and increasing as necessary.
If you have a leaking application you would have only four requests to that application before the RAM is wasted. Keep in mind that, whatever you are trying, 256MB RAM is not very much.
Though if your application isn't leaky than you should put your eye on the apache configuration because every apache child potentially uses PHP.
To keep the amount of RAM which is being used as stable as possible you might want PHP to be run as fastcgi. If you want to get all out of available memory go this way:
Measure the amount of RAM needed for your application and how much hits you get. Configure Apache to spawn the absolute minimum of children necessary to serve the clients. And spawn just as many fastcgi processes to serve the apache children.
This is all about concurrency.
If it's OK for you to have only a single PHP request going on, then it may consume something between 64-128 MB at will.
If your site has lots of visitors, then your server needs to have more simultaneous PHP processes and the memory usage grows. Sure, some of that memory might be shared among the processes, but with scripts like fetching a huge dataset from a database will need that privately. That will grow your memory needs like there's tomorrow.