I'm getting a strange, recurring but not constant, error where I get "2013, query from mysql server",
connection lost ' ". These complexes are:
-
A python app runs around every 15-20minutes an hour and then stops (scheduled by hourly cron)
-
The application is on a GCE n1-highcpu-2 example, the database is on a D1 with a per-package pricing plan and the following mysql flags
-
The database is accessible only by this application And this app only uses the same way, there is nothing for about 20 minutes per hour and for another 40 minutes per hour
-
This is the first query < / P>
select users.user_id, users.access_token, users.access_token_secret, users.screen_name, users from metadata.last_id join the external external metadata Users.user_id = metadata.user_id where users.enabled = 1
-
The above queries are included in two tables after each question (which Takes 0.2 seconds when it runs without problems) The app starts without any issue
- P> li>
I see that every time this error presents the interval between the start of the query and the error is 15 minutes.
I have also slow query logs and those queries are registered as such:
start_time: 2014-10-27 13:19:04 query_time: 00:00:00 lock_time : 00:00:00 rows_cent: 760 rows_examined: 1514db: foobar last_insert_id: 0 insert_id: 0 server_id: 1234567 sql_text: ...
any ideas
If your connection is worthless for a 15 minute interval, you are probably disconnecting your idle TCP connection to GCE, as Has been reported. That page shows that the workaround:
sudo / sbin / sysctl -w net.ipv4.tcp_keepalive_time = 60 net.ipv4.tcp_keepalive_intvl = 60 net.ipv4.tcp_keepalive_probes = 5
(you may need to put this configuration in /etc/sysctl.conf to make it permanent)
Comments
Post a Comment