title: How to diagnose poor Flask performance?
body: <p>I have a Flask app and PostgreSQL database. From some point in time the app started behaving erratically: response times are very high, and for some reason the Flask app process takes 60% of available memory. Eventually (ater several days of uptime, roughly from 3 to 5) application becomes unusable, due to every interaction with it taking more then minute to complete or timing out outright.</p>
  
  <p>How can I diagnose this behavior?  Is there a proper way to determine where the delays come from and why so much memory is used?</p>