HTTP 请求等待时间较长
我正在使用 cakephp 开发一个网站。我现在正在使用 firebug + Yslow 和 Google Chrome 开发人员工具分析该网站。在 Ajax 请求中,我得到了大约 6 秒的较长等待时间,而接收时间太短(66 毫秒),这导致请求中有很大的延迟。有人知道为什么等待时间太长吗?
I'm working on developing a web site using cakephp. I'm analyzing the website now using firebug + Yslow and Google chrome developer tools. In an Ajax request I get a large waiting time about 6s while the receiving time is too small 66ms which cause a great latency in the request. Does anybody know why the waiting time is too large??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
等待时间 - 从请求时间到收到第一个字节的时间,这涉及一个往返时间。如果您的服务器远离您的计算机,可能会出现延迟。通常需要3个往返。 1 用于 DNS 查找,1 用于建立 TCP 连接,1 用于请求和响应对。
接收时间:如果从服务器下载到客户端的数据量较少,则接收时间会更短。
如需进一步参考:http://www .webperformancematters.com/journal/2007/7/24/latency-bandwidth-and-response-times.html
Waiting time - From the time of request to the time first byte is received, which involves a round trip time. There can be latency if your server away from your machine. Usually it requires 3 round trips. 1 for DNS lookup and 1 for establishing TCP Connection, 1 for request and response pair.
Receiving Time : It will be less if there is less amount of data being downloaded from the server to the client.
For further reference : http://www.webperformancematters.com/journal/2007/7/24/latency-bandwidth-and-response-times.html
我的猜测是,您可能正在执行 SQL 查询,作为通过 Ajax 调用的资源的一部分。如果是这种情况,您可能需要调整查询或索引以提高查询速度。您可以发布一些代码以便我们审查吗?
My guess is that you might be performing a SQL query as part of the resource that you are calling via Ajax. If this is the case, you may need to tune your query or indexes to improve the speed of the query. Can you post some code so we may review?