Тип сервиса
Сервис хранилища данных
Сервис Memcached
Распределённый кеш в памяти, который сокращает повторные запросы к базе данных, вызовы API и повторную работу приложения.
Вы добавляете этот сервис в стек и выбираете там его версию и ресурсы. Каждое окружение может их переопределить.
В StackMaster
Как Memcached работает в StackMaster
What Wodby sets up for this Memcached service.
How applications reach it
- Host: the name of this app service inside the environment. Port:
11211, TCP only (UDP is switched off). - There is no password or other authentication, and no token is generated. Access is limited to the environment's internal network.
- A service linked to this one receives the host and port in variables named by the linking service. Read them in code instead of hardcoding the host.
Configuration
The image turns three settings into memcached command-line options at start. Change them through the service's settings, not with a command or a config file.
| Setting | Variable | Option | Default |
|---|---|---|---|
| Cache memory (MB) | MEMCACHED_MEMORY | -m | 64 |
| Worker threads | MEMCACHED_THREADS | -t | 4 |
| Maximum connections | MEMCACHED_MAX_CONNECTIONS | -c | 1024 |
MEMCACHED_MEMORY is the memory for cached items only; the process uses more, so the container memory limit must be higher.
Persistence
- Nothing is stored on disk and the service has no volume. Every restart and every deployment of the service empties the cache (the service is redeployed by replacing the container, not by a rolling update).
- When the item memory is full, Memcached evicts the least recently used items. Do not keep data here that cannot be rebuilt.
Check the result
From this service's container:
make check-ready -f /usr/local/bin/actions.mkreports whether the server answers.printf 'stats\r\nquit\r\n' | nc localhost 11211showslimit_maxbytes,curr_itemsandevictions.
Обзор
Технический профиль Memcached
Здесь перечислены версии, которые можно выбрать для Memcached в стеке или окружении. Сам сервис публикуется ревизиями, и стек ссылается на конкретную ревизию.
Сервис хранилища данных
Версии
1.6
Репозиторий исходного кода
Публичный Helm-чарт
Конфигурация
Конфигурация сервиса Memcached
Сервис Memcached объявляет следующее. Если значение можно изменить, его задаёт стек, а каждое окружение может его переопределить.
Настройки
3 настройки, которые стек или окружение могут изменить.