Spec-Zone .ru
спецификации, руководства, описания, API
|
The following list shows some potential issues you might encounter using the InnoDB
memcached daemon, 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 requestingsmaller 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 -n1024ulimit -n 4096$ ulimit -n4096# OS X Lion (10.6)$ ulimit -n256ulimit -n 4096$ ulimit -n4096
The other solution is to reduce the number of concurrent connections available for the memcached daemon, using the -c
option which defaults to 1024. Encode that memcached option using the MySQL option daemon_memcached_option
inside 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 InnoDB
table,
specify the memcached option -vvv
through 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.
If the daemon_memcached
plugin 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:
daemon_memcached=OFF
For example, if you run the install plugin
command before running the
scripts/innodb_memcached_config.sql
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.containers
table, 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 daemon_memcached_option
configuration option.
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.containers
table, or do not switch to that table by issuing a GET
or SET
request with the key @@
,
or make a change to an existing entry in table_id
innodb_memcache.containers
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 like col1|col2|col3
will
usually still work, even if the daemon is using the test.demo_test
table
which stores all the data within a single column.
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 1/2 of the size
specified by innodb_page_size
. 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.2.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
loose
forms of these option names, for example loose-daemon_memcached_option='-c
64'
instead of daemon_memcached_option='-c 64'
.