CPU context switch between rails before_action and action code

52 views Asked by At

New Relic trace instance for reference

While looking at traces of slow response time (3.1s) of a generally fast API(50ms average, 200ms at 99%ile), I found this weird behaviour where there is no execution for almost 2.9s after the before_action callback. Any idea why this would be happening?

Expected that there would be a trace of execution for the whole 3.1 seconds, but the majority of the execution time, this process seems to be waiting for CPU.

0

There are 0 answers