title: Losing connections from GCE to Google Cloud SQL
body: <p>For the past 3 days I have been executing long SQL queries without any problems, including this morning when I ran queries longer than 1200 seconds.</p>
  
  <p>But now I am getting:</p>
  
  <pre><code>&gt; ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query
  </code></pre>
  
  <p>sample execution is:</p>
  
  <pre><code>marcelo@node:~$ sudo /sbin/sysctl -w net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_intvl=60 net.ipv4.tcp_keepalive_probes=5 
  net.ipv4.tcp_keepalive_time = 60 
  net.ipv4.tcp_keepalive_intvl = 60 
  net.ipv4.tcp_keepalive_probes = 5 
  marcelo@node:~$ mysql -uroot -p -DmyDb -hmyIP &lt; receivedcytext.txt &gt;out.txt 
  Enter password: 
  ERROR 2013 (HY000) at line 1: Lost connection to MySQL server during query
  </code></pre>
  
  <p>The error is given at random periods. Between 5 and 15 minutes into execution.</p>
  
  <p>Any thoughts?</p>