title: Timeout of remote connection to Postgresql
body: <p>I have two EC2 instances, one of them needs to insert large amounts of data into a Postgresql db that lives on the other one. Incidentally it's Open Street Map data and I am using the <code>osm2pgsql</code> utility to insert the data, not sure if that's relevant, I don't think so.</p>
  
  <p>For smaller inserts everything is fine but for very large inserts something times out after around 15 minutes and the operation fails with:</p>
  
  <p><code>COPY_END for planet_osm_point failed: SSL SYSCALL error: Connection timed out</code></p>
  
  <p>Is this timeout enforced by Postgresql, Ubuntu or AWS? Not too sure where to start troubleshooting.</p>
  
  <p>Thanks</p>