SOLVED Re: MySQL 4.0.14 stops responding to PHP 4.3.2
On Thursday, Sep 4, 2003, at 12:47 US/Eastern, Parker Morse wrote: No, it turns out this is not the key. With mysql_connect() I'm actually failing MORE often than with mysql_pconnect - so far it hasn't stayed up 15 minutes without error. (Fortunately, I have a cron job checking on it and restarting.) However, this did put me on to the problem. I was tripping resource limits. When I was first setting up the server and getting the individual sites/users working in the mysql.user table, I saw the max_connections column set to 0 and thought that was a problem; I didn't realize that 0 meant no limit. So I set a limit. I was running up on the connection limits, which meant mysqld was refusing further connections until my server restart reset the counts to 0. With mysql_connect I had more connections, and thus reached the limit faster. Now I have reset the max_connections numbers to 0, and I haven't had a failure in twenty hours, so I think I can call this problem solved. Thanks for your help. In the course of sorting it out, I also learned a good deal about debugging mysql errors gracefully in PHP. pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: SOLVED Re: MySQL 4.0.14 stops responding to PHP 4.3.2
Hi, Finally you seem to say that you 've setting max_connections with a limit. Can you tell how many 100 or 200 ? Also you say : Here's the configuration: MySQL Ver 12.21 Distrib 4.0.14, for pc-linux (i686) PHP 4.3.2 Red Hat 9.0 Have you enable QUERY CACHE feature with MySQL 4.0.14 ? Regards Thierno6C -Original Message- From: Parker Morse [mailto:[EMAIL PROTECTED] Sent: vendredi 5 septembre 2003 15:01 To: [EMAIL PROTECTED] Subject: SOLVED Re: MySQL 4.0.14 stops responding to PHP 4.3.2 On Thursday, Sep 4, 2003, at 12:47 US/Eastern, Parker Morse wrote: No, it turns out this is not the key. With mysql_connect() I'm actually failing MORE often than with mysql_pconnect - so far it hasn't stayed up 15 minutes without error. (Fortunately, I have a cron job checking on it and restarting.) However, this did put me on to the problem. I was tripping resource limits. When I was first setting up the server and getting the individual sites/users working in the mysql.user table, I saw the max_connections column set to 0 and thought that was a problem; I didn't realize that 0 meant no limit. So I set a limit. I was running up on the connection limits, which meant mysqld was refusing further connections until my server restart reset the counts to 0. With mysql_connect I had more connections, and thus reached the limit faster. Now I have reset the max_connections numbers to 0, and I haven't had a failure in twenty hours, so I think I can call this problem solved. Thanks for your help. In the course of sorting it out, I also learned a good deal about debugging mysql errors gracefully in PHP. pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: SOLVED Re: MySQL 4.0.14 stops responding to PHP 4.3.2
On Friday, Sep 5, 2003, at 13:41 US/Eastern, Thierno Cissé wrote: Finally you seem to say that you 've setting max_connections with a limit. Can you tell how many 100 or 200 ? No. It turns out that setting max_connections to 0 is the same as setting no limit at all. This was my initial misunderstanding. The server is not currently in danger of overload, and I am sysadmin, DBA and primary web developer (small company), so I am free to work with no restrictions until I feel they're necessary. Also you say : Here's the configuration: MySQL Ver 12.21 Distrib 4.0.14, for pc-linux (i686) PHP 4.3.2 Red Hat 9.0 Have you enable QUERY CACHE feature with MySQL 4.0.14 ? Not that I'm aware of. As I said in my first post, I'm familiar with MySQL from the web developer's standpoint, but this is my first experience running and tuning the server. I'm sure there's a lot of things I could be doing to configure it better, but it's not clear to me yet what they are. It's pretty much a default configuration now, with my_large.cnf with a few tweaks as the my.cnf file. pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL 4.0.14 stops responding to PHP 4.3.2
On Thursday, Sep 4, 2003, at 01:27 US/Eastern, Antony Dovgal wrote: Please, read http://www.php.net/manual/en/features.persistent-connections.php I recommend you not to use *_pconnect. There are some big problems with persistent connections and these problems are 'by design'. Use SQLrelay if you need real connection pooling. In your case MySQL probably says 'too many connections' and you can catch this error message if you'll turn on error_log in php.ini. That sounds like a plausible explanation - by restarting mysqld I'd be closing all the open connections, admittedly the hard way. I've changed the mysql_pconnect() calls to mysql_connect(), and I'm reading up in the manual. I don't understand all of it yet, which should probably tell me to stick to mysql_connect! Meanwhile, I'll see if I have any more failures using mysql_connect. Thanks, pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL 4.0.14 stops responding to PHP 4.3.2
On Thursday, Sep 4, 2003, at 10:03 US/Eastern, Parker Morse wrote: On Thursday, Sep 4, 2003, at 01:27 US/Eastern, Antony Dovgal wrote: Please, read http://www.php.net/manual/en/features.persistent-connections.php I recommend you not to use *_pconnect. There are some big problems with persistent connections and these problems are 'by design'. Use SQLrelay if you need real connection pooling. In your case MySQL probably says 'too many connections' and you can catch this error message if you'll turn on error_log in php.ini. That sounds like a plausible explanation - by restarting mysqld I'd be closing all the open connections, admittedly the hard way. I've changed the mysql_pconnect() calls to mysql_connect(), and I'm reading up in the manual. I don't understand all of it yet, which should probably tell me to stick to mysql_connect! Meanwhile, I'll see if I have any more failures using mysql_connect. No, it turns out this is not the key. With mysql_connect() I'm actually failing MORE often than with mysql_pconnect - so far it hasn't stayed up 15 minutes without error. (Fortunately, I have a cron job checking on it and restarting.) I have error_log turned on in php.ini, but there's nothing at the specified path. Likewise, the mysql_error log is only showing the restarts. pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL 4.0.14 stops responding to PHP 4.3.2
No, it turns out this is not the key. With mysql_connect() I'm actually failing MORE often than with mysql_pconnect - so far it hasn't stayed up 15 minutes without error. (Fortunately, I have a cron job checking on it and restarting.) After the failed connection attempt, there will be an error message you can get from mysql_error(). What is it? Also, rather than restart, will mysqladmin flush-hosts fix it as well? (We have to run the flush-hosts every hour in a cron job. Never bothered to figure out the root cause as this fixes things.) --steve- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
MySQL 4.0.14 stops responding to PHP 4.3.2
I've been using MySQL and PHP for a while in a shared hosting environment, but recently we shifted to a co-located server, so I am new to administering mysqld. Periodically our PHP sites will fail to connect using mysql_pconnect(). We currently have three sites on the colo box (two more are waiting on shared hosting until I can solve this problem) and they all fail at once. mysqld is still running, though. If I shut down mysqld and restart, they are able to connect again. This makes me think the problem is with how I have MySQL configured. However, nothing useful is being logged anywhere in the /var/log heirarchy, so I can't figure out what's going wrong. Here's the configuration: MySQL Ver 12.21 Distrib 4.0.14, for pc-linux (i686) PHP 4.3.2 Red Hat 9.0 I am starting MySQLd with mysqld_safe --user=mysql --bind-address=127.0.0.1. I don't have a my.conf file, so I seem to be running with defaults. It's hard to get a picture of what's happening right before these lockups, but when I look after a lockup, load on the server doesn't appear to be an issue. (I haven't seen load average go over .50 except during the initial fcheck run, and most of the time it's 0.00.) I have some mysql status snapshots from before and after a lockup. I've also been running mytop thanks to a suggestion on this list yesterday. If anyone thinks that information would be helpful, I can supply them. Thanks for anything that might give me a toehold on this problem. pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: MySQL 4.0.14 stops responding to PHP 4.3.2
not knowing anything about PHP (java geek, myself), I'm guessing that your connections are timing out, and php is not configured to try to reconnect Another option is that you are not closing your connections, so you can't get a new connection to do anything with. Also new to MySQL, I'm not sure of a command that you can use to show current connections but I'm sure it's out there... with the popularity of PHP, I have to think it has built-in connection pooling facilities that may help resolve these issues... Realizing that a Java/Oracle knowledgebase is somewhat lacking in PHP/MySQL, Dan Greene -Original Message- From: Parker Morse [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 11:43 AM To: [EMAIL PROTECTED] Subject: MySQL 4.0.14 stops responding to PHP 4.3.2 I've been using MySQL and PHP for a while in a shared hosting environment, but recently we shifted to a co-located server, so I am new to administering mysqld. Periodically our PHP sites will fail to connect using mysql_pconnect(). We currently have three sites on the colo box (two more are waiting on shared hosting until I can solve this problem) and they all fail at once. mysqld is still running, though. If I shut down mysqld and restart, they are able to connect again. This makes me think the problem is with how I have MySQL configured. However, nothing useful is being logged anywhere in the /var/log heirarchy, so I can't figure out what's going wrong. Here's the configuration: MySQL Ver 12.21 Distrib 4.0.14, for pc-linux (i686) PHP 4.3.2 Red Hat 9.0 I am starting MySQLd with mysqld_safe --user=mysql --bind-address=127.0.0.1. I don't have a my.conf file, so I seem to be running with defaults. It's hard to get a picture of what's happening right before these lockups, but when I look after a lockup, load on the server doesn't appear to be an issue. (I haven't seen load average go over .50 except during the initial fcheck run, and most of the time it's 0.00.) I have some mysql status snapshots from before and after a lockup. I've also been running mytop thanks to a suggestion on this list yesterday. If anyone thinks that information would be helpful, I can supply them. Thanks for anything that might give me a toehold on this problem. pjm -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL 4.0.14 stops responding to PHP 4.3.2
On Wed, 3 Sep 2003 11:42:35 -0400 Parker Morse [EMAIL PROTECTED] wrote: Periodically our PHP sites will fail to connect using mysql_pconnect(). We currently have three sites on the colo box (two more are waiting on shared hosting until I can solve this problem) and they all fail at once. mysqld is still running, though. If I shut down mysqld and restart, they are able to connect again. This makes me think the problem is with how I have MySQL configured. However, nothing useful is being logged anywhere in the /var/log heirarchy, so I can't figure out what's going wrong. Please, read http://www.php.net/manual/en/features.persistent-connections.php I recommend you not to use *_pconnect. There are some big problems with persistent connections and these problems are 'by design'. Use SQLrelay if you need real connection pooling. In your case MySQL probably says 'too many connections' and you can catch this error message if you'll turn on error_log in php.ini. --- WBR, Antony Dovgal aka tony2001 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: MySQL 4.0.14 stops responding to PHP 4.3.2
On Wed, 3 Sep 2003 18:23:00 -0400 Dan Greene [EMAIL PROTECTED] wrote: not knowing anything about PHP (java geek, myself), I'm guessing that your connections are timing out, and php is not configured to try to reconnect PHP always reconnects, but *_pconnect seeks for the already existing connection first. with the popularity of PHP, I have to think it has built-in connection pooling facilities that may help resolve these issues... no, it's not Java, there is no Application Server. there is only Apache and Apache's module - PHP. so, you have to use some third-party application if you need connection pooling. this can be for example SQLrelay (sqlrelay.sf.net) or SRM (www.vl-srm.net - this one is rather PHP-specific). --- WBR, Antony Dovgal aka tony2001 [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]