Why Is Constructing Pdo Connection Slow

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



Leave a reply



Submit