XOOPS Web Application System (https://xoops.org)

Powered by You!

A hack to avoid too many simutaneous opened connections

Category : XOOPS | Published by Alain on 12-Apr-2002 10:33
Xtremdj, Xoops France co-webmaster, suggests a little hack in your root footer.php file, to avoid too many simultaneous opened connections on the server...
When you don't close the connection, php let it run for a time out defined by mysql for 30 sec.
Imagine: if 10 visitors are surfing on the site at a great speed , one connection is opened per page, if they open 5 pages in 30 sec (not very much indeed) 50 connections are opened!!!!!
Some hosts jam at 30 simultaneous connections and then you get a beautiful "xxxx as already reached max connections ....."

On the other hand, if you close the db, at each page you close the connection: so only 10 simultaneous connections.
To get this result, get the code at
Xoops France Forums

Enjoy...