城市间站点性能缓慢的主要因素有哪些
问:
我有一个在服务器上发布的 Web 应用程序。当我尝试来自另一个城市的 Web 应用程序时。性能太差了,一切都很慢。
我应该对我的代码进行任何增强吗?或者这主要与网络因素有关?
有什么建议请。
Error/Status Code: 200
Start Offset: 0.194 s
Initial Connection: 193 ms
Time to First Byte: 286 ms
Content Download: 1286 ms
Bytes In (downloaded): 48.6 KB
Bytes Out (uploaded): 0.4 KB
Request Headers:
GET /sch/ScheduleForm.aspx HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 PTST/25
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Response Headers:
HTTP/1.1 200 OK
Date: Wed, 21 Dec 2011 15:17:00 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Set-Cookie: ASP.NET_SessionId=ane2ncmyyoqwckjmv4bijq45; path=/; HttpOnly
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 4938
Q:
I have a web application which published on a server .When i try the web application from another city. the performance is so bad and every thing is slow.
Should i make any enhancement to my code or this is related mostly to the network factors?
Any advices please.
Error/Status Code: 200
Start Offset: 0.194 s
Initial Connection: 193 ms
Time to First Byte: 286 ms
Content Download: 1286 ms
Bytes In (downloaded): 48.6 KB
Bytes Out (uploaded): 0.4 KB
Request Headers:
GET /sch/ScheduleForm.aspx HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 PTST/25
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Response Headers:
HTTP/1.1 200 OK
Date: Wed, 21 Dec 2011 15:17:00 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Set-Cookie: ASP.NET_SessionId=ane2ncmyyoqwckjmv4bijq45; path=/; HttpOnly
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 4938
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,您必须确定延迟是否是由于网络造成的,或者是服务器本身造成的,或者是客户端计算机造成的,或者是由于服务器本身造成的。您的页面设计。
很少有性能不好的情况只是因为你换了城市,也许另一台计算机连接速度慢或配置不好,或者ISP不好,你发现速度很慢。
客户端快速检查
快速检查网络响应的更快方法是 ping 您的站点,打开命令提示符窗口,然后输入“
ping www.yoursite.com /t
”并查看时间。如果您的服务器位于同一个国家,则必须低于 50 毫秒。网络 - 页面设计
现在是全局检查的第二点。您可以使用此网站
http://www.webpagetest.org/
来检查您的页面的全球速度,并得到非常有趣的结果,作为时间响应。
服务器
总有这样的情况,您将站点放置在多用途/共享计算机上,有数千个站点且配置错误,因此在高峰时间服务器性能很差。我已经看到这种情况发生很多次了。
你的网络应用程序
如果网站与开发计算机相比速度很慢,那么就是以太,因为现场有一个巨大的数据库,你没有检查,以太是因为黑客发现了后门,并通过创建空帐户作为攻击,或者其他什么方式进行攻击相似的。这取决于您来确定延迟是否是由于程序内的调用造成的。
造成延迟的原因还有更多
另请注意,使用 Chrome、Mozilla、Opera 和 Safari 上现有的工具来查看页面加载时网站的时间响应。
希望这有帮助。
First of all you must find if the delay is because of the network, or by the server it self, or by the Client Computer or by your page design.
Its rare to have bad performance only because you change city, maybe the other computer have slow connection or bad configuration, or bad isp and you see that slow.
Client Quick Check
The faster way to a quick check of the network responce is to ping your site, open a command promt window and just write "
ping www.yoursite.com /t
" and see the time. And if your server is on the same country must be under 50ms.Network - Page design
Now second point of a global check. You can use this site
http://www.webpagetest.org/
to check the speed of your page globally, and get very interesting results, as the time response.
Server
There always the case that you have place your site on a multi use/shared computer, with thousand of sites and bad configuration, so on peak time the server performs badly. I have see this happens a lot of times.
Your Web Application
If the site is slow compare with the development computer then is ether because live have a huge database that you do not have check, ether because a hacker have found a back door and is attacking by making empty accounts as attack, or something similar. This is up to you to find if the delay is because of your calls inside your program.
And more reasons for that delay exist
One more note, use the tools that exist on Chrome, Mozilla, Opera and Safari to see the time response of your site when your page load.
Hope this helps.
最好的起点是找出速度问题的根源。尝试使用 Firebug/Chrome 调试工具来查看服务器上是否占用了时间(即向您发送网站的第一个字节),或者是否只是简单的旧加载时间(例如图像需要很长时间)。
如果它在服务器上,那么您可能会遇到一些架构/编码问题,如果只是内容的交付时间,那么您就会遇到网络/内容问题(使用 GZip 压缩内容,使用 PNGOUT 优化 png 之类的问题)。
祝你好运 :)
Your best starting point would be to find out where the speed issue is coming from. Try Firebug/Chrome debugging tools to see if the time is being taken on the server (ie sending you the first byte of the website) or if it's just plain old loading time (eg images take a long time).
If it's on the server then you have potentially some architectural/coding issues, if it's just delivery time of content then you have network/content issues (compress content with GZip, optimise pngs with PNGOUT that sort of thing).
Good luck :)
这在很大程度上取决于两个城市的地理位置。如果这两个城市很近,您很可能不会注意到任何差异。
如果城市位于不同的大陆,您可能会注意到某些延迟问题。
如果您遇到延迟问题,您无法仅通过调整代码来解决它们。您需要做一些事情,例如地理负载平衡和在不同位置托管不同服务器。
例如,Facebook 有多个数据中心。例如,一个在西海岸,一个在东海岸,我认为他们在欧洲也有一个。根据您来自哪个位置,请求将被转发到最近的数据中心。
That depends heavily how the geographical location of the two cities is. If the two cities are nearby you will most likely not notice any difference.
If the cities are on different continents you may notice for sure latency issues.
If you have latency issues you can not solve them solely by adjusting your code. You need to do something like e.g. geographical load balancing and hosting different servers at different locations.
Facebook e.g. has multiple data centres.. e.g. one at the West-Coast one on the East-Coast and i think they have one in Europe as well. Depending from which location you come from requests are forwarded to the nearest data centre.