The following list shows some potential issues you might encounter
plugin, and solutions or workarounds where available:
If you see this error in your MySQL error log, the server might fail to start:
failed to set rlimit for open files. Try running as root or requesting smaller maxconns value.
The error message is actually from the memcached daemon. One solution is to raise the OS limit for the number of open files. The command varies depending on the operating system. For example, here are the commands to check and increase the limit on several operating systems:
# Linux $ ulimit -n 1024 ulimit -n 4096 $ ulimit -n 4096 # OS X Lion (10.6) $ ulimit -n 256 ulimit -n 4096 $ ulimit -n 4096
The other solution is to reduce the number of concurrent connections available for the memcached daemon, using the
-coption which defaults to 1024. Encode that memcached option using the MySQL option
daemon_memcached_optioninside the MySQL configuration file:
[mysqld] ... loose-daemon_memcached_option='-c 64'
To troubleshoot problems where the memcached daemon is unable to store data in or retrieve data from the
InnoDBtable, specify the memcached option
-vvvthrough the MySQL configuration option
daemon_memcached_option. Examine the MySQL error log for debug output related to memcached operations.
If the column specified to hold the memcached item values is the wrong data type, such as a numeric type instead of a string type, attempts to store key/value pairs will fail with no specific error code or message.
daemon_memcachedplugin causes any issues with starting the MySQL server, disable it during troubleshooting by adding this line under the
[mysqld]group in your MySQL configuration file:
For example, if you run the
INSTALL PLUGINstatement before running the
innodb_memcached_config.sqlconfiguration script to set up the necessary database and tables, the server might crash and be unable to start. Or, if you set up an incorrect entry in the
innodb_memcache.containerstable, the server might be unable to start.
To permanently turn off the memcached plugin for a MySQL instance, issue the following command:
mysql> uninstall plugin daemon_memcached;
If you run more than one instance of MySQL on the same machine, with the memcached daemon plugin enabled in each, make sure to specify a unique memcached port for each one using the
You might find that a SQL statement cannot find an expected table, or there is no data in the table, but memcached API calls still work and retrieve the expected data. This can happen if you do not set up the entry in the
innodb_memcache.containerstable, or do not switch to that table by issuing a
SETrequest with the key
@@, or make a change to an existing entry in
innodb_memcache.containerswithout restarting the MySQL server afterward. The free-form storage mechanism is flexible enough that your requests to store or retrieve a multi-column value like
col1|col2|col3will usually still work, even if the daemon is using the
test.demo_testtable which stores all the data within a single column.
When defining your own
InnoDBtable for use with
InnoDBmemcached, and columns in your table are defined as NOT NULL, ensure that values are supplied for the NOT NULL columns when inserting a descriptor for the
InnoDBtable into the memcached containers table (
innodb_memcached.containers). If your descriptor
INSERTstatement contains fewer delimited values than there are mapped columns, unfilled columns are set to NULL. Attempting to insert a NULL value into a NOT NULL column causes the
INSERTto fail, which may only become evident after you reinitialize the
InnoDBmemcached plugin to apply changes to the containers table.
innodb_memcached.containerstable are set to NULL, the following error will be returned when attempting to load the memcached plugin:
InnoDB_Memcached: column 6 in the entry for config table 'containers' in database 'innodb_memcache' has an invalid NULL value.
The memcached plugin rejects usage of NULL in the
expire_time_columncolumns. Set the value of these columns to
0if the columns are unused.
As the length of the memcached key and values increase, you encounter size and length limits at different points:
When the key exceeds 250 bytes in size, memcached operations return an error. This is currently a fixed limit within memcached.
You might encounter
InnoDB-related limits when the value exceeds 768 bytes in size, or 3072 bytes in size, or the
InnoDBrow size limit which depends on
innodb_page_sizesetting. These limits primarily apply if you intend to create an index on the value column to run report-generating queries on that column from SQL. See Section 14.5.7, “Limits on InnoDB Tables” for details.
The maximum size for the combination of the key and the value is 1 MB.
If you share configuration files across MySQL servers with different versions, using the latest configuration options for the memcached plugin could cause startup errors for older MySQL versions. To avoid compatibility problems, use the
looseforms of these option names, for example
loose-daemon_memcached_option='-c 64'instead of
There is no restriction or check in place to validate character set settings. memcached stores and retrieves keys and values in bytes and is therefore not character set sensitive. However, you must ensure that the memcached client and the MySQL table use the same character set.
memcached connections are blocked from accessing tables that contain an indexed virtual column. Accessing an indexed virtual column requires a callback to the server, but a memcached connection does not have access to the server code.