-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker: make memcache configurable, Update Baseimage to v0.10 (#54)
* memcache.conf support in memcache.sh startup script added * example memcache.conf file added (it differs a little bit from the original one from the debian package: -d and logfile is not supported for architecture reasons) * Update to phusion/baseimage:0.10.0 docker base image
- Loading branch information
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# memcached config file | ||
# | ||
# You can insert into this config file all options of memcached. Please | ||
# refer the manpage. | ||
# It will be appended to the memcached command on startup of the container | ||
|
||
# Be verbose | ||
# -v | ||
|
||
# Be even more verbose (print client commands as well) | ||
# -vv | ||
|
||
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default | ||
# Note that the daemon will grow to this size, but does not start out holding this much | ||
# memory | ||
-m 64 | ||
|
||
# Default connection port is 11211 | ||
-p 11211 | ||
|
||
# Run the daemon as root. The start-memcached will default to running as root if no | ||
# -u command is present in this config file | ||
-u memcache | ||
|
||
# Specify which IP address to listen on. The default is to listen on all IP addresses | ||
# This parameter is one of the only security measures that memcached has, so make sure | ||
# it's listening on a firewalled interface. | ||
-l 127.0.0.1 | ||
|
||
# Limit the number of simultaneous incoming connections. The daemon default is 1024 | ||
# -c 1024 | ||
|
||
# Lock down all paged memory. Consult with the README and homepage before you do this | ||
# -k | ||
|
||
# Return error when memory is exhausted (rather than removing items) | ||
# -M | ||
|
||
# Maximize core file limit | ||
# -r | ||
|
||
# Override the default size of each slab page. Default is 1mb. Default is 1m, minimum | ||
# is 1k, max is 128m. Adjusting this value changes the item size limit. Beware that | ||
# this also increases the number of slabs (use -v to view), and the overal memory usage | ||
# of memcached. | ||
-I 1m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/sh | ||
# `/sbin/setuser memcache` runs the given command as the user `memcache`. | ||
# If you omit that part, the command will be run as root. | ||
exec /sbin/setuser memcache /usr/bin/memcached >>/var/log/memcached.log 2>&1 | ||
|
||
#read conf file | ||
options=$(cat /etc/memcached.conf | grep -v '#' | grep -v '^$' | tr '\n' ' ') | ||
|
||
exec /usr/bin/memcached $options >>/var/log/memcached.log 2>&1 |