Page 1 of 1

memory leak?

Posted: Tue Dec 12, 2006 7:34 pm
by bdconnolly
Got this from my hosting company:
It's undeniablable that RAM usage on the server is very high. However, I'm thinking it may be a memory leak in one of your PHP codes. I restarted HTTP roughly 20 minutes ago, and the load went from 100+ to 2 and has remained there. By killing all the processes all the RAM would've been relesased, and if it was a load issue it should've resumed as soon as HTTP was back up. Are any of these sites very heavy on MySQL/PHP?
Thoughts?

Garvin?

Posted: Tue Dec 12, 2006 8:45 pm
by jhermanns
i once had a similar problem with supersized.org, but not anymore. i don't think it was s9y itself but some other point of failure. which version of php do you use, do you run it as fastcgi or as a module (of apache)? what's your server's hardware and how many requests/s does it get?

Posted: Tue Dec 12, 2006 10:00 pm
by garvinhicking
Hi!

It's impossible that a PHP script can be the culprit for that.

PHP scripts cannot have memory leaks. Only the PHP core can. But usually, total RAM usage is more a problem of a bad webserver configuration. One should propery configure the amount of MySQL threads/workers as well as Apache workers, then this effect of RAM-outage cannot happen.

Sadly this is completely unrelated to Serendipity, but a general problem with Webserver setup/skills, and the principles of PHP. It mightalso simply be that the webserver is too weak for the amount of traffic you get. You can't expect a carriage with 4 horses to be as fast as a Ferrari ;)

Best regards,
Garvin

Posted: Tue Dec 12, 2006 11:00 pm
by bdconnolly
Well, it can't be traffic either. We are only doing about 1,200 unique visitors a day. And as you're aware Garvin, we moved all the RSS stuff over to FeeBurner.

:(

Posted: Tue Dec 12, 2006 11:05 pm
by bdconnolly
For the record... another symptom is swap creep. Whatever is causing the problem slowly increases the use of the swap file until I have to reboot Apache.

Posted: Tue Dec 12, 2006 11:14 pm
by garvinhicking
Hi!

Okay, then this is definitely related to problematic webserver setup.

PHP works sandboxed; if there are memory leaks, they are caused by webserver/PHP, not PHP applications. Check with your provider and work on the mysql/apache child/thread memory allocation. Also check for recent PHP versions and possible bytecode caches you'Re using.

I suggest you to go to a general webhosting forum to discuss possibilities to improve the situation, since maybe here there are less people skilled/specified in this area...

Best regards and I hope you find solution attempts,
Garvin

Posted: Tue Dec 12, 2006 11:20 pm
by bdconnolly
thanks Garvin.

I am going to go wrestle with my hosting company. I will report back with the findings.

best,

BC