[erlang-questions] Diagnosing gen_server call timeouts

Roger Lipscombe roger@REDACTED
Thu Sep 19 19:33:23 CEST 2019


I've got a gen_server:call that -- very occasionally -- suffers from a
timeout. Obviously this means that my gen_server is already busy doing
something else.

Is there a way that I can instrument gen_server so that it will log
something if it takes too long to return from a callback? That is: my
handle_call is timing out because, presumably, there's another
handle_call (or handle_info, etc.) that's blocking. I'd like *that* to
be logged if it takes longer than, say, 200 milliseconds to return.

Or, I guess, if the message queue length is excessive at any point.

Caveat: I've got ~20,000 of these gen_server processes, and this only
happens intermittently in production, so I'm thinking that tracing
*isn't* the right answer here.



More information about the erlang-questions mailing list