[redland-dev] MySQL storage engine should use persistent connections

Morten Frederiksen mof-rdf at mfd-consult.dk
Fri May 6 13:29:41 BST 2005


Hi,

I've created an issue [1] in the issue tracker and attached a patch to it:

#27: MySQL storage engine should use persistent connections

As released, the MySQL storage engine opens a new connection for each query it 
sends to the MySQL server.

This was originally done to avoid problems with deadlocks and nested queries, 
but turns out to have a negative impact on performance, especielly since 
rasqal has entered the scene.

The attached patch makes the engine maintain a growing list of connections 
instead, and reuses them where possible.

The connections should be automagically maintained by the mysql client library 
in case the server terminates one because of a timeout, and while the number 
of simultaneous connections will not increase with this patch, the duration 
of the connections is extended.


crschmidt has been kind enough to test it as well, and found no problems with 
it, but I'd be happy to receive comments on the viability in general use.


Related to this was a request [2] for the Perl bindings to use DBI, to make it 
possible to share persistent connections when running under Apache. I don't 
see how that's possible, and also don't want to spend time investigating it, 
but feel free to go ahead and try. :-)


[1] http://bugs.librdf.org/mantis/view.php?id=27
[2] 
http://www.ilrt.bris.ac.uk/discovery/chatlogs/swig/2005-05-02.html#T21-53-35


Regards,
Morten


More information about the redland-dev mailing list