Sign inSign up

workleast/lsmcd

By workleast

•Updated almost 2 years ago

LiteSpeed Memcached - LSMemcached - LSMCD Docker Image

Image
Web servers
0

1.4K

workleast/lsmcd repository overview

This docker container contains the prebuilt LSMCD application developed by LiteSpeedTech. It has been built from the original LiteSpeedTech's repository located at https://github.com/litespeedtech/lsmcd⁠

Xem hướng dẫn sử dụng bằng Tiếng Việt tại đây: https://workleast.com/cai-dat-litespeed-memcached-lsmcd-docker/⁠

⁠What is LiteSpeed Memcached (LSMCD)?

LiteSpeed Memcached (LSMCD) is a high-performance, distributed caching system with file-backed shared memory. It's generic in nature, but was originally intended for use in speeding up dynamic web applications by alleviating database load. It is designed as a drop-in replacement for Memcached. However, we also have a few features that Memcached does not: High-Availability, persistence of data, and the option to separate data by user.

https://docs.litespeedtech.com/products/lsmcd/⁠

⁠How to use

docker run --name lsmcd --shm-size 512m -d --restart always -p 11211:11211 workleast/lsmcd:latest

By the default, the shared memory size has been set to 512MB. If you want to alter it, please change the "shm-size" value in the command.

- git clone https://github.com/workleast/lsmcd-docker.git
- cd lsmcd-docker
- docker compose up -d

Or create a docker-compose.yml file with the following content:

version: "3"
services:
  lsmcd:
    image: workleast/lsmcd:latest
    #volumes:
       #- ./conf:/usr/local/lsmcd/conf
       #- ./data:/usr/local/lsmcd/data
       #- ./tmp:/tmp
    ports:
      - "11211:11211"
    restart: always
    networks:
      - default
    shm_size: '512Mb'
networks:
  default:
    driver: bridge

⁠How to test

- telnet 127.0.0.1 11211
- stats
- quit

⁠Customization

The LSMCD container will use the default configuration file. If you need to amend to it, please follow the below instructions

 - git clone https://github.com/workleast/lsmcd-docker.git
 - cd lsmcd-docker
 - nano docker-compose.yml
     volumes:
       - ./conf:/usr/local/lsmcd/conf
 - make changes to conf/node.conf file as needed

LSMCD has been configured to use the shared memory device at '/dev/shm' to store its cache data which will be destroyed upon container restart. If you want to have cache data stored persistently on your storage disk, please modify 'conf/node.conf' with 'Cached.ShmDir=/usr/local/lsmcd/data' and uncomment "volumes" declaration in the 'docker-compose.yml' file. Please refer to the following steps to implement.

 - nano conf/node.conf
      #Cached.ShmDir=/dev/shm/lsmcd
      Cached.ShmDir=/usr/local/lsmcd/data
  - nano docker-compose.yml
      volumes:
        - ./conf:/usr/local/lsmcd/conf
        - ./data:/usr/local/lsmcd/data

In order to use Unix Socket instead of TCP/IP protocol, please modify 'conf/node.conf' with 'CACHED.ADDR=UDS:///tmp/lsmcd.sock' and alter "volumes" and "ports" declarations in the 'docker-compose.yml' file. Please refer to the following steps to implement.

 - nano conf/node.conf
     #CACHED.ADDR=0.0.0.0:11211
     CACHED.ADDR=UDS:///tmp/lsmcd.sock
 - nano docker-compose.yml
     volumes:
       - ./conf:/usr/local/lsmcd/conf
       - ./tmp:/tmp
     #ports:
       #- "11211:11211"

To test Unix Socket connection, please execute the below commands:

  - nc -U tmp/lsmcd.sock -C
  - stats
  - quit

⁠Build your own container

Alternately, you can use the following repository to build your own LSMCD container:

https://github.com/workleast/lsmcd-docker⁠

⁠Author

Trần Nhuận Quang @ https://workleast.com⁠

Tag summary

Content type

Image

Digest

sha256:cee8b3f53…

Size

101.7 MB

Last updated

almost 2 years ago

docker pull workleast/lsmcd