
1 connor123 2023-12-20 14:05:54 +08:00 反序列化慢?我觉得是不是一次反序列化数据太多了,先用 10 条试试看 |
2 Morriaty 2023-12-20 14:22:40 +08:00 The time reported by elasticsearch in the "took" field is the time that it took elasticsearch to process the query on its side. It doesn't include - serializing the request into JSON on the client - sending the request over the network - deserializing the request from JSON on the server - serializing the response into JSON on the server - sending the response over the network - deserializing the response from JSON on the client |
3 lvtuyukuai 2023-12-20 14:25:43 +08:00 took time 应该是表示 elasticsearch 服务器端的执行时间,看起来比较稳定。 execution time 大致可以表示:组装请求 + 发送 http 请求到 es + took time + 从 es 接收 http 响应 + 解析响应 所以问题可能是在 「发送 http 请求到 es 、从 es 接收 http 响应」(网络不稳定?)、解析响应(响应内容太大?) |
4 lvtuyukuai 2023-12-20 14:26:23 +08:00 好吧,跟二楼重复了,回复前没刷新 |
5 zshineee OP @connor123 @lvtuyukuai @Morriaty 调整了下 size ,10 条好像没什么问题,1000 条偶尔会出现问题 然后试了下 scroll api ,发现 size 是 10 、100 时,took 时长和 execution 时长都会出现 800 多 ms |
6 lvtuyukuai 2023-12-20 1804:38 +08:00 scroll api 时,是首次请求以及之后使用 scrollId 调用都是 800 多 ms 吗?需要注意的是,使用 scroll api 时,那个 size 是每一页(每次滚动请求)返回的结果文档数目,而不是总共要返回的文档数目 |
7 Aresxue 2023-12-26 10:10:55 +08:00 应该不是服务端问题 ,用 arthas trace 一下看看,实际中 es 的连接数、反序列化都会影响最终的性能。 |