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