性能采样命令
性能采样命令
性能采样功能可以检测 Dubbo 处理链路各部分的时间消耗。当发生超时时,如果 ( usageTime / timeout > profilerWarnPercent * 100 )
,则会通过日志记录调用的时间消耗。
此功能分为 simple profiler
和 detail profiler
两种模式,其中默认启用 simple profiler
模式,默认禁用 detail profiler
模式。与 simple profiler
模式相比,detail profiler
会收集每个过滤器、具体耗时协议等更多的时间消耗处理。在 simple profiler
模式下,如果发现 Dubbo 框架内部存在长时间消耗的情况,可以启用 detail profiler
模式,以便更好地排查问题。
参考链接:请求耗时采样
enableSimpleProfiler 命令
启用 simple profiler
模式,默认启用
dubbo>enableSimpleProfiler
OK
dubbo>
disableSimpleProfiler 命令
关闭 simple profiler
模式,关闭后将不会启用 detail profiler
dubbo>disableSimpleProfiler
OK
dubbo>
enableDetailProfiler 命令
启用 detail profiler
模式,默认禁用,需要启用 simple profiler
模式才能真正启用
dubbo>enableDetailProfiler
OK. This will cause performance degradation, please be careful!
dubbo>
disableDetailProfiler 命令
关闭 detail profiler
模式,不会影响 simple profiler
dubbo>disableDetailProfiler
OK
dubbo>
setProfilerWarnPercent 命令
设置超时的警告百分比
命令:setProfilerWarnPercent {profilerWarnPercent}
profilerWarnPercent:超时时间的警告百分比,取值范围为 0.0 ~ 1.0,默认值为 0.75
dubbo>setProfilerWarnPercent 0.75
OK
dubbo>
最后修改时间:2023 年 1 月 2 日:增强英文文档 (#1798) (95a9f4f6c1c)