【发布时间】:2020-08-03 15:54:01
【问题描述】:
我们正在 Crystal/Kemal 上运行一个生产系统。调用服务经常看到连接被拒绝错误。我想知道如何才能在 HTTP::Server/Kemal 的运行实例中看到更多见解/指标。我指的是运行/等待的光纤数量(超出允许的最大数量),连接的积压有多大,有多少被拒绝等等。
【问题讨论】:
-
您使用的是 SSL 服务器吗?
标签: crystal-lang kemal
我们正在 Crystal/Kemal 上运行一个生产系统。调用服务经常看到连接被拒绝错误。我想知道如何才能在 HTTP::Server/Kemal 的运行实例中看到更多见解/指标。我指的是运行/等待的光纤数量(超出允许的最大数量),连接的积压有多大,有多少被拒绝等等。
【问题讨论】:
标签: crystal-lang kemal
内置工具: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
常用工具:
lsof +p $(pidof <process_name>) — 显示进程的连接/套接字。ss -ier — 显示内部套接字统计信息。strace -p $(pidof <process_name>) -s 300 -yyfq — 流程自省的有用工具。tcpdump & wireshark — 转储和探索网络数据包ngrep — 类似于 grep,但用于网络数据包。LLDB — 基于 LLVM 的应用程序的本机调试器 (tutorial)CodeLLDB — 基于 LLDB 的原生 VSCode 调试器。别忘了crystal build ./app.cr --debug
【讨论】: