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.