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