0

This is a common question on web development process. Please don't remove or block it.

Scenario:

During some festival season days some eCommerce website(php based) has flash sales,at that day they will get a huge number of traffic compared to other off season days.

for e.g : Suppose if the website has 10k visitor/day and on flash sale day they have 100k visitors

In this case how will we manage the website traffic without affecting the site performance and working? Is there any technique to handle the huge number of users per day without website breaking?

Kindly explain the answers.

1

Here are both common and practical ways of dealing with server spikes.

  1. Install server-side caching – many web development platforms build content on-the-fly, such as WordPress and Joomla. This adds work to the server every time a page is requested. There are plenty of cache plugins and extensions around for these products that will store pre-built page content for a short period of time so that repeated requests for the page don’t need to go through the whole page build process. This is simple to install and can be highly effective;

  2. Get a better server – you need a server that is fit for the job. Shared hosting is fine for small traffic sites (or even medium traffic sites that are well optimised), but ultimately a bigger box with more memory, better systems software, and dedicated resources will be best. Look at a VPS, a dedicated server, or a cloud hosting service that allows you to boost the resources available to your website as and when they are needed – good, professional website hosting can be achieved at a reasonable price;

  3. Make sure your content is rendered quickly – this is important regardless of the volume of traffic you’re getting. Search engines and real visitors prefer websites that load quickly, so make sure you aren’t serving huge images. Simple, but perhaps time consuming to implement;

  4. Use a content delivery network (CDN) – if you have lots of static resources on your site then try using a CDN to distribute the files to various servers around the globe. This will ensure your files are served from the closest point to your visitor’s location and will remove the need for your server to do the work;

  5. Consider Cloudflare – this is effectively a content delivery network, but with the added advantage that your content is optimised and they can also protect your website from malicious attacks. Setup is fairly straightforward, although there are quite a few options to consider (especially with the excellent paid pro- version);

  6. Try compressing your web page content – if you could store your web pages as compressed (zipped) files and leave the unzipping to the visitor’s browser, that could really reduce the load on your site AND deliver your content quicker

  7. If you have a database-driven website (which can include websites that run content management systems such as Joomla, Drupal and WordPress) make sure that the number of concurrent database connections is high enough to cope with your expected traffic. Every time someone visits a website on one of these systems it results in database calls. Usually, there are a limited number of concurrent connections allowed. If this is exceeded the visitor will get a rather brief and unfriendly ‘Too many database connections’ message. So, increase the setting for the number of concurrent database connections as much as you can. If you don’t know where to look to increase this, try asking your website hosts

  8. Ask your website hosts if they can help – if you expect a traffic spike it’s polite to let your web hosts know, especially if other websites on the server could be affected, but they might also be able to change some server settings or shift resources to help you out;

  • Thanks for the detailed answer.What about scaling up of server.I heard about it. – Hari kris Sep 14 '16 at 13:17
  • You are welcome. In regards to your question of "scaling up" is answered by number 2, which is to upgrade the server. Scaling up, generally refers to adding more processors and RAM, buying a more expensive and robust server. – norcal johnny Sep 16 '16 at 0:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.