防止和模拟数据中心中断
最近我使用的数据中心发生了故障。 在中断期间,使用我的服务的客户报告说他们的网站速度非常慢。 客户在两个地方集成了我的服务: 1. 网页中的脚本标签指向我的服务器。 2. 使用 php 对我的服务器进行 API 调用: fputs($fp, "POST $path HTTP/1.1\r\n"); ... Stream_set_timeout($fp, 10); $结果 = fread($fp, 2000); ...
当数据中心或我的服务器出现故障时,如何保护网站免受影响? 如何模拟数据中心中断以便添加解决方案?
谢谢
Recently the data center I'm using experienced an outage.
During the outage customers using my service reported that their websites were very slow.
The customers integrate my service in two places:
1. A script tag in web pages that pointing to my server.
2. making API calls against my server with php:
fputs($fp, "POST $path HTTP/1.1\r\n");
...
stream_set_timeout($fp, 10);
$result = fread($fp, 2000);
...
How can I protect websites from being affected when the data-center or my server are down?
How can I simulate a data center outage so I can add a solution?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们使用 Amazon Web Services 来实现良好的停机保护。
它们提供多个可用区(=物理上不同的数据中心,不太可能都受到相同条件的影响)。我们的应用程序服务器设置在多个区域中,并使用负载均衡器将请求转发到所有服务器。
如果某些服务器变得无响应,负载均衡器将不再将流量路由到它们(它还会定期检查它们是否恢复)。
如果负载均衡器发生故障(我们的监控软件告诉我们这一点),我们会切换弹性 IP 负载均衡器的地址到另一个负载均衡器。
We use Amazon Web Services to achieve good protection from an outage.
They offer multiple availability zones (=physically different data centers that are unlikely to all be affected by the same condition). Our application servers are setup in multiple zones, with a load balancer forwarding requests to all of the servers.
If some of the servers become unresponsive, the load balancer will no longer route traffic to them (it also periodically checks if they come back up).
If there is an outage of the load balancer (our monitoring software tells us that), we switch the elastic IP address of the load balancer to another load balancer.