Why is constructing PDO connection slow?
I've been doing some googling, and after reading this thread, I changed localhost
to 127.0.0.1
. That solves the problem....
Why is my PDO Mysql database connection closing slow?
The query I was executing simply took too long and was still running on the background while the php parser continued.
speed up php::PDO- __construct
The solution is quite simple ...
PDO connecting to localhost -> 1 second
PDO connecting to 127.0.0.1 -> 50 miliseconds...
dont aks me why ... seems to have something to do with try & wait for ipv6 connection, then fall back to good old ipv4 ... the ipv4 adresse does not try ipv6 ...
PDO Connection First Query Delay
Thanks for all the help and great suggestions on this one. I thoroughly checked the dns and other solutions but in the end it turned out to be the innodb page buffer pool. I have coded up a solution for myself and have added it in its entirety in my question above so hopefully it will be of use.
Thanks again for the help.
Related Topics
How to Loop Through a MySQL Query via Pdo in PHP
What Is the Best Practice to Export Canvas with High Quality Images
Type Casting for User Defined Objects
Converting a Number Base 10 to Base 62 (A-Za-Z0-9)
What Is the Equivalent of JavaScript's Encodeuricomponent in PHP
Configure Multiple Databases in Zf2
How to Auto Call Function in PHP for Every Other Function Call
PHP Can't Connect to MySQL with Error 13 (But Command Line Can)
How to Place Two Forms on the Same Page
How to Pull First 100 Characters of a String in PHP
Which Mime Type Should I Use for Mp3
Rounding to Nearest Fraction (Half, Quarter, etc.)