HandlerSocket for Percona Server
2012-01-28 20:15
197 查看
HandlerSocket
Description
HandlerSocket is a MySQL plugin that implements a NoSQL protocol for MySQL. This allows applications to communicate more directly with MySQL storage engines, without the overhead associated with using SQL. This includes operations such as parsing and optimizing queries, as well as table handling operations (opening, locking, unlocking, closing). As a result, using HandlerSocket can provide much better performance for certain applications that using normal SQL application protocols.Complete documentation on the HandlerSocket plugin, including installation and configuration options, is located here.
The plugin is disabled by default. To enable it in Percona Server with XtraDB, see below.
Please be aware that this is currently an experimental feature, and use it as such.
Version Specific Information
5.1.52-12.3 Full functionality available.
Other InformationAuthor/Origin Akira Higuchi, DeNA Co., Ltd.
Enabling the Plugin
Once HandlerSocket has been downloaded and installed on your system, there are two steps required to enable it.First, add the following lines to the [mysqld] section of your my.cnf file:
loose_handlersocket_port = 9998 # the port number to bind to for read requests loose_handlersocket_port_wr = 9999 # the port number to bind to for write requests loose_handlersocket_threads = 16 # the number of worker threads for read requests loose_handlersocket_threads_wr = 1 # the number of worker threads for write requests open_files_limit = 65535 # to allow handlersocket to accept many concurrent # connections, make open_files_limit as large as # possible.Second, log in to mysql as root, and execute the following query:
mysql> install plugin handlersocket soname 'handlersocket.so';
Testing the Plugin installation
If handlersocket.so was successfully installed, it will begin accepting connections on ports 9998 and 9999. Executing a SHOW PROCESSLIST command should show HandlerSocket worker threads:mysql> SHOW PROCESSLIST; +----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-------------+-----------------+---------------+---------+------+-------------------------------------------+------------------+ | 1 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 2 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | ... | 16 | system user | connecting host | NULL | Connect | NULL | handlersocket: mode=rd, 0 conns, 0 active | NULL | | 17 | system user | connecting host | handlersocket | Connect | NULL | handlersocket: mode=wr, 0 conns, 0 active | NULL |To ensure HandlerSocket is working as expected, you can follow these steps:
Create a new table:
mysql> CREATE TABLE t ( id int(11) NOT NULL, col varchar(20) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB;Insert a row with HandlerSocket (fields are separated by tabs):
$ telnet 127.0.0.1 9999 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. P 1 test t PRIMARY id col 0 1 1 + 2 1 test value 0 1And check in SQL that the row has been written:
mysql> SELECT * FROM t; +----+------------+ | id | col | +----+------------+ | 1 | test value | +----+------------+
Configuration options
HandlerSocket has many configuration options that are detailed here.Other Reading
相关文章推荐
- 正常的javaWEB项目在win7机器启动报错警告: RMI TCP Accept-59825: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,p
- ORA-12520 TNS:Listener count not find available handler for requested type of server错误解决办法
- Downloading files from a server to client, using ASP.Net, when file size is too big for MemoryStream using Generic Handlers (ashx)
- NoSQL for MySQL [HandlerSocket] 之安装与使用
- SocketServer — A framework for network servers
- Warning: stream_socket_server() has been disabled for security reasons
- ORACLE ORA-12520 : TNS:listener could not find available handler for requested type of server
- Percona Server5.7.17二进制安装_for redhat 6.1
- Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
- Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
- flask_socket_io中报错RuntimeError: You need to use the eventlet server. See the Deployment section of the documentation for more information.的解决办法
- C Socket Programming for Linux with a Server and Client Example Code
- <Error> <Server> <BEA-002606> <Unable to create a server socket for listening on channel "Default[2
- HandlerSocket client for java――MySql as NoSQL
- 36:Kafka源码解读SocketServer下的Acceptor、Processor、Handler
- Percona Server for MySQL 5.5.30-30.2
- ORA-12520: TNS:listener could not find available handler for requested type of server
- SocketAsyncDataHandler SocketAsyncEventArgs ConcurrentAsyncQueue Server/Client
- 使用zookeeper的客户端上传文件时报Session 0x0 for server null, unexpected error, closing socket connection ..
- python多线程操作报错:No handlers could be found for logger "websocket"