Why mysql mysql_connect() is 1500 times slower than mysql_pconnect()

Why mysql mysql_connect() is 1500 times slower than mysql_pconnect()

Situation:

Using mysql_connect()
connected 4.50053286552
selected db 4.5008919239
after query 4.50122404099

Total: 4.50152397156s

Using mysql_pconnect()
connected 0.000265121459961
selected db 0.000554084777832
after query 0.000866174697876

Total: 0.000992059707642s

mysql server: dedicated with 12G of memory optimized
web server: php mysql provider uses MySQL 3.23.49, php 4.3.8 with zend optimizer 2.5.3 and MMCACHE, same php.ini and mmcache.ini

The same script on another web server with the same configuration and physical server conf. results differently. as the other server gives almost the same result for mysql mysql_connect() = 0.003s and mysql_pconnect() = 0.001s.

Any expert here?

Many thanks.

 

 

 

 

Top