I'm trying to build a REST API using Falcon. I will have a post
endpoint where i'll receive a json (sometimes with hundreds of keys) and i will attempt to process this data:
- sanitize text data
- convert from str to int or similar operations
- 3 calls to other APIs
- inserts into mysql and elastic
The load is less than 50 requests/second but i have requests which can take minutes to process because of the number of keys and the calls to the other APIs (one request can trigger 100 x 3 api calls and the same amount of inserts into the database / elastic)
Given these circumstances, falcon fails to resolve most of my requests. I'm using gunicorn to serve the app, also tried serving it with serve.forever
. I've tried using gevent
but with no success.
I must mention that this service runs in a docker.
Is there any scaling setting in falcon i'm missing or is it a design flaw on my part?