最近在内网测试阿里云的表格存储功能会时不时出现延迟秒级以上的情况
通过日志查看发现了一些延迟比较高的日志
抓起核心日志信息
TotalTime:1202 {FirstExecution,1592553578139} {IntoHttpAsyncClient,1592553578831} {RequestSent,1592553579259} {ResponseReveived,1592553579314} {Completed,1592553579341} TotalTime:1125 {FirstExecution,1592553578218} {IntoHttpAsyncClient,1592553578831} {RequestSent,1592553579259} {ResponseReveived,1592553579314} {Completed,1592553579343} TotalTime:1393 {FirstExecution,1592553578139} {IntoHttpAsyncClient,1592553578831} {RequestSent,1592553579436} {ResponseReveived,1592553579531} {Completed,1592553579532} TotalTime:1402 {FirstExecution,1592553578218} {IntoHttpAsyncClient,1592553578831} {RequestSent,1592553579448} {ResponseReveived,1592553579613} {Completed,1592553579620}
名词解析
TotalTime: 总耗时
FirstExecution: 首次执行时间戳
IntoHttpAsyncClient: 进入HTTP异步客户端时间戳 (PS:封装请求参数体)
RequestSent: 请求发送时间戳
ResponseReveived: 返回消息接收时间戳
Completed: 请求结束时间戳
对日志进行解析
TotalTime:1402
FirstExecution -> IntoHttpAsyncClient 耗时: 1592553578831 - 1592553578218 = 613 ms
IntoHttpAsyncClient -> RequestSent 耗时: 1592553579448 - 1592553578831 = 617 ms
RequestSent -> ResponseReveived 耗时: 1592553579613 - 1592553579448 = 165 ms
ResponseReveived -> Completed 耗时: 1592553579620 - 1592553579613 = 7 ms
总耗时: 613 + 617 + 165 + 7 = 1402 ms
耗时比较久的主要是在封装请求参数的时候,这种情况就要加大内存了,不然内存太小导致经常gc也会影响请求参数封装的速度