AppEngine Flexible - manually scaled but times out at 1h

789 views
Skip to first unread message

Dinçer Kavraal

unread,
Feb 13, 2018, 9:47:55 AM2/13/18
to Google App Engine

Hi,

Despite having manually scaled in the flexible environment, I am getting 504 timeout (seems from nginx). Has anybody experienced sth like this? I couldn't find what I'm doing wrong for my test. 

I am sure the app is not failing. Also, I see that my application continues to run even though the request is dropped by nginx.

Here is the response to appengine request (after 60mins) :

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

Here is the app.yaml descriptor:

service: some-service-name
api_version: 1
threadsafe: yes

runtime: python
env: flex
entrypoint: gunicorn --pythonpath src -t 22400 -b :$PORT -w 1 --threads 12 src.main:app
runtime_config:
  python_version: 3

skip_files:
- ^(.*/)?\.pyc$
- lib
- venv

readiness_check:
  path: "/"
  check_interval_sec: 30
  timeout_sec: 10
  failure_threshold: 3
  success_threshold: 3
  app_start_timeout_sec: 300

liveness_check:
   path: "/"
   check_interval_sec: 30
   timeout_sec: 10
   failure_threshold: 3
   success_threshold: 3

handlers:
- url: .*
  script: src.main.app

manual_scaling:
  instances: 1

resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

env_variables:
  DEBUG: 0

Katayoon (Cloud Platform Support)

unread,
Feb 13, 2018, 3:23:39 PM2/13/18
to Google App Engine

The response time limit in App Engine is one hour, so it is intended that you receive the error message after one hour. Using manual scaling in the Flexible environment doesn’t affect that.


Could you tell us why you need your requests to last for over an hour? It might be that App Engine is not the best suited product for your needs.


You should also note that very heavy traffic might result in your server serving a 504 error. I recommend that you scale up the number of your instances based on your traffic estimation or set it as automatic scaling.



Dinçer Kavraal

unread,
Feb 14, 2018, 2:49:43 AM2/14/18
to Google App Engine
Hi,

Here it says it is 24 hours, even for the standard environment. Am I interpreting this wrong?


Deadlines  / Manual Scaling:
Requests can run for up to 24 hours. A manually-scaled instance can choose to handle /_ah/start and execute a program or script for many hours without returning an HTTP response code. Task queue tasks can run up to 24 hours.
I know this is not the best case even optimal case for AppEngine, but I am trying to find a way to utilize AppEngine for a small task, managing long running tcp connections. I know I can do this on a simple and small instance.

Thanks

Katayoon (Cloud Platform Support)

unread,
Feb 14, 2018, 2:01:55 PM2/14/18
to Google App Engine
The document you are referring is for App Engine Standard Environment. 

Could you provide more details on your use-case? For instance, If you want to continuously receive and process data, Cloud Dataflow can be a better option for you.

Dincer Kavraal

unread,
Feb 14, 2018, 3:13:35 PM2/14/18
to google-a...@googlegroups.com, Google App Engine
Not using data flow is because of heavily for preference and also beam doesn’t support some of the requirements.
1. Managing late data is not supported in the Beam SDK for Python.
2. The Beam SDK for Python does not support triggers.
3. also code maturity and documentation maturity
4. preference

So I understand there is no way to wait for response to a flexible api request for more than 1 hour.

Ok thanks.



DK

-- 
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/A38kTCjvYrc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/20538e7e-feb9-4909-8489-52731d8e54d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages