-->

Thursday, December 25, 2014

Varnish Installation on Centos 7

In this post we are going to install varnish cache on Centos Linux 7.

We are going to install Varnish Cache 4 on the Centos Linux 7 i.e. 64 bit of architecture using the yum. 

Follow the following steps to install the varnish cache on your server running Centos 7 Linux.


Step 1:- Install the following rpm from the varnish-cache repo 

 yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-debuginfo-4.0.2-1.el7.centos.x86_64.rpm  

 yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-libs-4.0.2-1.el7.centos.x86_64.rpm  

 yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-libs-devel-4.0.2-1.el7.centos.x86_64.rpm  

 yum install https://repo.varnish-cache.org/redhat/varnish-4.0/el7/x86_64/varnish/varnish-docs-4.0.2-1.el7.centos.x86_64.rpm  


Varnish Installation using yum

You can install varnish using the yum or source. We are going to install via yum in this post

Things to consider prior to installation is which version of Varnish cache you are going to install and select the appropriate version to install from the Varnish repo site. You will see each version having 3 folders based on the linux release. Select the appropriate one during the installation.


Sunday, December 21, 2014

Script for getting load, Memory usage and apache connection count in Linux

Following script can be used to format the Average load, Memory used and Apache connection count in Linux format it and present it in a human readable form.

The script is designed to read the hostname , date and time of execution, Average load, Apache process count, physical and swap memory usage



Setting private key in putty for password less access

You can generate a private key using the putty key generator and use the key to simply click and connect to your Linux server with your user account with a simple click of a mouse without having to inputting all the credentials everytime you have to access the server.

Follow these simple steps to set the private key in putty

1. Enter your user followed by ip in the hostname and saved session on the home screen of the putty



Friday, December 12, 2014

Understanding Varnish Cache

This is in continuation to my previous post on Reverse proxy servers.

Varnish is a caching http reverse proxy which means it works as an intermediatery between your client and web server, receives the requests from the client and tries to answer them from the cache , In case if varnish is not able to answer the request from the cache it will forward the request to the backend web server and fetch the response  while storing the response in it cache and delivering the response to the client.



It may be understood as when a  user first time visits the website and requests the page , varnish keeps the copy of the served page and when the user re-visit the same page again, it gets served from the saved copy of the page from the varnish cache instead of re-requesting the page from the web server, Which improves the website's performance and scalability and improves response time.



Varnish cache response is highly responsive and is very faster than the typical backend server, so you want to make sure maximum number of requests are served directly from the varnish cache itself which can typically deliver the speeds up to 300 - 1000x , depending on the architecture.

Varnish cache decides whether it can store the content or not based on the response it receives from the backend in the form HTTP response header Cache-Control. Though there are few conditions were varnish will not cache content , the most common being the use of the cookies since the cookies indicates the client-specific web object, so by default varnish will not cache it.

You can customize most of the varnish functionality by changing the policies written in the Varnish Configuration Language (VCL). Using VCL you can write policy by which you can decide what content you want to server, from where you want to get the content and how the request or response should be altered, thereby giving huge customization options according to your need.

Varnish supports all modern day platforms and is a community driven project and delivered under EPEL package repository.


Understanding Varnish Cache

This is in continuation to my previous post on Reverse proxy servers.

Varnish is a caching http reverse proxy which means it works as an intermediatery between your client and web server, receives the requests from the client and tries to answer them from the cache , In case if varnish is not able to answer the request from the cache it will forward the request to the backend web server and fetch the response  while storing the response in it cache and delivering the response to the client.



It may be understood as when a  user first time visits the website and requests the page , varnish keeps the copy of the served page and when the user re-visit the same page again, it gets served from the saved copy of the page from the varnish cache instead of re-requesting the page from the web server, Which improves the website's performance and scalability and improves response time.


Thursday, December 11, 2014

Understanding the Reverse Proxy Server


A reverse proxy server retrieves the resources on behalf of a client requesting those resources and returns it to the client as it has originated from them itself.


It can be understood as an intermediately between the client and the webserver, when a client is requesting service through internet which is coming to the reverse proxy server , which retrieves the resources from the web server in an internal network and serves it to the client without the client aware about the internal network or its origin i.e. web servers.



Understanding the Reverse Proxy Server


A reverse proxy server retrieves the resources on behalf of a client requesting those resources and returns it to the client as it has originated from them itself.


It can be understood as an intermediately between the client and the webserver, when a client is requesting service through internet which is coming to the reverse proxy server , which retrieves the resources from the web server in an internal network and serves it to the client without the client aware about the internal network or its origin i.e. web servers.