How to install and configure memcached on CentOS 7 server step by step guide



In this article we learn what is memcached and how to install and configure memcached on the centos server.

What is memcached?

Memcached is a high performance , in memory and distributed caching system to improve the performance of the dynamic web application by caching application data in memory.

Installation of memcached on centos server

Before the installation of memcached make sure all packages are up to date. To do this we execute the below command.

[root@localhost ~]#yum update -y

 To install memcached on the centos server we need to execute the below command.

[root@localhost ~]#yum install memcached –y
How to install and configure memcached on CentOS 7 server step by step guide
How to install and configure memcached on CentOS 7 server step by step guide
After installing the package we need to start the service and enable the service at the start up mode using the following command.

[root@localhost ~]#systemctl start memcached
[root@localhost ~]#systemctl enable memcached

Configuration of memcached on centos server

The default configuration file is located at “/etc/sysconfig/memcached” file as below
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS=""

From the above config file “11211” is the default port of memcached ,”memcached” is the default user of memcached config file,max connection is “1024” and “64” is the default cachesize.
You can change these parameters as per your requirement.
To check the port is listening or not using the below command.
[root@localhost ~]# ss -tulpn | grep 11211
udp    UNCONN     0      0         *:11211                 *:*                   users:(("memcached",pid=9953,fd=28))
udp    UNCONN     0      0        :::11211                :::*                   users:(("memcached",pid=9953,fd=29))
tcp    LISTEN     0      128       *:11211                 *:*                   users:(("memcached",pid=9953,fd=26))
tcp    LISTEN     0      128      :::11211                :::*                   users:(("memcached",pid=9953,fd=27))

That's all. if this article  is helpful  please share it!!!



SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment