Skip to content

Instantly share code, notes, and snippets.

@mttjohnson
Created January 22, 2019 20:46
Show Gist options
  • Save mttjohnson/95cb7890ea61d2c98a3a605d106a1a6b to your computer and use it in GitHub Desktop.
Save mttjohnson/95cb7890ea61d2c98a3a605d106a1a6b to your computer and use it in GitHub Desktop.
memcached monitoring
# Connect via socket
echo 'stats' | nc -U /var/run/memcached-multi/example.com_sessions.sock
# Connect via TCP port
echo 'stats' | nc localhost 11211
# Get max memory usage limit from stats
echo 'stats' | nc -U /var/run/memcached-multi/example.com_sessions.sock \
| grep ' limit_maxbytes ' \
| cut -d" " -f3
# Get current memory usage from stats
echo 'stats' | nc -U /var/run/memcached-multi/example.com_sessions.sock \
| grep ' bytes ' \
| cut -d" " -f3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment