ruby on rails - What's the point of using Resque with Redis To Go for background tasks -



ruby on rails - What's the point of using Resque with Redis To Go for background tasks -

if point of having tasks calling external services (such sending emails) sent background tasks , workers remove time consuming tasks main app, don't understand why using resque redis go such great idea. isn't redis go external service in case wouldn't defeat purpose since storing key/values queue on redis go unpredictable , potentially time consuming itself?

edit

the reason i'm confused hadn't set workers , queue generated (and operations waiting because there no workers) resque on redis go. i'm assuming means initial redis go write done main thread.

the main reason utilize background workers main thread not tied running task. using resque, allows tasks executed outside main thread. many reasons. biggest slow operations not cause main thread hang, blocking out functionality until request done.

redis go remote redis database. in main thread, operation modify 500 keys. on local database, take no time @ all, unless utilize multi command, have send each command server , wait response. ok, no big deal if few commands, take noticeable amount of time 500 times on remote server. here illustration numbers. takes 5ms operation locally. here, using resque not needed, jobs executed , locally. now, using redis go, have go outside lan. now, each operation takes 5ms (0.005 seconds). , if doing 500 of them, .005*500 2.5 seconds. now, 2.5 seconds beingness used query database, , main thread locked until requests done. (note, numbers totally random... higher or lower)

now, resque, operations done in background. when main thread executes, add together jobs resque. , the main thread execute. resque execute commands in order received. now, execution might take 2.5 seconds, 2.5 seconds not holding main thread.

ruby-on-rails heroku redis

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -