I’m debugging a slow method in my Rails app
I’ve this execution trace from datadog
Any idea what’s the blanks mean in
- beginning of method execution (almost 1s)
- between sql queries
I’m debugging a slow method in my Rails app
I’ve this execution trace from datadog
Any idea what’s the blanks mean in
I’m no expert on datadog visualizations, but usually this kind of thing means “the code that’s directly in the send_message
method”. Since I don’t see any sub-methods in this graphic, this could also mean “any ruby code that runs prior to the first SELECT
”.
On another note, it’s always a red flag when SQL queries take hundreds of milliseconds. I would suggest checking what’s wrong with the database/tables, perhaps some indexes are missing. Hundreds of milliseconds in a db doesn’t just lead to slower responses in this particular method, it slows down everything else the db is trying to do at the same time, which makes it harder to find the source of slowness. So it has a pretty devastating effect overall, unless this is some kind of rare background job. (Which from the name of it, it doesn’t seem to be).
It could also be that something else that runs occasionally is slowing down your whole database and affecting methods like this one.