Pro Green European
2008-Jun-09 06:42 UTC
[CentOS] Help, PHP/Mysql connections are so slow.
Hi. 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. 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. The server is Xeon based and has 4GB of RAM. SElinux is enabled, and ModSecurity for Apache too. Disabling these two does not help. SElinux allows Apache to network connect. Some php.ini settings: ==============================safe_mode = On max_execution_time = 60 max_input_time = 60 memory_limit = 128M open_basedir is active, and there are no conflicts. disable_functions also contain several functions in order to secure server. allow_fopen_url is disabled ============================== Could there be a bug somewhere that is causing this slowness for PHP/Mysql connections. Feedback and tips for solving this problem will be greatly appreciated :) Regards, /PGE (aka mysteron) --- Link to forum post: http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14575&start=0#forumpost50376 --- Answer I've recieved and answered: 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? 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. --- -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20080608/38cc59e1/attachment-0002.html>
Pro Green European
2008-Jun-09 07:14 UTC
[CentOS] Help, PHP/Mysql connections are so slow.
Now I've also tried running a MySQL server on the webserver, and setting for example phpmyadmin to connect to localhost does not change any kind of behaviour. PHP/Mysql connections are still very slow. /PGE --- On Mon, 6/9/08, Pro Green European <pro_green_european at yahoo.com> wrote: From: Pro Green European <pro_green_european at yahoo.com> Subject: [CentOS] Help, PHP/Mysql connections are so slow. To: centos at centos.org Date: Monday, June 9, 2008, 9:42 AM Hi. 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. 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. The server is Xeon based and has 4GB of RAM. SElinux is enabled, and ModSecurity for Apache too. Disabling these two does not help. SElinux allows Apache to network connect. Some php.ini settings: ==============================safe_mode = On max_execution_time = 60 max_input_time = 60 memory_limit = 128M open_basedir is active, and there are no conflicts. disable_functions also contain several functions in order to secure server. allow_fopen_url is disabled ============================== Could there be a bug somewhere that is causing this slowness for PHP/Mysql connections. Feedback and tips for solving this problem will be greatly appreciated :) Regards, /PGE (aka mysteron) --- Link to forum post: http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14575&start=0#forumpost50376 --- Answer I've recieved and answered: 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? 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. --- _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
>>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.My suggestion is just for the test and see if it will improve, try to update from RPMForge both your apache, php and mysql one at a time then test. I believe Dag's repo has more recent version. Thanks, junji aisalen.wordpress.com Linux Registered User #253162 CentOS User Send instant messages to your online friends http://uk.messenger.yahoo.com