OMS
OMS

Reputation: 55

How can I increase gunicorn --limit-request-line in a python App Engine application with Flask?

It is a sort question, I am building a very simple API with python runtime and Flask in Google Cloud Platform. Problem is that the request URL can get a bit long (approx 6000 bytes) and the current gunicorn limit is 4096. I know it will sound dumb, but I am trying to change it on the app.yaml file and when I run it it returns 500 server error. I am almost certain it is a problem in the entrypoint that I added because I do not know how to modify the app.yaml (I am new in web development). My app.yaml is as follows:

runtime: python37
service: py
entrypoint: gunicorn --limit-request-line 8190 main:app

Could someone help me if you know what error I have? I have checked GCP documentation and demos but as usual they are not very descriptive.

Upvotes: 0

Views: 2085

Answers (1)

bhito
bhito

Reputation: 2673

You may need to have gunicorn in your requirements.txt if you don't have it already, as the docs mention.

Regarding the entrypoint in your app.yaml it looks correct, however I think you're missing adding the port to have App Engine listening to 8080, which is a requirement.

entrypoint: gunicorn -b :8080 --limit-request-line 8190 main:app

More information can be found as well in the following section of the documentation.

Upvotes: 3

Related Questions