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

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

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thank you really useful, this is my site which is using apache2, MySQL can I migrate apache2 to Nginx and also MySQL to MariaDB without any data loss.

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 :)

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.