Hi,
I want to implement database connection pooling in my current setup.
I am using XAMPP(PHP/MySql/Apache)/Windows XP.
I read about mod_dbd here : http://httpd.apache.org/docs/trunk/mod/mod_dbd.html
and other places.
So I added these lines to httpd.conf in xampp/Apache/Conf/httpd.conf file :
LoadModule dbd_module modules/mod_dbd.so
<IfModule dbd_module>
DBDKeep 3
DBDPersist On
DBDriver mysql
DBDMax 3
</IfModule>
Now, if I restart xampp, I get this :
DBD : No Driver for MySql and Apache doesn't start.
How to fix this?
Secondly, I commented out this line :
"DBDriver mysql"
after which Apache started.
Then I executed the following PHP Script multiple times :
<?
$db_uname = 'root';
$db_pass = '';
$db_name = 'some_db';
$db_host = 'localhost';
$link = mysql_connect($db_host, $db_uname, $db_pass);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
else {
echo 'Connected successfully<br>';
}
?>
Now I went to MySql command prompt and saw the number of connections
with :
mysql> SHOW PROCESSLIST;
and it increases every time I execute the script and
DBDKeep 3
DBDMax 3
have no effect on the number of connections.
Is it because this module has not been loaded?
Is it the correct way to verify that mod_dbd is working,
i.e. number of open connections shouldn't exceed 3?
Else, how do I verify that mod_dbd is working?
Or if mod_dbd cannot work with XAMPP,
what is the alternative for connection pooling
using XAMPP(PHP)?