how to optimize the server for getting high traffic even in 5$ droplet plan??

October 13, 2016 63 views
Apache Ubuntu 16.04

i have seen many bloggers are getting 1500-2000 real time visitors in just 5$ droplet,how it is possible any optimization needed on server for this usually 5$ can handle only 200-300 real time

2 Answers

1st thing you should consider, use Nginx instead Apache. doing this alone would improve performance dramatically.
secondly you can use cloudflare. that will offload huge load from your own server.

for further optimization, i would prefer you to follow these 3 tutorials

How To Optimize Nginx Configuration

How to Setup FastCGI Caching with Nginx on your VPS

How to Implement Browser Caching with Nginx's header Module on Ubuntu 16.04

For the last feature, you might need the latest version of Nginx.

by Jesin A
Here's how to setup FastCGI caching with Nginx on your VPS.

Hi @ssingchauhan25,

Considering you will be using $5 Droplet, biggest bottleneck you will have is RAM memory. It has only 512MB RAM, which is not enough for running any site. As of Ubuntu 16.04, minimum for MySQL is 1GB of RAM, so you already needs 512MB more to run MySQL flawless. If your MySQL, or even Apache/Nginx runs out of memory, it will get killed. Result of it is downtime until you notice it and manually restart services.
You can get over it by Adding Swap To Your Droplet. It is required step, consider adding at least 1GB to 2GB.
You can take look also at:

  1. Optimizing MySQL configuration (my.cnf). There are memory settings inmy.cnf which can be adjusted to lower usage. But you should test it, so your site is not to slow or goes down.
  2. Look at MySQL forks, especially MariaDB and Percona. - I'm not so sure about it, maybe someone who have more experience can comment, but you should research about resource usage and speed on all 3.

Next you should consider is Caching.
In case you are using WordPress, most easiest way is adding plugin for it. W3 Total Cache or WP Super Cache is recommended ones.
Well if this is not a case, server-side caching would be required.
In my opinion, Nginx would be most easier to setup for caching. Even I think you would get better performance with it Nginx.
In addition to links @newbie give you, I would add GZIP compression.

Next, I would take care that content size (images, html, css, js) have as low as possible size.
As for static images compress them using some service you prefer. I can recommend you tinypng, which can compress .png and .jpg. For me it is working perfectly and results are very good.
About HTML, CSS and JS consider minification. This will reduce size of it and loading time will be faster. In case you use WordPress for blog, W3 Total Cache can take care of it for you. If this is not a case, learn more about gulp, you can create little script that will do it for you. Just be sure to test it out before putting in production.
This is not so not important step, it will save you bandwidth, and you will have less content to cache.

If I get more on mind, I will edit or post comment. If you need help, ask anything, I or anyone other will try to help you :)

How fast a website will load depends on the size of all of the files that have to be downloaded by the browser. Reducing the size of files to be transmitted can make the website not only load faster, but also cheaper to those who have to pay for their bandwidth usage. In this guide, we'll discuss how to configure Nginx installed on your Ubuntu 14.04 server to utilize `gzip` compression to reduce the size of content sent to website visitors.
Have another answer? Share your knowledge.