<table cellspacing='0' cellpadding='0' border='0' background='none' style='font-family:arial;font-size:10pt;color:rgb(51, 51, 51);background-color:rgb(255, 255, 255);width:100%;'><tr><td valign='top' style='font: inherit;'>Hi.<br><br>I've got a new Centos 5.1 x86-64 server that uses PHP to
communicate with MySQL5. On this server, PHP/Mysql connections are dead
slow and unresponsive. It takes sometimes up to a minute to list tables
in phpmyadmin for example.<br><br>I've verified on the server that the
issue has to be PHP/Mysql related. If I use a CGI based Mysql admin
tool, communication is fast and there are no delays.<br><br>The server is Xeon based and has 4GB of RAM.<br><br>SElinux is enabled, and ModSecurity for Apache too. Disabling these two does not help.<br><br>SElinux allows Apache to network connect.<br><br>Some php.ini settings:<br>===============================<br>safe_mode = On<br>max_execution_time = 60<br>max_input_time = 60<br>memory_limit = 128M<br>open_basedir is active, and there are no conflicts.<br>disable_functions also contain several functions in order to secure server.<br>allow_fopen_url is disabled<br>===============================<br><br>Could there be a bug somewhere that is causing this slowness for PHP/Mysql connections.<br><br>Feedback and tips for solving this problem will be greatly appreciated :)<br><br><br>Regards,<br>/PGE (aka mysteron)<br><br>---<br>Link to forum
 post:<br><br>http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14575&start=0#forumpost50376<br><br>---<br>Answer I've recieved and answered:<br><br>Q: Sounds like the server is trying to do a reverse DNS lookup and timing
out after a minute plus. Is DNS set up on the server correctly?<br><br>A: Yes, DNS is working correctly. I tried with the IP address of the
database server instead of its DNS name, but there is no difference,
PHP/Mysql connections are still dead slow.<br><br>---<br><br></td></tr></table><br>