In my server there are also much simpler tasks, like retrieve data from RDBMS and send them to users. During heavy load, my stack receive approx 8000k requests per hour (3 or 4 requests per sec) and the tasks of retrieving SQL data, which spends 1 or 2 seconds only to complete the query, are queued and started only after 10 or 15 seconds, causing a bottleneck which I really don't know how to handle.
Spinning up some threads (gthread) per worker helps a little, but does not resolve. Only thing that has a relevant effect is to increase the workers, but this is considered an antipattern from G…