Reputation: 17920
We're running a production system on Crystal/Kemal. The calling service sees quite often a Connection refused error. I was wondering how can I see more insights/metrics into a running instance of HTTP::Server/Kemal. I'm referring to the number of fibers running/waiting (out of the maximum number allowed), how large is the backlog of connections, how many have been refused and so on.
Upvotes: 2
Views: 131
Reputation: 4440
Built-in tools: crystal tool -h
context show context for given location
expand show macro expansion for given location
format format project, directories and/or files
hierarchy show type hierarchy
implementations show implementations for given call in location
types show type of main variables
Common tools:
lsof +p $(pidof <process_name>)
— display connections/socket for process.ss -ier
— display internal socket stats.strace -p $(pidof <process_name>) -s 300 -yyfq
— useful tool for process introspection.tcpdump & wireshark
— dump and explore network packetsngrep
— like grep but for network packets.LLDB
— native debugger for LLVM-based app (tutorial)CodeLLDB
— Native VSCode debugger based on LLDB.And don't forget crystal build ./app.cr --debug
Upvotes: 1