Memcached is a free and open-source, general purpose distributed memory caching system. Analyze the performance of your Memcached server and take informed troubleshooting descisions by keeping track of critical metrics.
This document details how to configure the Memcached plugin and the monitoring metrics for providing in-depth visibility into the performance, availability, and usage stats of Memcached servers.
Memcached performance monitoring metrics:
"bytes" metric counts and records the total number of bytes currently used by the server to store items. I.e., the number of bytes currently used for caching items.
"bytes_read" metric counts and records the total number of bytes read by the server from network.
The total number of bytes sent over the network by the server is recorded using the metric "bytes_written". It has no bearing or connection on the total size of the data you're storing.
The metric "connections_current" records the total number of connected clients. If this value is very high or low, then the chances of system failure are high. Ideally, the number of open connections to the Memcached server should be the same value on all servers.
The metric "connections_total" records the total number of connections opened since the server started running. Ideally, the total number of connections should be lesser than the total number of get/set commands.
Get the total number of worker threads requested with the metric "threads". This metric represents the total number of threads used to process incoming requests. Ideally, this should'nt be higher than the totala number of CPU cores on the server.
Use the metric "evictions" and get the total number of evictions made in your Memcached server. An eviction occurs when an object that has time to live is removed from the cache because a brand new item needs to be allocated.
Limit maximum bytes
The total number of bytes the server is permitted to use for storage is recorded using the metric "limit_maxbytes".
How it works?
- Site24x7 Memcache plugin uses "python-memcache" module to get the performance metrics of Memcached server
Note: Site24x7 Linux agent will automatically try to install "python-memcache" using the "pip" command. If the installations fails, users can manually install the module following the steps mentioned under the section "How to install memcache?".
- Execute the following command in your server to install the python requests module
sudo pip install requests
- Use "pip" to install requests module
Note: pip is a package management system that is used to install and manage software packages written in Python.
- For CentOS, Fedora, RHEL:
yum install python-develyum install python-pip (or)easy_install pip
- For Debian, Ubuntu:
apt-get -y install python-pip
Memcached plugin installation:
- Create a directory with the name "memcached", under Site24x7 Linux Agent plugin directory - /opt/site24x7/monagent/plugins/
- Download the file "memcached.py" from our GitHub repository and place it under the "memcached" directory
- Commands to perform the above step:
- Once the plugin file is downloaded, the agent will mark it up in the next data collection and you can view it in Site24x7 client
Memcached plugin configuration:
- By default, the plugin will monitor Memcached instance that is configured on "localhost"
- The default python path given in the plugin script is #!/usr/bin/python. If you wish to provide an alternate python path, replace the existing one preceded by the shebang character "#!".
- In order to change the monitoring configuration, go to plugins directory and edit the "#Config Section:" in memcached.py file
Memcached plugin file location - /opt/site24x7agent/monagent/plugins/memcached/memcached.py
Monitoring additional metrics:
- To monitor additional metrics, edit the "memcached.py" file and add the new metrics that need monitoring
- Increment the plugin version value in the file "memcached.py" to view the newly added metrics ( For e.g. change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")
- ActiveMQ plugin - Monitor performance metrics of your ActiveMQ databases
- MongoDB plugin - Monitor performance metrics of your MongoDB databases
- Twilio plugin - Analyze performance of your Twilio server
- Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
- Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
- Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes