title: Simple Flask project runs slowly
body: <p>I'm getting started with Flask, and am finding some odd latency problems. </p>
  
  <p>The Flask code is the simplest possible 'Hello World!' as follows:</p>
  
  <pre><code>from flask import Flask
  app = Flask(__name__)
  @app.route("/")
  def hello():
      return "Hello World!"
  if __name__ == "__main__":
      app.run()
  </code></pre>
  
  <p>and it's installed on a remote Ubuntu 18 server using a VM and Gunicorn, as follows:</p>
  
  <pre><code>gunicorn -b 0.0.0.0:5000 app:app --reload
  </code></pre>
  
  <p>I am using the Python 'requests' library to call the server under Windows 10, as follows:</p>
  
  <pre><code>import requests, time
  
  url = 'http://vps.XXXXX.ssdhosts.com.au:5000/'
  
  t0 = time.time()
  response = requests.get(url)                       
  t1 = time.time()
  total = t1-t0
  print("Simple get request took " , total)
  </code></pre>
  
  <p>The issue is that the time to call the remote function always takes between 0.7s and 1s, which seems slow for such a simple function. My impression from reading about similar deployments is that this call should be much faster.</p>
  
  <p>Can this function be speeded up?</p>
  
  <p>I have tried: </p>
  
  <ul>
  <li>hard-coding the IP address </li>
  <li>disabling IPv6 </li>
  <li>setting threaded=True in app.run() </li>
  <li>calling the web address from a browser</li>
  </ul>
  
  <p>None of these make any difference. </p>
  
  <p>In addition, the server is in Australia while I am in the UK. Would this cause a slow-down?</p>