Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 43.3Mb
PDF (A4) - 43.4Mb
Man Pages (TGZ) - 297.2Kb
Man Pages (Zip) - 402.4Kb
Info (Gzip) - 4.3Mb
Info (Zip) - 4.3Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  / ...  / The InnoDB Storage Engine  / InnoDB memcached Plugin  /  Troubleshooting the InnoDB memcached Plugin

17.20.9 Troubleshooting the InnoDB memcached Plugin

This section describes issues that you may encounter when using theInnoDBmemcached plugin.

  • If you encounter the following error in the 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 from thememcached daemon. One solution is to raise the OS limit for the number of open files. The commands for checking and increasing the open file limit varies by operating system. This example shows commands for Linux and macOS:

    # Linux$> ulimit -n1024$> ulimit -n 4096$> ulimit -n4096# macOS$> ulimit -n256$> ulimit -n 4096$> ulimit -n4096

    The other solution is to reduce the number of concurrent connections permitted for thememcached daemon. To do so, encode the-cmemcached option in thedaemon_memcached_option configuration parameter in the MySQL configuration file. The-c option has a default value of 1024.

    [mysqld]...loose-daemon_memcached_option='-c 64'
  • To troubleshoot problems where thememcached daemon is unable to store or retrieveInnoDB table data, encode the-vvvmemcached option in thedaemon_memcached_option configuration parameter in the MySQL configuration file. Examine the MySQL error log for debug output related tomemcached operations.

    [mysqld]...loose-daemon_memcached_option='-vvv'
  • If columns specified to holdmemcached values are the wrong data type, such as a numeric type instead of a string type, attempts to store key-value pairs fail with no specific error code or message.

  • If thedaemon_memcached plugin causes MySQL server startup issues, you can temporarily disable thedaemon_memcached plugin while troubleshooting by adding this line under the[mysqld] group in the MySQL configuration file:

    daemon_memcached=OFF

    For example, if you run theINSTALL PLUGIN statement before running theinnodb_memcached_config.sql configuration script to set up the necessary database and tables, the server might unexpectedly exit and fail to start. The server could also fail to start if you incorrectly configure an entry in theinnodb_memcache.containers table.

    To uninstall thememcached plugin for a MySQL instance, issue the following statement:

    mysql> UNINSTALL PLUGIN daemon_memcached;
  • If you run more than one instance of MySQL on the same machine with thedaemon_memcached plugin enabled in each instance, use thedaemon_memcached_option configuration parameter to specify a uniquememcached port for eachdaemon_memcached plugin.

  • If an SQL statement cannot find theInnoDB table or finds no data in the table, butmemcached API calls retrieve the expected data, you may be missing an entry for theInnoDB table in theinnodb_memcache.containers table, or you may have not switched to the correctInnoDB table by issuing aget orset request using@@table_id notation. This problem could also occur if you change an existing entry in theinnodb_memcache.containers table without restarting the MySQL server afterward. The free-form storage mechanism is flexible enough that your requests to store or retrieve a multi-column value such ascol1|col2|col3 may still work, even if the daemon is using thetest.demo_test table which stores values in a single column.

  • When defining your ownInnoDB table for use with thedaemon_memcached plugin, and columns in the table are defined asNOT NULL, ensure that values are supplied for theNOT NULL columns when inserting a record for the table into theinnodb_memcache.containers table. If theINSERT statement for theinnodb_memcache.containers record contains fewer delimited values than there are mapped columns, unfilled columns are set toNULL. Attempting to insert aNULL value into aNOT NULL column causes theINSERT to fail, which may only become evident after you reinitialize thedaemon_memcached plugin to apply changes to theinnodb_memcache.containers table.

  • Ifcas_column andexpire_time_column fields of theinnodb_memcached.containers table are set toNULL, the following error is returned when attempting to load thememcached plugin:

    InnoDB_Memcached: column 6 in the entry for config table 'containers' indatabase 'innodb_memcache' has an invalid NULL value.

    Thememcached plugin rejects usage ofNULL in thecas_column andexpire_time_column columns. Set the value of these columns to0 when the columns are unused.

  • As the length of thememcached key and values increase, you might encounter size and length limits.

    • When the key exceeds 250 bytes,memcached operations return an error. This is currently a fixed limit withinmemcached.

    • InnoDB table limits may be encountered if values exceed 768 bytes in size, 3072 bytes in size, or half of theinnodb_page_size value. These limits primarily apply if you intend to create an index on a value column to run report-generating queries on that column using SQL. SeeSection 17.22, “InnoDB Limits” for details.

    • The maximum size for the key-value combination is 1 MB.

  • If you share configuration files across MySQL servers of different versions, using the latest configuration options for thedaemon_memcached plugin could cause startup errors on older MySQL versions. To avoid compatibility problems, use theloose prefix with option names. For example, useloose-daemon_memcached_option='-c 64' instead ofdaemon_memcached_option='-c 64'.

  • 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 thememcached 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 amemcached connection does not have access to the server code.