草庐IT

Master-Worker

全部标签

ruby-on-rails - 即使超时,Sidekiq worker 仍运行数千秒

我有一个不应超过30秒的sidekiqworker,但几天后我会发现整个worker队列停止执行,因为所有worker都被锁定了。这是我的worker:classMyWorkerincludeSidekiq::WorkerincludeSidekiq::Status::Workersidekiq_optionsqueue::my_queue,retry:5,timeout:4.minutessidekiq_retry_indo|count|5endsidekiq_retries_exhausteddo|msg|store({message:"Gaveup."})enddefperfor

ruby-on-rails - 即使超时,Sidekiq worker 仍运行数千秒

我有一个不应超过30秒的sidekiqworker,但几天后我会发现整个worker队列停止执行,因为所有worker都被锁定了。这是我的worker:classMyWorkerincludeSidekiq::WorkerincludeSidekiq::Status::Workersidekiq_optionsqueue::my_queue,retry:5,timeout:4.minutessidekiq_retry_indo|count|5endsidekiq_retries_exhausteddo|msg|store({message:"Gaveup."})enddefperfor

ruby-on-rails-3 - 从一个 worker 调用多个 sidekiq worker

我必须根据用户的请求运行多个作业。然而,其中只有一个是重要的。所以我有一个MainWorker,在它的perform方法中我调用了不同的其他worker,例如Worker1、Worker2。Worker1和Worker2可以延迟,我需要优先MainWorker。这就是我的perform方法现在的样子classMainWorkerdefperform(user_id)User.find(user_id).main_taskWorker1.perform_async(user_id)Worker2.perform_async(user_id)endend我以后可能会有更多的subworke

ruby-on-rails-3 - 从一个 worker 调用多个 sidekiq worker

我必须根据用户的请求运行多个作业。然而,其中只有一个是重要的。所以我有一个MainWorker,在它的perform方法中我调用了不同的其他worker,例如Worker1、Worker2。Worker1和Worker2可以延迟,我需要优先MainWorker。这就是我的perform方法现在的样子classMainWorkerdefperform(user_id)User.find(user_id).main_taskWorker1.perform_async(user_id)Worker2.perform_async(user_id)endend我以后可能会有更多的subworke

ruby-on-rails - worker 终止后,Heroku cedar stack 上的 Resque worker 计数仍然存在

我已经成功地在herokucedarstack上运行resque并将接口(interface)挂载到rails上。当我启动worker时,一切正常。worker处理工作。但是当我杀死worker时,Resque仍然认为worker可用。当我启动另一个worker时,它认为有2个worker但实际上只有一个在运行。我也注意到这里的表格http://devcenter.heroku.com/articles/psheroku在杀死worker时发送SIGTERM,如果没有终止,则发送SIGKILL。这是我的worker日志2011-08-11T02:32:45+00:00heroku[wo

ruby-on-rails - worker 终止后,Heroku cedar stack 上的 Resque worker 计数仍然存在

我已经成功地在herokucedarstack上运行resque并将接口(interface)挂载到rails上。当我启动worker时,一切正常。worker处理工作。但是当我杀死worker时,Resque仍然认为worker可用。当我启动另一个worker时,它认为有2个worker但实际上只有一个在运行。我也注意到这里的表格http://devcenter.heroku.com/articles/psheroku在杀死worker时发送SIGTERM,如果没有终止,则发送SIGKILL。这是我的worker日志2011-08-11T02:32:45+00:00heroku[wo

lua - Redis 集群 : Find which master holds particular key/slot

我正在使用RedisCluster,一些键有一个特殊的前缀{foo},所以redis将它们放在一个槽中。我这样做是因为我想针对这些key运行一些lua脚本(如果我作为单个实例登录到主服务器,我可以这样做)。在我的设置中,我有3个主控,但不确定如何找到用我的键{foo}持有插槽的主控。*你知道有什么方法可以找到拥有特定key/插槽的主人吗? 最佳答案 我仍然需要阅读整个文档,但已经找到了this:Thereare16384hashslotsinRedisCluster,andtocomputewhatisthehashslotofag

lua - Redis 集群 : Find which master holds particular key/slot

我正在使用RedisCluster,一些键有一个特殊的前缀{foo},所以redis将它们放在一个槽中。我这样做是因为我想针对这些key运行一些lua脚本(如果我作为单个实例登录到主服务器,我可以这样做)。在我的设置中,我有3个主控,但不确定如何找到用我的键{foo}持有插槽的主控。*你知道有什么方法可以找到拥有特定key/插槽的主人吗? 最佳答案 我仍然需要阅读整个文档,但已经找到了this:Thereare16384hashslotsinRedisCluster,andtocomputewhatisthehashslotofag

redis - Redis 3.4及以上版本如何在master/slave config中配置来解决Sentinel running on protected mode的错误?

我正在使用Redis3.2,当从不同的机器连接到sentinel时,我收到以下错误:TryingX.X.X.X...ConnectedtoX.X.X.X.Escapecharacteris'^]'.-DENIEDRedisisrunninginprotectedmodebecauseprotectedmodeisenabled,nobindaddresswasspecified,noauthenticationpasswordisrequestedtoclients.Inthismodeconnectionsareonlyacceptedfromtheloopbackinterface

redis - Redis 3.4及以上版本如何在master/slave config中配置来解决Sentinel running on protected mode的错误?

我正在使用Redis3.2,当从不同的机器连接到sentinel时,我收到以下错误:TryingX.X.X.X...ConnectedtoX.X.X.X.Escapecharacteris'^]'.-DENIEDRedisisrunninginprotectedmodebecauseprotectedmodeisenabled,nobindaddresswasspecified,noauthenticationpasswordisrequestedtoclients.Inthismodeconnectionsareonlyacceptedfromtheloopbackinterface