title: psycopg2.DatabaseError: SSL SYSCALL error: Connection timed out
body: <p>We're developing a website which requires database access. Accessing such a page works fine; accessing multiple in a row is also fine. However, if you wait for a long amount of time (15 minutes seems to be enough), accessing another page will hang for a long time (10-20 minutes has been observed). Afterwards, <a href="https://pastebin.com/SkRZ7uQB" rel="noreferrer">this error</a> will print.</p>
  
  <p>Here's the relevant code:</p>
  
  <pre><code>if __name__ == "__main__":
  conf = load_conf(sys.argv[1])
  
  engine = create_engine('postgresql://%s:%s@%s:%s/%s' %
                         (conf['db']['user'], conf['db']['pw'], conf['db']['address'],
                          conf['db']['port'], conf['db']['database']), echo=False)
  
  Session = sessionmaker(bind=engine)
  session = Session()
  
  app = make_app(session, conf)
  app.listen(8888)
  tornado.ioloop.IOLoop.current().start()
  </code></pre>
  
  <p>The database is on a different server. My personal machine is in the Netherlands, while the database is in a server in Germany. My partner's personal machine is in Italy.</p>
  
  <p>Most notably, this issue is <em>only</em> present on my machine, running Arch Linux. We've tested this on two other machines, running Windows and some other Linux (I assume Ubuntu, can check if needed). At this point, we have no clue on how to continue debugging.</p>
  
  <p>Of course, I will provide any extra needed information on request.</p>