jeudi 16 juillet 2015

Why would I see ActionDispatch::Routing::RouteSet#call slowness?

Looking at my New Relic data for my Heroku app, there's one transaction that's puzzling me. It's the only one where ActionDispatch::Routing::RouteSet#call appears in the trace. It takes up about 30% of the time on a very frequent action, so I'd like to speed it up, or at least understand what it does.

http://ift.tt/1e37ay9

Also weird is that every now and then, it takes a REALLY long time:

http://ift.tt/1M8cmPh

I've asked myself, "What is different about this particular request?" The controller action is pretty normal -- and the fact that the slow-down is in Middleware makes me think that the controller code isn't relevant. (Can someone confirm that?) The only thing that I can think of is that this particular action uses non-integer resource IDs: e.g /action_name/some-id-with-dashes. It's the only action in my app that does this. Is it possible that this can be the cause? What does ActionDispatch::Routing::RouteSet#call do anyway? Are there any theories that someone can give me to point me in a fruitful direction?

I'll sum that all up in a single question: What could be different about a single rails action such that one would see slowness with ActionDispatch::Routing::RouteSet#call in its trace?

PRIOR RESEARCH

I found other (unanswered) SO questions on the topic. But I decided to open a separate question because some of the details differed in my case. Listing them here:

1) Similar, but ActionDispatch::Routing::RouteSet#call is listed in New Relic as a transaction, whereas for me it is a segment within a transaction:

ActionDispatch::Routing::RouteSet#call Rails 4.1 really slow

2) Similar, but involves Rails 4 and also the slowdown they are experiencing is way larger than mine and seems to be "memory related", whereas my app's memory use seems fine:

Slow action in Rails application: ActionDispatch::Routing::RouteSet#call

3) Similar, but I don't know what "Grape" is (and I'm not using it):

Why ActionDispatch::Routing::RouteSet takes so long

4) Might be the same issue, but there aren't a lot of details, just that ActionDispatch::Routing::RouteSet#call is sometimes slow:

ActionDispatch::Routing::RouteSet intermittently takes too long to route requests

Aucun commentaire:

Enregistrer un commentaire