I have one method that needs to handle large number of requests. I'm using Rack for it.
What it does is that it receive parameters and it creates a delayed_job task:
def self.call(env)
...
Delayed::Job.enqueue(....)
To optimize it further I thought it would be nice to make the line above happen in the Background (maybe caching it in memory to insert the Delayed job entry in DB a bit later and increase responsiveness of the Rack App).
Any easy way to delay queuing Delayed Job task to save few mi开发者_StackOverflow社区lliseconds?
Current Bench mark is 12ms / Request so even couple milliseconds will help.
If you use workling/starling instead of delayed_job, then you can use Memcached instead of the database.
https://github.com/purzelrakete/workling
https://github.com/starling/starling
精彩评论