Author: ZIADI Mohamed Ali

Memcached : Setup and tests on Debian/Ubuntu (Part – I)

Memcached is a distributed memory caching system. It caches data and objects in RAM in order to reduce the frequency of access to database or to an external API. Consequently, it helps to speed up dynamic websites. The first release of memcached was in 2003. Why? To protect user data, sessions are stored in files on the servers themselves. This has several disadvantages: The user must be sticked to a front to maintain it’s session It generates a a lot of disk IO on servers Using Memcached to store sessions: Removes the disk IO related sessions Allows not to stick a user to a server (and to complete round robin on a server pool) Install & Tests We need Apache running. Let’s say Apache is listening on 192.168.1.10 edit /var/www/php-info.php like below: <?php php phpinfo() ; ?> The 2 packages that we need are : Memcached PHP5 memcache module We can install them as follows: apt-get install memcached php5-memcache After the installation, memcached should already be running. You can check that by typing server1:~# netstat -tap | grep memcached tcp 0 0 *:11211 *:* LISTEN 3053/memcached By default, memcached is using port 11211 and is listening on all interfaces. So, to avoid that anyone (as memcached has no build-in authentication mechanisms) can connect to it and use it we have two solutions: Close port 11211 in your firewall. Configure memcached...

Read More

Varnish cache: Installation and configuration on Centos 7

What is Varnish ? Varnish is an HTTP cache server. It considered as an HTTP accelerator or sometimes a reversy-proxy between application servers and clients. It is designed for content-heavy dynamic web sites and highly consumed APIs. According to the rules which are defined by system administrator and site developers, it allows alleviating server load and serving queries faster by caching data. Examples of web sites using Varnish: Wikipedia, Facebook, Twitter, Vimeo, Tumblr, The New York Times, The Guardian, The Hindu, Corriere della Sera… In 2012, 5% of the top 10000 sites in the web used the software. How it works ?   As mentionned in the figure, Varnish is between the client and the web server. Let’s consider that we are using Apache as web server: Varnsih will listen on port 80 and Apache will move to another port (8080) Apache will be considered as a backend to Varnish   Installation [root@server varnish]# yum install varnish Related packages are: [root@server varnish]# rpm -qa | grep varnish varnish-libs-4.0.3-3.el7.x86_64 varnish-4.0.3-3.el7.x86_64 Related files are: [root@server varnish]# tree /etc/varnish/ /etc/varnish/ |___ default.vcl |___ secret |___ varnish.params 0 directories, 3 files   Configuration The file /etc/varnish/default.vcl is written in VCL (Varnish Cache Language) and contains blocks defining how varnish is working when receiving, fechting/asking the backend and delivering responses. Each block begins with a little description explaining it’s role. Edit /etc/varnish/default.vcl and modify/add...

Read More

How to implement GlusterFS in Redhat/Centos

What is GlusterFS? GlusterFS(Which was developed by Gluster inc and acquired by Redhat in 2011) is a distributed network file system characterized by: Scalability, High availability A a lot of applications needing shared storage are using it including: CDN : content delivery networks, Media streaming, Cloud computing, Web cluster solutions High availability is ensured by the fact that storage data is redundant if a node goes down  another will cover it without service interruption. How does it work? To get GlusterFS up and running, these are the strictly necessary steps: For those wha are nor familiar with GlusterFS, I recommend that you start by choosing your preferred setup method such as AWS, virtual machines or bare metal (you can do this after step 4 when you will add an entry to fstab). Otherwise, you can get started with the steps below: You will need to have at least: Two X86 machines with a 64 bit OS and a working network connection, At least 1GB of RAM is the bare minimum recommended for testing, At least 8GB in any system you plan on doing any real work on, A single CPU is fine for testing, as long as it is 64 bit. “Bricks” are the nodes for GlusterFS. Each node should have a dedicated disk. One of these nodes will be serving the Gluster volume to clients: this will be...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.