Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Caching Server»How To Install Memcached on Fedora 35/34/33

    How To Install Memcached on Fedora 35/34/33

    RahulBy RahulMay 30, 20193 Mins ReadUpdated:April 18, 2022

    Memcached is a distributed memory object caching system which stored data in memory on key-value basis. It is very useful for optimizing dynamic websites and enabled speed by caching objects in memory. Read more about memcache.

    This article will help you to install Memcached on Fedora Linux systems.

    Install Memcached on Fedora

    Memcached is available under default Fedora repositories. You can install it by running the following command on your Fedora Linux system.

    sudo dnf install memcached -y
    

    Now start the Memcached service using the following commands.

    sudo systemctl enable memcached.service 
    sudo systemctl start memcached.service 
    

    Memcached Configuration

    Edit the Memcached default configuration file in your favorite text editor.

    sudo vim /etc/sysconfig/memcached
    

    and update the settings as per your system requirements. Here CACHESIZE is the max memory limit in Mb, which Memcached can use.

     PORT="11211"
     USER="memcached"
     MAXCONN="1024"
     CACHESIZE="64"
     OPTIONS=""
    

    The above configuration shows that Memcached can use up to 64 Mb memory on the system.

    After doing any changes, restart the Memcached server to apply changes.

    sudo systemctl restart memcached.service
    

    View Memcached Stats

    You can view the service status using the systemctl command

    sudo systemctl status memcached.service
    

    You can also view the statics of the running Memcached service using “stats settings” command. Below is the example to send this command to the Memcached server and see the results.

    echo "stats settings" | nc localhost 11211
    
    STAT maxbytes 67108864
    STAT maxconns 1024
    STAT tcpport 11211
    STAT udpport 11211
    STAT inter 127.0.0.1
    STAT verbosity 0
    STAT oldest 0
    STAT evictions on
    STAT domain_socket NULL
    STAT umask 700
    STAT growth_factor 1.25
    STAT chunk_size 48
    STAT num_threads 4
    STAT num_threads_per_udp 4
    STAT stat_key_prefix :
    STAT detail_enabled no
    STAT reqs_per_event 20
    STAT cas_enabled yes
    STAT tcp_backlog 1024
    STAT binding_protocol auto-negotiate
    STAT auth_enabled_sasl no
    STAT item_size_max 1048576
    STAT maxconns_fast no
    STAT hashpower_init 0
    STAT slab_reassign no
    STAT slab_automove 0
    END
    

    Install Memcache PHP Extension

    You need to enable Memcache/Memcached PHP extension on your server to connect PHP with the Memcached service. There are basically two Memcache PHP modules available to install. One is named Memcache and the other Memcached. So install the module as per your uses.

    sudo dnf install php-pecl-memcache 
    sudo dnf install php-pecl-memcached 
    

    After installation restarts the Apache service.

    sudo systemctl restart httpd.service 
    

    Now check if memcache php extension is enabled and working properly. Create a phpinfo.php file using following code

    PHP
    1
    2
    3
    <?php
      phpinfo();
    ?>

    Now access http://server-ip-addr/phpinfo.php on the web browser and search for Memcache, You will see the results below.

    install memcache fedora

    install memcached fedora

    memcache memcached
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install Wine 5.0 on Debian 10 (Buster)
    Next Article How to Install Angular CLI on Ubuntu 18.04 & 16.04

    Related Posts

    How To Install Memcached on Ubuntu 20.04

    3 Mins Read

    How To Install Memcached on CentOS/RHEL 8

    Updated:August 8, 20201 Min Read

    How To Install Redis on Debian 10

    Updated:July 7, 20203 Mins Read

    How to Install Redis on Ubuntu 20.04

    3 Mins Read

    How To Delete All Data in Redis

    Updated:February 27, 20201 Min Read

    How to install and configure Squid Proxy on Debian 8

    Updated:December 21, 20183 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.