Our Memcached integration collects and sends inventory and metrics from your Memcached instance to our platform, where you can aggregate and visualize key performance metrics. We collect data at both instance and slab levels.
Read on to install the integration, and to see what data we collect.
Compatibility and requirements
Our integration is compatible with Memcached 1.4 or higher.
If Memcached is not running on Kubernetes or Amazon ECS, you must install the infrastructure agent on a host that's running Memcached. Otherwise:
- If running on Kubernetes, see these requirements.
- If running on ECS, see these requirements.
Quick start
Instrument your Memcached instance quickly and send your telemetry data with guided install. Our guided install creates a customized CLI command for your environment that downloads and installs the New Relic CLI and the infrastructure agent.
Ready to get started? Click one of these button to try it out.
Our guided install uses the infrastructure agent to set up the Memcached integration. Not only that, it discovers other applications and log sources running in your environment and then recommends which ones you should instrument.
The guided install works with most setups. But if it doesn't suit your needs, you can find other methods below to get started monitoring your MySQL instance.
Install and activate
To install the Memcached integration, follow the instructions for your environment:
Additional notes:
- Advanced: Integrations are also available in tarball format to allow for install outside of a package manager.
- On-host integrations do not automatically update. For best results, regularly update the integration package and the infrastructure agent.
Did this doc help with your installation?
Configure the integration
An integration's YAML-format configuration is where you can place required login credentials and configure how data is collected. Which options you change depend on your setup and preference.
There are several ways to configure the integration, depending on how it was installed:
- If enabled via Kubernetes: see Monitor services running on Kubernetes.
- If enabled via Amazon ECS: see Monitor services running on ECS.
- If installed on-host: edit the config in the integration's YAML config file,
memcached-config.yml
.
The configuration file has common settings used by all of our integrations, such as interval
, timeout
, and inventory_source
. For more on these common settings, see our configuration properties list.
If you're still using our legacy configuration/definition files, see the standard configuration format for help.
Specific settings related to Memcached are defined using the env
section of the configuration file. These settings control the connection to your Memcached instance as well as other security settings and features.
Configuration options are below. For a better sense of how this works in practice, see our example config file.
Memcached instance settings
The Memcached integration collects both Metrics(M) and Inventory(I) information. Check the Applies To column to find which settings can be used for each collection:
Setting | Description | Default | Applies To |
---|---|---|---|
HOST | Hostname of the memcached instance. | localhost | M/I |
PORT | Port memcached is running on. | 11211 | M/I |
USERNAME | Memcached SASL username. Only required if authentication is enabled. | N/A | M/I |
PASSWORD | Memcached SASL password. Only required if authentication is enabled. | N/A | M/I |
METRICS | Set to | false | |
INVENTORY | Set to | false |
The values for these settings can be defined in several ways:
- Add the value directly in the config file.
- Replace the values from environment variables using the
{{}}
notation. This requires Infrastructure agent v1.14.0+. Read more here or see example below. - Use secrets management to protect sensitive information, such as passwords, from being exposed in plain text in the configuration file. For more information, see how to use secrets management.
Labels/custom attributes
You can also decorate your metrics using labels. Labels allow you to add key/value pair attributes to your metrics. You can use them to query, filter, or group your metrics.
Our default sample configuration file includes examples of labels, but you can remove, modify, or add new ones of your choice.
labels: env: production role: memcached
Example configuration
Example memcached-config.yml
file configuration:
For more about the general structure of on-host integration configuration, see our integration configuration overview.
Find and use data
Data from this service is reported to an integration dashboard.
Metrics are attached to these event types:
MemcachedSample
MemcachedSlabSample
You can query this data for troubleshooting purposes or to create custom charts and dashboards.
For more on how to find and use your data, see Understand integration data.
Metric data
The Memcached integration collects the following metric data attributes.
Memcached sample metrics
These attributes are attached to this MemcachedSample
event type:
Metric | Description |
---|---|
| The average size of an item. |
| Rate of bytes read from the network by this server. |
| Current number of bytes used by this server to store items. |
| Rate of bytes written to the network by this server. |
| Rate at which keys are compared and swapped and found present. |
| Rate at which keys are compared and swapped and not found present. |
| Rate at which keys are compared and swapped where the original value did not match the supplied value. |
| Rate of |
| Rate of |
| Rate of |
| Rate at which connections to this server are opened. |
| Number of connection structures allocated by the server. |
| Current number of items stored by the server. |
| Rate at which delete commands result in no items being removed. |
| Rate at which delete commands result in items being removed. |
| Rate at which valid items are removed from cache to free memory for new items. |
| Fraction of user time the CPU spent executing this server process. |
| Percentage of requested keys that are found present since the start of the memcache server. |
| Rate at which keys are requested and found present. |
| Rate at which keys are requested and not found. |
| Number of bytes this server is allowed to use for storage. |
| Number of open connections to this server. |
| Default size of pointers on the host OS (generally 32 or 64). |
| Rate at which the server has reached the max connection limit |
| Amount of memory being used by the server for storing items as a percentage of the max allowed. |
| Number of threads used by the current Memcached server process. |
| Total number of items stored by this server since it started. |
| Number of seconds this server has been running. |
| Fraction of time the CPU spent executing kernel code on behalf of this server process. |
Memcached slab sample metrics
These attributes are attached to the MemcachedSlabSample
event type:
Metric | Description |
---|---|
| Rate at which active items were bumped within |
| Total number of slab classes allocated. |
| Rate at which Check-And-Set (CAS) commands failed to modify a value due to a bad CAS ID. |
| Rate at which CAS commands modified this slab class. |
| The amount of space each chunk uses. |
| How many chunks exist within one page. |
| Rate at which set requests stored data in this slab class. |
| Rate at which decrs commands modified this slab class. |
| Rate at which delete commands succeeded in this slab class. |
| Rate at which entries were stored using memory from an expired entry. |
| Rate at which items had to be evicted from the Least Recently Used (LRU) before expiring. |
| Rate at which nonzero items which had an explicit expire time set had to be evicted from the LRU before expiring. |
| Rate at which expired items reclaimed from the LRU which were never touched after being set. |
| Number of free chunks at the end of the last allocated page. |
| Chunks not yet allocated to items or freed via delete. |
| Rate at which get requests were serviced by this slab class. |
| Rate at which incrs commands modified this slab class. |
| Number of items presently stored in the |
| Rate at which items were moved from |
| Rate at which worker threads had to directly pull LRU tails to find memory for a new item. |
| Rate at which items freed by the LRU crawler. |
| Number of items presently stored in the |
| Age of the oldest item in the LRU. |
| Rate at which items found to be refcount locked in the LRU tail. |
| Number of items presently stored in this slab class. |
| Seconds since the last access for the most recent item evicted from this slab class, shown as milliseconds. |
| Number of items presently stored in the |
| Rate at which items were moved from |
| Total amount of memory allocated to slab pages. |
| Number of bytes requested to be stored in this slab. |
| Rate at which the underlying slab class was unable to store a new item shown as error. |
| Rate at which memcache self-healed a slab with a refcount leak. |
| Total number of chunks allocated to the slab class. |
| Total number of pages allocated to the slab class. |
| Rate of touches serviced by this slab class. |
| Number of chunks allocated to items. |
| Rate at which chunks have been allocated to items. |
| Rate at which valid items evicted from the LRU which were never touched after being set. |
Inventory data
The Memcached integration captures the configuration parameters of the memcached instance. The data is available on the Inventory page, under the config/memcached source. For more about inventory data, see Understand integration data.
The integration captures data for the following Memcached configuration parameters:
Memcached Inventory
Metric | Description |
---|---|
| Indicates whether SASL authentication is enabled. |
| Sets the default protocol support for client connections. Options: |
| Indicates whether Check-And-Set (CAS) is enabled. |
| The amount of space each chunk uses. One item will use one chunk of the appropriate size. |
| Indicates whether stats detail is enabled. |
| The path to the UNIX socket to listen on. |
| Indicates whether stats cachedump and |
| Indicates whether evictions are enabled. If so, returns an error on memory exhausted instead of evicting. |
| Indicates whether |
| The chunk size growth factor. |
| The hash table algorithm. |
| An integer multiplier for how large the hash table should be. Normally grows at runtime. |
| Percent of slab memory to reserve for HOT LRU. |
| Set idle age of HOT LRU to COLD age multiplied by this value. |
| Timeout for idle connections. |
| Save up to 24 bytes per item. |
| The interface to listen on. |
| The maximum size for an item. |
| Enable the LRU crawler background thread. |
| Microseconds to sleep between items. |
| Max items to crawl per slab per run. |
| Split LRU mode and background threads. |
| Enable segmented LRU mode. |
| The maximum number of bytes allowed in the cache. |
| The maximum number of clients allowed. |
| Immediately close new connections after limit is reached. |
| Number of threads to use. |
| Number of threads to use per UDP. |
| The age of the oldest honored object. |
| Maximum number of requests per event. |
| Indicates whether slab page automover is enabled. |
| Ratio limit between young/old slab classes. |
| Internal algorithm tunable for automove. |
| Specifies the maximum size of a slab. Items larger than the set max are split over multiple slabs. |
| Enable or disable slab reassignment. |
| The prefix used for stats keys. |
| Time in seconds for how long to wait before forcefully killing LRU tail item. |
| The backlog queue limit. |
| The TCP port to listen on. |
| Boolean value, indicates if |
| Items set with a TTL lower than this value will go into TEMP_LRU and be unevictable until they expire or are deleted or replaced. If TTL is set to zero, TEMP_LRU is disabled. |
| Enable dynamic reporters for 'stats sizes' command. |
| The UDP port to listen on. |
| Access mask for UNIX socket, in octal. |
| Set the verbosity level of the logging output. |
| Percent of slab memory to reserve for WARM LRU. |
| Set idle age of WARM LRU to COLD age multiplied by this value. |
| Size in kilobytes of per-watcher write buffer. |
| Size in kilobytes of per-worker-thread buffer. |
Check the source code
This integration is open source software. That means you can browse its source code and send improvements, or create your own fork and build it.