ruby app and MySQL server has gone away error
Hi there,
I'm running a ruby - multi-threaded application that collects data over the internet and then connects to MySQL to do a simple insert.
insert into churches.us values('','NULL','XYZ Christian Church','43.268158','-99.731361','0011111111111','200 N XYZ Ave','Shmack City','Shmack%2CCity','IA',NOW())
Everything works great until there is around 2600 records in the database.
Then some (not all) of the attempts to insert end up in the error: "MySQL server has gone away". The query that fails looks normal and works if I run them manually. Also no slow queries are being logged to the file configured in my.cnf. No errors appear in mysql.err
I can't figure out why the error.
There is plenty of memory on the server:
free -lmh
total used free shared buffers cached
Mem: 8.8G 1.1G 7.7G 6.4M 94M 162M
Low: 8.8G 1.1G 7.7G
High: 0B 0B 0B
-/+ buffers/cache: 863M 7.9G
Swap: 2.0G 0B 2.0G
select count(*) from churches.us
+----------+
| count(*) |
+----------+
| 2527 |
+----------+
root@fd001:~/test# mysql -u root -p'bleeeeep' -e "show variables like '%wait%';show variables like '%errors%'"
+---------------------------------------------------+----------+
| Variable_name | Value |
+---------------------------------------------------+----------+
| innodb_lock_wait_timeout | 3600 |
| innodb_spin_wait_delay | 6 |
| lock_wait_timeout | 31536000 |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size | 10 |
| wait_timeout | 28800 |
+---------------------------------------------------+----------+
+--------------------+---------+
| Variable_name | Value |
+--------------------+---------+
| max_connect_errors | 1000000 |
| slave_skip_errors | OFF |
+--------------------+---------+
root@fd001:~/test# mysql -u root -p'bleeep' -e "show status like '%conn%'; show status like '%thread%'"
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| Aborted_connects | 0 |
| Connections | 3105 |
| Max_used_connections | 25 |
| Ssl_client_connects | 0 |
| Ssl_connect_renegotiates | 0 |
| Ssl_finished_connects | 0 |
| Threads_connected | 8 |
+--------------------------+-------+
+------------------------------------------+-------+
| Variable_name | Value |
+------------------------------------------+-------+
| Delayed_insert_threads | 0 |
| Performance_schema_thread_classes_lost | 0 |
| Performance_schema_thread_instances_lost | 0 |
| Slow_launch_threads | 0 |
| Threads_cached | 8 |
| Threads_connected | 8 |
| Threads_created | 83 |
| Threads_running | 2 |
+------------------------------------------+-------+
key_buffer = 128M
max_allowed_packet = 256M
max_connect_errors = 1000000
thread_stack = 192K
thread_cache_size = 16
max_connections = 1024
table_cache = 256
thread_concurrency = 1024
root@fd001:~/test# cat /proc/version
Linux version 3.13.0-40-generic (buildd@comet) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #69-Ubuntu SMP Thu Nov 13 17:53:56 UTC 2014
root@fd001:~/test# ruby -v
ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
Subject
Written By
Posted
ruby app and MySQL server has gone away error
December 03, 2014 01:36PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.