关于加载缓慢的网站/服务器的建议

发布于 2024-10-18 06:50:49 字数 417 浏览 1 评论 0 原文

我们有一个云托管帐户,为我们提供 2GB 内存和 3GHZ 处理器,使用 cpanel 和 centos 作为操作系统。我们遇到的问题是页面加载速度似乎很慢,而且不仅仅是我们遇到的问题。其他人提到它很慢。但我们只有一个 Web 应用程序,负载几乎为零,并且超过 1 GB 的内存显示仍然可用。 Web 应用程序使用我们在 themeforest 购买的主题,它有大量的 css 样式和用于弯角、阴影等的 javascript。我想知道模板本身是否导致速度缓慢,因为它通过浏览器进行了大量渲染?在桌面上看起来比在 iPad 上更快。

是否有任何工具可以确定任何潜在的加载问题?我们再次观察人们使用它时的平均负载,并且从一个页面到另一个页面单击几乎没有任何负载,似乎需要几秒钟的时间来渲染。页面大小显示低于 2kb。当 ping 服务器时,其范围为 70-90 毫秒,并且需要 10-12 跳。有什么建议吗?

We have a cloud hosting account that gives us 2GB of memory and 3GHZ processor using cpanel and centos as the OS. The problem we are having is pages seem to load slow and not just for us. Others have mentioned its slow. But we only have one web application and the load is almost at zero with over a gig of memory showing still available. The web application uses a theme we bought at themeforest and it has a ton of css styling and javascript for curved corners, drop shadow etc. Im wondering if the template itself is causing the slowness because of it doing a lot of rendering via the browser? It seems faster on a desktop than on an ipad.

Is there any tools to determine any potential loading issues? Again we watch the load average while people use it and there is hardly any load yet from clicking from page to page it seems to take a few seconds to render. The page size shows under 2kb. When pinging the server it ranges 70-90ms and it takes 10-12 hops. Any suggestions at all?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

巾帼英雄 2024-10-25 06:50:49

FireBug Net 面板是诊断瓶颈的绝佳工具。观察时间线——服务器是否需要很长时间才能响应?我们是否等待资源很长时间?或者我们是否立即获得了所需的一切,但在页面准备好之前仍然有很长的延迟? (这意味着我们在客户端存在性能问题。)

某些资源是否不必要地阻塞了其他资源?请务必将 CSS 和 Javascript 包含在正确的位置。这似乎是罪魁祸首。 (请参阅 YahooGoogle 并获取关联的 Google Page Speed 和 Yahoo YSlow Firebug 插件。

)有很多图像、CSS 和 JavaScript 文件吗?也许瓶颈是每个主机名的连接数。 (请参阅browserscope.org。)要检查这一点,请打开“Net” Firebug 中的面板。清除浏览器缓存并加载页面。正在下载多少文件?

与 CSS 相比,阻止下载和网络瓶颈更有可能是罪魁祸首。不过,花哨的 Javascript 效果肯定会减慢你的速度。

要查看 CSS 或 Javascript 渲染是否会减慢您的速度,请尝试有选择地禁用它们并浏览您的网站。您可以使用 WebDeveloper 插件来完成此操作。

影响客户端渲染速度的其他因素包括CSS 选择器的效率以及页面中的元素。

var count = document.getElementsByTagName('*').length;
alert('The page has '+count+' elements.');

大量元素也会减慢 Javascript 的执行速度。

A fantastic tool for diagnosing your bottleneck is the FireBug Net panel. Watch the timeline -- does the server take a long time to respond? Are we waiting a long time for resources? Or do we get everything we need right away, but there's still a long delay before the page is ready? (That would mean we have a performance issue on the client side.)

Are some resources blocking others unnecessarily? Be sure to include your CSS and Javascript in the right places. This seems a likely culprit. (See the performance tips from Yahoo and Google and get the associated Google Page Speed and Yahoo YSlow addons for Firebug.)

Are there lots of images, CSS and JavaScript files? Maybe the bottleneck is the number of connections per hostname. (See browserscope.org.) To check this, open the "Net" panel in Firebug. Clear your browser cache and load your page. How many files are being downloaded?

Blocking downloads and network bottlenecks are more likely culprits than CSS. Fancy Javascript effects could certainly slow you down, though.

To see if the CSS or Javascript rendering is slowing you down, try selectively disabling them and browsing your site. You can do this with the WebDeveloper addon.

Other factors in client rendering speed are the efficiency of the CSS selectors and the number of elements in your page.

var count = document.getElementsByTagName('*').length;
alert('The page has '+count+' elements.');

A large number of elements slows down Javascript execution, as well.

命硬 2024-10-25 06:50:49

在我看来,你没有获得专用的 2GB 内存和 3Ghz 处理器。您可能正在与许多其他网站共享这些资源。您使用什么托管服务提供商?

另外,您的浏览器在页面加载时是否冻结?例如,如果在页面加载时将鼠标悬停在“后退”按钮上,该按钮是否会弹出?如果浏览器在页面加载时冻结,则表明页面本身存在问题。

Sounds to me like you're not getting a dedicated 2GB of memory and 3Ghz processor. You're probably sharing those resources with a number of other sites. What hosting provider are you using?

Also, does your browser freeze while the page loads? For example, if you hover the mouse over the Back button while the page loads, does the button pop up? If the browser freezes while the page loads, then that points to issues with the page itself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文