In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Redis- performance Test "> what the editor shares with you today is the case of using redis performance test and client connection. Many people don't know much about it. Today, in order to let you know more about the method of redis performance test and client connection, the editor summarizes the following contents and looks down together. There will be something to gain.
Redis performance test
Syntax:
Redis-benchmark [option] [option value] instance
Example one
The following example executes 1000 requests simultaneously to test performance:
$redis-benchmark-n 1000-Q
Ps: local docker does not support commands for the time being. Skip the result, please test it yourself.
Redis:6379 > benchmark-n 1000-Q (error) ERR unknown command 'benchmark'
Example two
The host is 127.0.0.1, the port number is 6379, the command executed is set, lpush, and the number of requests is 1000. The result shows only the number of requests executed per second through the-Q parameter.
$redis-benchmark-h 127.0.0.1-p 6379-t set,lpush-n 1000-Q performance test parameters
Serial number option description default value 1MyH specify server hostname 127.0.0.12murp specify server port 63793murs specify server socket4-c specify number of concurrent connections 505-n specify number of requests 100006-d specify data size of SET/GET value in bytes 27-k1=keep alive 0=reconnect18-rSET/GET/INCR uses random key, SADD uses random value
9Murp forcibly exits redis through a pipeline transmission request 110Murq. Show only query/sec values
11-csv output in CSV format
12murl generates a loop that permanently executes the test
13murt only runs a comma-separated list of test commands.
14-IIdle mode. Open only N idle connections and wait.
Redis client connection
Redis receives connections from clients by listening on a TCP port or Unix socket. When a connection is established, the following operations will be performed within Redis:
First, the client socket is set to non-blocking mode because Redis uses a non-blocking multiplexing model for network event handling.
Then set the TCP_NODELAY property for the socket to disable the Nagle algorithm
Then create a readable file event to listen to the data sent by the client socket
Maximum number of connections
Redis:6379 > config get maxclients1) "maxclients" 2) "10000" instance
Set the maximum number of connections to 999 at startup
Redis-server-- maxclients 999 client command
S.N. Command description 1CLIENT LIST returns the list of clients connected to the redis service 2CLIENT SETNAME sets the name of the current connection 3CLIENT GETNAME gets the service name set by the CLIENT SETNAME command 4CLIENT PAUSE suspends the client connection, specifies the suspension time in milliseconds 5CLIENT KILL closes the client connection
The above is a brief introduction to the case of using redis performance test to connect with the client. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.