对服务器和 VPS 与专用服务器进行压力测试

发布于 2024-07-22 06:20:50 字数 387 浏览 8 评论 0原文

我们曾经有一台专用服务器(1&1),并且很少遇到服务器出现问题的情况。

最近,我们迁移到了与我们旧的专用服务器具有相似规格的 VPS (Wiredtree.com),但注意到频繁出现内存不足、mysql 必须重新启动等问题...无论是在故意运行密集脚本时还是在随机运行期间正常使用。

因此,我们正在考虑迁移到另一个 VPS - 这次是 Slicehost,看看它的性能是否更好。

我的问题有两个......

他们是否可以直接对 Slicehost 上的 VPS 进行压力测试,看看是否会出现相同的问题,而无需实际迁移所有内容?

另外,我们面临的问题是否可能不仅仅是因为提供商(Wiredtree)而只是专用盒子和 VPS 之间的差异(尽管具有相似的规格)?

We used to have a dedicated server (1&1) and very infrequently ran into problems with the server having issues.

Recently, we migrated to a VPS (Wiredtree.com) with similar specs to our old dedicated server, but notice frequent problems running out of memory, mysql having to restart, etc... both when knowingly running intensive scrips and also just randomly during normal use.

Because of this, we're considering migrating to another at VPS - this time at Slicehost to see if it performs better.

My question is two fold...

Are their straightforward ways we could stress test a VPS at Slicehost to see if the same issues occur without having to actually migrate everything over?

Also, is it possible that the issues we're facing aren't just because of the provider (Wiredtree) but just the difference between a dedicated box and VPS (despite having similar specs)?

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

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

发布评论

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

评论(1

牛↙奶布丁 2024-07-29 06:20:50

对环境进行压力测试的最佳方法是将其置于负载下。 如果此 VPS 托管 Web 应用程序,请使用众多可用的 Web 服务器基准测试工具之一:abhttperf围攻http_load。 您不一定关心工具本身的统计数据,但更关心它在服务器上施加可预测的负载,以便您可以调整 Apache 来处理它,或者至少不会崩溃。

针对 Slicehost 进行测试时遇到的一个问题是,您受到 Internet 和 Slicehost 带宽的支配。 您可能无法在服务器上施加足够的负载来得出有意义的结论。

相反,您可能会发现运行市场上众多虚拟化产品之一并设置与您正在考虑的 VPS 计划具有相当规格的虚拟机同样有价值。 通过 LAN 进行本地测试将允许您在服务器上施加更高且更可预测的负载。

无论哪种情况,您都不需要迁移所有内容,但需要为应用程序的运行设置一个环境,并在数据库中包含代表性数据。

与专用服务器具有相似规格的 VPS 的性能应该大致相同,但为了获得良好的性能,您仍然需要调整 Apache、MySQL 和任何其他长期存在的服务器进程。 根据我的经验,许多 Linux 发行版中 Apache 的开箱即用配置并不理想,并且会允许过多的子进程、过度使用内存并使服务器陷入交换死亡螺旋。

The best way to stress test an environment is to put it under load. If this VPS is hosting a web application, use one of the many available web server benchmark tools: ab, httperf, Siege or http_load. You don't necessarily care that much about the statistics from the tool itself, but more that it puts a predictable load on the server so that you can tune Apache to handle it, or at least not crash and burn.

The one problem you have with testing against Slicehost is that you are at the mercy of the Internet and your bandwidth to Slicehost. You may not be able to put enough load on the server to reach a meaningful conclusion.

Instead, you might find it just as valuable to run one of the many virtualization products on the market and set up a VM with comparable specs to the VPS plan you're considering. Local testing over your LAN will allow you to put a higher and more predictable load on the server.

In either case, you don't need to migrate everything, but you will need to set up an environment for your application to run in, with representative data in your database.

A VPS with similar specs to a dedicated server should perform approximately the same, but in order to get good performance, you still need to tune Apache, MySQL and any other long-lived server processes. In my experience, the out-of-the-box configuration of Apache in many Linux distributions is not ideal and will allow far too many child processes, overcommitting memory and sending the server into a swap-death spiral.

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