The memcached container
  • Dockerfile 46.3%
  • Roff 38.3%
  • Shell 15.4%
Find a file
Petr "Stone" Hracek 5097d0e7d4 Add missing files directory
Signed-off-by: Petr "Stone" Hracek <phracek@redhat.com>
2017-04-12 10:15:36 +02:00
files Add missing files directory 2017-04-12 10:15:36 +02:00
.gitignore Initial setup of the repo 2017-04-11 12:31:12 +00:00
Dockerfile Fix LABEL architecture 2017-04-12 08:58:50 +02:00
help.md Initial import (#1436970) 2017-04-12 08:48:51 +02:00
memcached-container.service Initial import (#1436970) 2017-04-12 08:48:51 +02:00
openshift-template.yml Initial import (#1436970) 2017-04-12 08:48:51 +02:00
README.md Initial import (#1436970) 2017-04-12 08:48:51 +02:00
sources Initial setup of the repo 2017-04-11 12:31:12 +00:00

memcached

Memcached is High Performance, Distributed Memory Object Cache

Summary

  • Dockerfile - build container image with memcached.
  • openshift-template.yml - Template for OpenShift to memcached.

How to use the container over standard 11211 port

Command for running memcached docker container:

docker run -it -e CACHE_SIZE=128 \
    -p 11211:11211

If you would like to increase a CACHE_SIZE use environment variable -e CACHE_SIZE:

docker run -it -e CACHE_SIZE=128 \
    -p 11211:11211

How to run memcached as standalone container

Copy memcached-container.service to /usr/lib/systemd/user/ directory

sudo cp memcached-container.service /usr/lib/systemd/user/
systemctl --user daemon-reload

Command for running memcached as standalone container:

systemctl start --user memcached-container

How to stop memcached as standalone container

Command for stopping memcached as standalone container:

systemctl stop --user memcached-container

How to test the memcached

Commands for testing memcached docker container:

To store data in memcached server with telnet:

set KEY META_DATA EXPIRY_TIME LENGTH_IN_BYTES

To get data

get KEY

To overwrite existing key

replace KEY META_DATA EXPIRE_TIME LENGTH_IN_BYTES

To delete key

delete KEY

To get the server statistics

stats
stats items
stats slabs

To clear the metadata statistics

flush all

Memcached Server Telnet Example (taken from http://www.journaldev.com/16/memcached-telnet-commands-with-example)

set Test 0 100 10
JournalDev
STORED
get Test
VALUE Test 0 10
JournalDev
END
replace Test 0 100 4
Temp
STORED
get Test
VALUE Test 0 4
Temp
END
stats items
STAT items:1:number 1
STAT items:1:age 19
STAT items:1:evicted 0
STAT items:1:evicted_time 0
STAT items:1:outofmemory 0
STAT items:1:tailrepairs 0
END
flush_all
OK
get Test
END
version
VERSION 1.4.25
quit