Often times my Sidekiq jobs will be running for greater than 1 minute. I've tried to debug by sending the Sidekiq process a TTIN
signal but I don't see anything being logged. My intuition is that it's a network request that's making it hang but I'm making use of timeouts on all network requests to address this already.
Any suggestions? Thanks!
You can use the benchmark module https://ruby-doc.org/stdlib-1.9.3/libdoc/benchmark/rdoc/Benchmark.html
You can then save the report to a log file.
You are asking how to profile and tune slow Ruby code.
RubyProf.profile do
MyJob.new.perform(...)
end
Output the report and review it to find where the code is slow.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.