title: Getting a 504 Gateway Error on Google App Engine (long runtime of Flask App)
body: <p>I have been working with Google Cloud Platform &amp; Flask for the first time - my client wanted me to deliver a solution on it in 2 weeks.
  I have been successful so far in creating a Flask application and wanted to productionize it through Google App Engine. However, the runtime of my function is a little over 2.5 minutes and I get a <strong>"504 Gateway Timeout"</strong> error. In the code piece, I am accessing bigQuery, google spreadsheets and GCS buckets. Should I switch to a new GCP service or can some tweaks in my code/yaml file suffice? My yaml config is - </p>
  
  <pre><code>runtime: python37
  
  liveness_check:
   check_interval_sec: 300
   timeout_sec: 299
   failure_threshold: 10
   success_threshold: 10
   initial_delay_sec: 500
  
  readiness_check:
   app_start_timeout_sec: 1800
  </code></pre>
  
  <p>I would be very, very grateful to anyone who can help me resolve this issue.
  Thank you!</p>
  
  <p><strong>Edit:</strong> Just to give a brief about the application - this is a forecasting application that reads data from bigquery, GCS buckets, and Google Spreadsheets, processes it and runs ML models on it. The results are written back to Google Spreadsheets within the application itself (i.e. no response needed from the application per see). I'm triggering the application using google AppsScript.</p>