Database sessions never close?

Database sessions never close?

by Matt S -
Number of replies: 2

I'm runnning Moodle 1.1.1 on a ISP-based shared-server running FreeBSD, PHP, and mysql. Everything works great, for the most part, but after I've been working on the site for a while I start to get "Can not connect to the database" error messages when I try to access the site. Then 30 mins to 1 hr later they go away and everything works fine again.

I thought that my ISP's database was just flaky, so I called them on it. They said their database is working fine, and that my scripts (ie Moodle scripts) open database sessions and don't close them. So anytime I log on (I think that's when it happens), the script creates a new database session and server process, but NEVER closes them. The ISP limits the number of open sessions to 100, at which point the database thinks it's under attack and stops working. The ISP admins get an alert, and they have to reset the sessions manually, thus the 30-60 min downtime while they work on resetting the sessions.

Has anyone else experienced this problem? Any help is greatly appreciated.

Average of ratings: -
In reply to Matt S

Re: Database sessions never close?

by Janne Mikkonen -

Edit your config.php line:

$CFG->dbpersist = true;          // Use persistent database connection?

to:

$CFG->dbpresist=false;

wink.gif

In reply to Janne Mikkonen

Re: Database sessions never close?

by Matt S -

Thanks! I'll try it now.