Reputation: 45
im building an app to track changes of contacts in Hubspot via a Webhook.
I deployed the service on Cloud Run (GCP) using the following services:
The problem i got is that everything is built correctly, but when theres more than one request received to the container (for example 100 contact deletions) only a few of them are being processed.
I though that nginx handled the requests and sent it one per one to my Flask app.
If this is not the case. How can i handle this situation?
Thanks in advance :)
Upvotes: 0
Views: 103
Reputation: 140
You can use gunicorn to handle more requests, gunicorn runs your flask app with more than one workers.
Just add gunicorn in your requirements.txt then put the CMD line to Dockerfile:
CMD ["gunicorn","-t 30", "-w3", "-b 0.0.0.0:8080", "app:app"]
-t max timeout (in seconds)
-w workers (recommended to keep same with processor cores you have in server)
-b binding adress
app:app means run app in app.py so you should edit this according to your flask app.
Upvotes: 1