Mysqli_connect delay

I recently had to reinstall my package so that I get fresh apache 2.2.22, php 5.4.3 and mysql 5.5.24.

One big change that has happened is the page creation time. I dug up a bit and found out that calling mysqli_connect takes up to 2 seconds.

So, it still works, so my users are well reconfigured, and the whole system gets up - only this part makes everything unusable.

Does anyone know where this latency comes from?

EDIT: There seems to be a problem with dns, as you suggested. Now, if I go to 127.0.0.1, I have access denied. I keep digging

+4
source share
2 answers

I had the same thing, I connected to "localhost" and I had 1.5 seconds for each "connection", now I use 127.0.0.1, and now it works great! FIY, tested with Windows 2008 R2 x64 + plesk 11 php 5.3 (and php5.4)

+8
source

Well, wildcards in C: \ Windows \ System32 \ drivers \ etc \ hosts slowed down my every request to 1 s or more,

Handling multiple local comma-separated name names was terrible (something with win7 DNS regexp)

127.0.0.1 localhost, domain.com 

Dividing it, I again got a nice answer without delay

 127.0.0.1 localhost 127.0.0.1 domain.com 
0
source

Source: https://habr.com/ru/post/1432717/


All Articles