Ruby GC execution exceeding ~250-320ms per request

前端 未结 4 2017
暗喜
暗喜 2021-02-04 09:18

I have a ruby on rails application. I am investigating an Apdex decline in my NewRelic portal and I\'m seeing that on average, 250-320ms of time is being spent on GC execution.

4条回答
  •  感情败类
    2021-02-04 10:01

    Assuming you are not creating unneeded objects by mistake I heard one hack/solution (besides using JRuby) is to force a GC after finishing sending a response. This way you have the large pause but it is not being seen by the consumer of the request. If you have so much garbage you are seeing multiple pauses like this then you may be out of luck.

    This trick may or may not work for your needs.

    -JRuby guy who talks to people with MRI GC problems :)

提交回复
热议问题