最近我的网站速度很慢,并且我在浏览器中收到超时消息 - 出了什么问题?
我如何诊断我的网站的超时问题和页面加载缓慢,我在 firefox 中有 ySlow 插件,它显示大多数页面的 A/B 等级,所以我希望页面加载速度很快。我应该联系我的托管公司吗?我从哪家公司购买了域名?目前服务器上没有太多负载,我正在使用 v.fast 连接来连接到互联网。
从哪里开始比较好?当我们开始看到更多流量时,我该如何监控?托管公司应该这样做吗?
How can I diagnose timeout problems and slow page loading with my site, I have ySlow plugin in firefox and it shows that grade A/B for most pages so i would expect pages to load quickly. Should I contact my hosting company? The company I bought my domain name from? There is not much load on the server at present and I am using a v. fast connection to connect to the internet.
wheres a good place to start? How can i monitor this when we start seeing more traffic? Should hosting company be doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
第一步是确定问题是客户端还是服务器端。
良好的 YSlow 等级表明问题可能不在客户端。 YSlow 检查页面上是否有太多对象,是否缩小了 javascript/CSS 等。它不会评估网络或服务器的性能。
使用 YSlow/Firebug 检查加载页面的实际 HTML 需要多长时间。如果这需要很长时间,那么问题几乎肯定出在您的服务器、网络或服务器端代码上。
要排除网络问题,请将从服务器本身访问您的网站与通过互联网访问网站进行比较。如果互联网上的速度慢很多,则问题可能与网络有关。
如果它与客户端或网络无关,那么要么是您的服务器正在努力获取资源,要么是您的代码速度缓慢(可能是因为它管理的数据量增加了)。在这种情况下,请检查服务器日志并在您的代码上运行探查器(在开发服务器上,但带有生产数据的副本)。
The first step is to establish whether the problem is client-side or server-side.
A good YSlow grade indicates the problem probably isn't clientside. YSlow checks to see that you don't have too many objects on the page, that you have minified your javascript/CSS etc. It does not evaluate the performance of your network or server.
Using YSlow/Firebug, check to see how long it takes to load the actual HTML of your page. If that is taking a long time, then the problem is almost certainly with your server, network or server-side code.
To rule out network issues, compare accessing your site from the server itself to accessing it over the internet. If it's a lot slower over the internet the problem could be network-related.
If it's not client-side or network-related, then it's either that your server is struggling for resources or that your code is slow (perhaps because the amount of data it is mananaging has grown).In that case, check the server logs and run a profiler on your code (on a development server but with a copy of production data).
像 YSlow 这样的工具会指出一些优化的机会,但它们不会实际衡量性能,也不会考虑事情发生需要多长时间。
尝试像 WebPagetest 这样的东西,它会给你一个页面加载的浏览器视图,你可以通过瀑布来工作看看时间都去哪儿了。
如果您看到超时,那么这可能是后端问题(在瀑布中会非常清楚),您将需要检测您的服务器以找出时间的去向。如果它是专用服务器或 VPS,那么您可以安装 New Relic 之类的东西,它会很快指出问题。如果您使用共享主机,那么您将必须直接向您的应用程序添加日志记录(如果您运行的是 Wordpress 之类的东西,则有一些插件可以执行此操作)。
Tools like YSlow will point out some opportunities for optimization but they don't acrually measure performance and they don't look at how long it takes for things to happen.
Try something like WebPagetest which will give you a browser-view of the page loading and you can work through the waterfall to see where the time is going.
If you are seeing timeouts then it's probably a back-end problem (will be pretty clear in the waterfall) and you're going to need to instrument your server to figure out where the time is going. If it's a dedicated server or VPS then you can install something like New Relic and it will point out the problem pretty quickly. If you are on shared hosting then you're going to have to add logging to your app directly (there are plugins that can do this if you are running something like Wordpress).
首先要查看的地方是服务器日志,它应该为您提供有关正在发生的情况以及请求通常花费多长时间的线索。
如果服务器返回正常,并且页面由于客户端代码而花费很长时间,您可能需要使用 Firebug 配置文件来分析您的页面并了解更多信息。
希望这有帮助。
The first place to look would be the server logs , that should provide you a clue as to what is happening and how much time a request is taking in general .
If the server is returning fine and the page is taking long because of client side code , you might want to use the Firebug profile to profile your page and find out more .
Hope this helps .
您想要加载哪种页面?纯 html 还是 PHP 之类的脚本?如果是纯 html,我猜它是你的托管公司。
Want kind of pages are you trying to load? Plain html or scripts like PHP? If plain html I guess its your hosting company.