gpt4 book ai didi

python - 服务器日志和我的客户端之间的 SOAP 调用执行时间测量差异

转载 作者:太空宇宙 更新时间:2023-11-03 11:20:30 24 4
gpt4 key购买 nike

我正在为特定的 SOAP API 编写客户端。我的执行时间很长,因此联系了 API 所有者,他告诉我:

The average duration calls of GetPrices calls calculated from two sources which store the duration of the calls show a average duration throughout the 5 days that punter was calling our system of just over 25 millseconds which matches the average of most punters during the same time period . The two sources are the Sentry Logs which calculates the duration of the calls between all the application components and the Time taken from the IISLogs which includes the transport time from our API server to the punters calling machine .

对于同一 GetPrices 调用的完全相同的 5 天,我的平均时间为 0.08-0.1 秒,比服务器日志显示的时间长 4 倍。

我的测量值与 API 所有者的测量值之间存在如此大差异的原因可能是什么?

我衡量执行时间的方法非常简单:

start_time = time.time()
# GetPrices call
end_time = time.time() - start_time

如果还有什么我可以提供的,请告诉我。

最佳答案

考虑下表。
简而言之,您正在考虑服务器工作负载,而服务器没有。

client                      server
start timing
client get (small data) -> server receive request
<- server ack request start timing
client receive ack
client waiting response server workload to create response
<- server response (big data)
client receive response
client ack response -> server stop timing
client workload parsing response
client stop timing

如果您能够在ack 点开始/停止计时,您的计时差异就会变小。

关于python - 服务器日志和我的客户端之间的 SOAP 调用执行时间测量差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43811144/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com