2

I am having a very common but difficult issue. and after trying to solve this issue for 2 days, im throwing this on SO.

When Im running a very resource hungry query in my php script, my percona cluster (3 nodes) is throwing me this error :

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /var/www/path/lib/Zend/Db/Statement/Pdo.php:228

I tried fixing it by

adding these 3 lines in php.ini

mysql.connect_timeout = 300
 default_socket_timeout = 300
max_input_time = 300

but still it fails.

If we look at the mysql console :

set global connect_timeout = 300;
set delayed_insert_timeout = 300;
SET GLOBAL max_allowed_packet = 1024 * 1024 * 512;

So far no success what so ever.

mysql> show global variables like '%timeout';

+----------------------------+----------+
| Variable_name              | Value    |
+----------------------------+----------+
| connect_timeout            | 300      |
| delayed_insert_timeout     | 300      |
| innodb_lock_wait_timeout   | 50       |
| innodb_rollback_on_timeout | OFF      |
| interactive_timeout        | 28800    |
| lock_wait_timeout          | 31536000 |
| net_read_timeout           | 30       |
| net_write_timeout          | 60       |
| slave_net_timeout          | 3600     |
| thread_pool_idle_timeout   | 60       |
| wait_timeout               | 28800    |
+----------------------------+----------+

im left clueless.

Vic
  • 188
  • 3
  • 16
  • did you ever get anywhere with this? I am starting to see this error on a php script which is run in cli mode periodically. – BParker Apr 26 '14 at 09:02
  • I installed Redis cache, and it seemed to fix the issue temp. – Vic Apr 27 '14 at 17:13
  • Does this happen when a query is running? On my PS5.6 install I ran into this after some permissions changes after package updates. After being up for a bit, any resource intensive query would error out with this. – cerd May 02 '14 at 05:55
  • @Cerd : Yes, I am running a very intensive query as well. And thats how the error would be generated, I corrected the question so it shows in the question how the error gets generated – Vic May 05 '14 at 03:46
  • 1
    @Vic - for me it was the settings on my /var/lib/mysql on the databases themselves - got set to root from usr = mysql – cerd May 05 '14 at 15:01
  • @Cerd, I found out that my DB's are in need of Memory. And its the current memory left is on 5%, so its worth checking your memory consumption – Vic Jun 26 '14 at 04:42
  • http://stackoverflow.com/a/25198914/2260568 – demon101 Aug 08 '14 at 08:18
  • There are usually three different reasons for this kind of message: * time between two queries was longer than `wait_timeout` * client connection was interrupted due to a network problem * the mysql server crashed On an 'intensive' query it might have a server crash indeed, in that case the mysql server error log should provide hints regarding the real failure reason – Hartmut Holzgraefe Nov 26 '14 at 16:51

0 Answers0