Tag Archives: Memcached Daemon

Know Whether Your Server’s Memcached Service Is Listening On Port 11211

If you’re not sure whether your dedicated server‘s Memcached service is listening on port 11211 i.e. it is installed and running properly, there are some easy tests you can do to make sure everything is operating fine.

Before you start, enable the administrator access on your server (in case you have not), connect via SSH then switch to the root user.

Next, in the command line, type the following command and PRESS ENTER:

telnet localhost 11211

This will report to you back that it was able to connect to the service.

[root@server[~]: telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

In case, if it’s not installed properly, you will see something like this:

[root@transfer[~]: telnet localhost 11211
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

And you will not be able to connect to the service.

In the next lesson, you will learn about testing the presence of the needed PHP libraries to make Memcached work for you.

Configured Memcached PHP Libraries On Your Server, Next What?

In the previous lessons, you have learned about installing Memcached PHP Libraries and configuring Memcached Daemon on your dedicated server. Now next steps are to configure your apps and websites to use them so that you can get their real benefit.

So once you get the Memcached Daemon and PHP libraries installed on your CentOS-based dedicated server, you are required to configure your PHP application to use Memcached. In case you don’t it, Memcached is going to use your server resources without providing you any of the advantages.

Before starting, the system recommends you take a backup of your websites and then follow the changes outlined below.

WordPress users can take its benefit simply by using a plugin called W3 Total Cache Plugin. Yes, there are many other plugins as well but the system finds it best for most of its users. If in case this plugin doesn’t suit you or it is in conflict with some other plugin you are using, it that’s your case then you can choose some other plugin such as Batcache, Cachify, Memcached-Redux, etc.

In this lesson, you will learn about configuring the first and the best one i.e. W3 Total Cache. Simply start by installing-activating the plugin and then to configure, navigate to the Performance -> General Settings page.

Next, make sure the Enable tickbox is checked and Memcached is selected with the cache method for:

  • Page Cache
  • Object Cache
  • Database Cache
  • Fragment Cache

Once you do this, your website starts to use the Memcached services for imporving the performace of your website at the same time reducing the load on your dedicated server.

How Memcached Daemon Works On Your Dedicated Server?

The loading of files and code on your dedicated server take lots of its resources, this resource usage can be reduced by using an object caching system and when you do that, the performance of your server automatically increases. This happens because then your server needs fewer resources to run web applications.

Memcached is a free high-performance, distributed memory object caching system which is generic in nature. It is planned for speeding up dynamic web applications simply by alleviating your database load.

Earlier you learned about configuring the Memcached PHP Libraries on your dedicated server. Now this lesson will let you know what is Memcached and how you can easily install it on your CentOS-based dedicated server at Sangkrit.net.

On CentOS servers, installation of the Memcached daemon is performed via command line and it is freed of any control panel you may be using such as WHM or cPanel, etc.

How this all works for you?

The cache data is simply stored in the hardware units such as RAM and that can also be used in correlation with a software segment.

As we have explained before, the primary purpose of cache is to increase the retrival of information stored in the form of data by minimizing the requirment to access the lower layers of storage every time a new request is made by the client.

Yes, this data is not the actual data stored on your server but it is a subset of data copied from the databases having the real data fed by your application.

This is like when you keep actual notes in your diary or anywhere else but you remember those notes anyway in your mind. So when the time comes when you need those notes; Instead of opening your diary again and finding them you directly make use of them because you already remember them anyway.

Hence, the main advantage of caching is to speed up loading and minimize the system resource usage that is generally needed to load any request such as a web page of your website or application.