Using a 3rd server for caching database and static content

Posted on

Using a 3rd server for caching database and static content – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, nginx, vps, cache, varnish.

So, I just “won” a free year for a basic VPS with 5GB storage and 256MB ram and I thought that the best thing I could do with it is to separate the memcache service from each of my other 2 servers and maybe implement an NGINX Proxy or Varnish (or maybe both, is that logical or even possible?)

  • What do you think about my idea of using it, could the server hold those services?
  • If not, what use could I give it?

  • About the caching static content with NGINX or Varnish, is it possible to use an external server to cache that?

    • I know it may sound as a dumb question, but I have never faced that fact before

Solution :

Well, don’t try to move a lot of services, as I am sure there will be some effort to do that, also to revert back once your free plan is over (if you don’t think about keeping it).

But as you said, the best idea is to use a reverse caching proxy to cache the web content and serve it to user. The effort will be next to negligible and to revert back, you just need to point the DNS entry back to main server.

Nginx can also do that, but I don’t think it comes near to Varnish, regarding the memory management and the performance. I will suggest you go ahead with Varnish and install the same on the free server and point the back-end to your current server.

Here are your questions answered:

  • What do you think about my idea of using it, could the server hold those services?
    If not, what use could I give it?

    Yes, it would be a great idea, and if you use an operating system with minimal services(so that you can get enough RAM free for Varnish), then a reverse proxy like Varnish, could really improve your site performance (if you already haven’t got that).

  • About the caching static content with NGINX or Varnish, is it possible to use an external server to cache that?

    Yes, it’s possible to do that.

    • I know it may sound as a dumb question, but I have never faced that fact before

      If you wanted to find out whether the question is dumb or not, just ask it.

But there is one thing you should think of before doing this. If you could check the latency between your current server and the one you just got now. If it’s very less (not totally LAN, but comparable to LAN), then it will make sense, but if the latency is too much, that will adversely effect your site performance. As once a user tries to connect to your server, it’s request will come to your Varnish server and then Varnish server will send one request to the back-end server and if the latency is high, it will impact the user experience.

Hope this helped.

Leave a Reply

Your email address will not be published.