gpt4 book ai didi

ruby-on-rails - 由于 brpop,Rails Sidekiq Redis 长时间运行

转载 作者:行者123 更新时间:2023-12-04 03:50:24 26 4
gpt4 key购买 nike

使用 Sidekiq 对新的 Ruby on Rails 应用程序进行 Newrelic 监控,尚未实现的逻辑和流量表明 Redis 在 brpop 上花费了很长时间(大约 2s-3s)操作。

这是为什么?

这是性能方面的问题吗?

最佳答案

根据本期信息
https://github.com/mperham/sidekiq/issues/2581这是 Sidekiq 的正常行为:

@jonhyman评论

brpop is a blocking command, too, so if you don't have a lot of jobs then each one will block for 1 second.



@ryansch评论:

You want that behavior. That's what sidekiq is doing while it's waiting for work. It's a long running blocking operation because redis can then tell sidekiq about work as soon as it arrives. The alternative would be polling which we certainly don't want. I see the same thing in my new relic dashboard. No worries.



所以不,这不是问题。 Sidekiq 实际上是想变得更足智多谋,让 Redis 做一些肮脏的工作,即通过在该 brpop 上保持连接来让他知道什么时候有新任务。手术

关于ruby-on-rails - 由于 brpop,Rails Sidekiq Redis 长时间运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38147896/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com