I'm not sure if it's a OS X, PHP or MySQL issue so I apologize in advance if this is taken as too off topic.

I have a PHP5.x site under development with MySQL 4.1.10. I had the site running fine and there were no speed issues at all. Everything is on the same system (a dual G5 Xserve).

Today however the PHP pages with MySQL calls started to take forever to load. Static html and php files still loaded instantly.

I tracked the issue down to mysql_connect. Initial calls to this function are taking 5 to 10 seconds each. Subsequent calls missing a mysql_close call do not have the latency issue. Normally I try have each call to mysql_connect followed by a mysql_close to keep my mysql tables in order.

I have tried:

- loading the pages remotely and locally (both slow)
- checked the Apache / MySQL logs
- manually ran the mysql queries to check for slow queries (all 0.0x seconds duration)
- restarted apache / mysql
- used host and ip for mysql_connect function call (i.e. not a DNS look-up issue)
- full reboot


mysql_pconnect still stalls on the first connect but subsequent requests have no delay. Manual CLI connections do not show the connection delay. I am stumped.

What is the best practice for using connect vs. pconnect? Is it not best to open a connection, run a query and then close the connection?

Thanks,

Dan T


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to