![]() |
Practical mod_perl / HTML Book / | ![]() |
||
![]() |
||||
![]() |
![]() |
|||
![]() |
![]() |
|||
![]() |
||||
|
|
||||
![]() |
![]() |
|||
![]() |
20.2.2. Improving Speed by Skipping ping( ) |
![]() |
||
![]() |
||||
![]() |
![]() |
![]() |
||
![]() |
||||
If you use Apache::DBI and want to save a little bit of time, you can change how often the ping( ) method is called. The following setting in a startup file:
Apache::DBI->setPingTimeOut($data_source, $timeout)
will change this behavior. If the value of $timeout is 0, Apache:DBI will validate the database connection using the ping( ) method for every database access. This is the default. Setting $timeout to a negative value will deactivate the validation of the database handle. This can be used for drivers that do not implement the ping( ) method (but it's generally a bad idea, because you don't know if your database handle really works). Setting $timeout to a positive value will ping the database on access only if the previous access was more than $timeoutseconds earlier.
$data_source is the same as in the connect( ) method (e.g., DBI:mysql:...).
 
Continue to:
mod_perl, modperl, Apache, perl, cgi, html, mod_perl, e-commerce, scalability, free, open source, OSS, apache, squid, high availability, modperl, linux, unix, Web, www, mod_perl, webserver, admin, apache, book, webmaster, tools, modperl, guide, docs, documentation, help, mod_perl, perl, information, apache, script, errata, eric cholet, perl, apache, mod-perl, stas bekman, mod_perl, cool, perl, Apache, performance, speed, choice
![]() |
Other projects to check out: meta-religion.com is for those interested in Religious, Spiritual and Esoteric Phenomena. i-want-a-better.com is a community of people discussing what they would like to be improved in their lives and things they use and interact with. You may also want to find a healer in your area or read articles on variety of topics.