It turned out that our problem was caused by the presence of our own custom handlers, Resque.before_fork and Resque.after_fork .
The NewRelic RPM will automatically set the hooks using Resque.before_fork and Resque.after_fork to establish a communication channel for workers. As a restriction to Resque, it only runs the last assigned / Proc block for hook_name and after_fork. Thus, if you have your own custom bindings before_fork / after_fork, you must * configure the agentβs communication channel manually, for example. in config / initializers / custom_resque.rb file:
Resque.before_fork do |job| NewRelic::Agent.register_report_channel(job.object_id)
This code is directly taken from the gem RPM file gems/newrelic_rpm-3.5.0/lib/new_relic/agent/instrumentation/resque.rb
RPM error update 12/27/2012:. After deploying the above methodology, we found that when using in a branched mode (for example, Resque) when accessing the RPM file, a file leak occurs. We have seen error messages like ActiveRecord::StatementInvalid: ArgumentError: too large fdsets: SET client_min_messages TO '' . After repeated searches, we found that this was because ActiveRecord was trying to open a database connection and could not, because the number of file descriptors was exhausted. A new relic has confirmed that an error occurs when questioning the plan of explanation. This happens when many Resque jobs are running that connect to the database.
Error update 1/28/2013: After a multiple head failure, we found out that this error was caused by an unsupported interaction with resque-lonely_job , which uses the Resque before_perform hook, which can stop the Resque job with the exception of Resque::Job::DontPerform . The RPM client does not properly clean up file leaks in this situation. The new Relic has been informed and is working on a fix.
Error Update 4/10/2013: This is fixed. We use 3.6.0.78, and it handles this case. No file descriptor leaks! Thank you, New Relic.
Wolfram arnold
source share