design - How to handle long asynchronous requests with pyramid and celery? -


i'm setting web service pyramid. typical request view long, 15 min finish. idea queue jobs celery , rabbitmq broker. know best way ensure bad things cannot happen. prevent task queue overflow example.

a first mesure defining quotas per ip, limit number of requests given ip can submit per hour.

however cannot predict number of involved ips, cannot solve everything.

i have read it's not possible limit queue size celery/rabbitmq. thinking of retrieving queue size before pushing new item i'm not sure if it's idea.

i'm not used practices in messaging/job scheduling. there recommended way handle kind of problems ?

rabbitmq has flow control built qos. if rabbitmq cannot handle publishing rate adjust tcp window size slow down publishers. in event of many messages being sent server overflow disk. allow consumer bit more naive although if restart connection on error , flood connection can cause problems.

i've decided spend more time making sure publishers/consumers work multiple queue servers instead of trying make them more intelligent single queue server. benefit if overloading single server can add 1 (or pair if using rabbitmq ha. there useful video pycon messaging @ scale using celery , rabbitmq should of use.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -