Can my site afford more than 30 visitors at the same time?

Avatar
  • Answered
Hello Team, I'm using your POWER hosting plan. I am going to participate in a promotion and there would be 50,000 - 120,000 visitors in 24 hours by then. This means there might be hundreds (or more) of concurrent visitors online at the same time. The visitors will be asked to fill in a form and then the page will return a few sentences.

Our website is a statics html site but we are considering to use PHP+SQL on the promotion page. After the visitor has filled in the form, the form will be saved into SQL's database online. I have asked for help from your SUPPORT CHAT several hours ago, and they told me that the concurrent connections cannot be larger than 30.

My first question is: what will happen if the concurrent connections were larger than 30? The exceeded connection will queue up until the form has been saved into database, or it will return a permanent error, or even the database will just down for hours from work?

Another question: apart from saving the form into database, we can also enclose the form to an email and send it to our Gmail account. For example the CONTACT page of our site: http://www.athtek.com/contact.php . The question is, when there are hundreds of concurrent visitors trying to enclose the forms into emails and send them to us at the same time, can the mail server afford that? The total email quantity maybe reaches 100,000 in 24 hours. Will our email account be banned on your side?

Additionally, can I buy that server service from you which can extend the max concurrent connections to 100+, or enable our mail server to process more than 100,000 emails in 24 hours?

Thanks.
Avatar
JacobIMH
Hello AthTek, and thank you for your question. Based off your estimate of there possibly being as many as 120,000 visitors in a 24 hour period, that would break-down to roughly 5,000 unique visits an hour. Although more than likely those visits would stack up more around common hours, so you would more than likely have in the tens of thousands of visitors in an hour long period. On a shared server handling this type of traffic to a static HTML page it should probably be OK in the event that they aren't filling up the raw Apache connections with all their requests. Trying to handle that amount of traffic with dynamic scripts on a shared server though would be much different and probably not something that would be doable within the CPU usage limits of a shared hosting account. When the max MySQL concurrent connections of 30 is reached, any further connections would be denied and they would receive a MySQL error stating so. The information they typed into the form would not be able to be added to the database, or queued up until a free connection is available, that is something that would have to be programmed for. In regards to running a PHP script to send yourself an email with their submitted information, this could possibly run into issues if you're trying to deliver the mail remotely to Gmail, as they could see tons of mail attempts coming from our shared server's mail IP address and start blocking that. Also as each PHP script execution will require CPU time, that many PHP executions could take you over your account's CPU usage limits which you can always keep tabs on by viewing resource usage with CPU graphs. As an example, so far for today your account has had 345 PHP executions, and you're at about 10% of your CPU usage for the day. It looks like most of that usage is coming from your un-cached WordPress installations. We would highly recommend setting up caching for WordPress with either the WP Super Cache or W3 Total Cache plugins. These both cut down on duplicate PHP executions by instead caching your WordPress posts as static HTML content. You could upgrade to either a VPS account, or a dedicated server in order to have the max MySQL concurrent connections raised. But more than likely you still wouldn't want to deliver out 100,000 emails to a remote service. Instead I would recommend just delivering them locally on the server to an account you've setup specifically for that purpose. For your particular case, I might recommend a VPS to handle the raw amount of requests to the server, and setting up a Google form to store your responses in. These have the ability to automatically save out to a Google spreadsheet, but more than likely you'd want to remain using the Keep responses only in Forms option. Then you can export it as a CSV (Comma Separated Values) file, which you can in turn import into a MySQL database. This also has the added benefit of not needing to run any PHP scripts on the server, as the server would need to simply handle displaying the static HTML form, and then that form data would be processed by Google's servers. For more information you can take a look at Google forms. You can also take a look at Google form response destinations for more info on how to store that data. I hope this information was helpful, if you still had any further questions at all please let us know! - Jacob