X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmemaslap.html;h=3b3872b71fdaba3825bd45a8c0a1044ed9539441;hb=7a6ebf3a611e2e43aa496885f301c6826a49d25c;hp=ae2ba1d8c841889adb01f73d08f621ffc7360f5f;hpb=9ec5c6e833cbf875552665eabe5f07438d20ea1d;p=awesomized%2Flibmemcached diff --git a/bin/memaslap.html b/bin/memaslap.html index ae2ba1d8..3b3872b7 100644 --- a/bin/memaslap.html +++ b/bin/memaslap.html @@ -21,10 +21,10 @@ - - - - + + + + @@ -36,8 +36,8 @@ - - + +
@@ -85,63 +85,33 @@ -libmemcached
-libmemcachedutil
-libhashkit
Client Applications
-memaslap [options]
--help
¶--help
¶
MEMCACHED_SERVERS
¶MEMCACHED_SERVERS
¶
Memaslap manages network connections like memcached with libevent. Each thread of memaslap is bound with a CPU core, all -the threads donât communicate with each other, and there are several socket +the threads don't communicate with each other, and there are several socket connections in each thread. Each connection keeps key size distribution, value size distribution, and command distribution by itself.
You can specify servers via the memslap --servers
option or via the
-environment variable MEMCACHED_SERVERS
.
MEMCACHED_SERVERS
.
In addition, each thread has a libevent to manage the events of the network; each thread has one or more self-governed concurrency; and each -concurrency has one or more socket connections. All the concurrent tasks donât +concurrency has one or more socket connections. All the concurrent tasks don't communicate with each other even though they are in the same thread.
Memslap can create thousands of socket connections, and each concurrency has tens of socket connections. Each concurrency randomly or @@ -291,9 +265,9 @@ of the string to identify a string. It can save much memory. Each key contains two parts, a prefix and a suffix. The prefix is an uint64_t, 8 bytes. In order to verify the data set before, memaslap need to ensure each key is unique, so it uses the prefix to identify -a key. The prefix cannot include illegal characters, such as ârâ, ânâ, -â0â and â â. And memaslap has an algorithm to ensure that.
-Memslap doesnât generate all the objects (key-value pairs) at +a key. The prefix cannot include illegal characters, such as 'r', 'n', +'0' and ' '. And memaslap has an algorithm to ensure that.
+Memslap doesn't generate all the objects (key-value pairs) at the beginning. It only generates enough objects to fill the task window (default 10K objects) of each concurrency. Each object has the following basic information, key prefix, key suffix offset in the character table, key @@ -381,10 +355,10 @@ rest of the parameters have default values, as shown below:
All the distributions are read from the configuration file specified by user -with ââcfg_cmdâ option. If the user does not specify a configuration file, +with "âcfg_cmd" option. If the user does not specify a configuration file, memaslap will run with the default distribution (key size = 64, value size = 1024, get/set = 9:1). For information on how to edit the -configuration file, refer to the âConfiguration Fileâ section.
+configuration file, refer to the "Configuration File" section.The minimum key size is 16 bytes; the maximum key size is 250 bytes. The precision of proportion is 0.001. The proportion of distribution will be rounded to 3 decimal places.
@@ -398,9 +372,9 @@ the server.The high performance of memaslap benefits from the special -schedule of thread and concurrency. Itâs important to specify the proper +schedule of thread and concurrency. It's important to specify the proper number of them. The default number of threads is 1; the default number of -concurrency is 16. The user can use ââthreadsâ and ââconcurrencyâ to +concurrency is 16. The user can use "âthreads" and "--concurrency" to specify these variables.
If the system tests setting CPU affinity and the number of threads specified by the user is greater than 1, memaslap will try to @@ -411,21 +385,21 @@ the user can also be less or greater than the number of CPU cores. Because of the limitation of implementation, the number of concurrencies could be the multiple of the number of threads.
For 8 CPU cores system
For example:
-âthreads=2 âconcurrency=128
-âthreads=8 âconcurrency=128
-âthreads=8 âconcurrency=256
-âthreads=12 âconcurrency=144
+--threads=2 --concurrency=128
+--threads=8 --concurrency=128
+--threads=8 --concurrency=256
+--threads=12 --concurrency=144
For 16 CPU cores system
For example:
-âthreads=8 âconcurrency=128
-âthreads=16 âconcurrency=256
-âthreads=16 âconcurrency=512
-âthreads=24 âconcurrency=288
+--threads=8 --concurrency=128
+--threads=16 --concurrency=256
+--threads=16 --concurrency=512
+--threads=24 --concurrency=288
The memaslap performs very well, when used to test the performance of memcached servers. Most of the time, the bottleneck is the network or @@ -433,13 +407,13 @@ the server. If for some reason the user wants to limit the performance of memaslap, there are two ways to do this:
Decrease the number of threads and concurrencies. -Use the option ââtpsâ that memaslap +Use the option "--tps" that memaslap provides to limit the throughput. This option allows the user to get the expected throughput. For example, assume that the maximum throughput is 50 kops/s for a specific configuration, you can specify the throughput equal to or less than the maximum -throughput using ââtpsâ option.
+throughput using "--tps" option.1. Small cache cache_size=1M, 100% cache miss (all data get from SSD). win_size=10k
cache_size=4G
(1). cache miss rate 0%
win_size=8k
(2). cache miss rate 5%
win_size=11k
cache_size=16G
(1). cache miss rate 0%
win_size=32k
@@ -477,13 +451,13 @@ win_size=10kMemslap testss both data verification and expire-time -verification. The user can use ââverify=â or â-vâ to specify the proportion +verification. The user can use "--verify=" or "-v" to specify the proportion of data verification. In theory, it testss 100% data verification. The -user can use ââexp_verify=â or â-eâ to specify the proportion of +user can use "--exp_verify=" or "-e" to specify the proportion of expire-time verification. In theory, it testss 100% expire-time -verification. Specify the ââverboseâ options to get more detailed error +verification. Specify the "--verbose" options to get more detailed error information.
-For example: âexp_verify=0.01 âverify=0.1 , it means that 1% of the objects +
For example: --exp_verify=0.01 âverify=0.1 , it means that 1% of the objects set with expire-time, 10% of the objects gotten will be verified. If the objects are gotten, memaslap will verify the expire-time and value.
@@ -493,10 +467,10 @@ value.Memslap testss multi-servers based on self-governed thread. There is a limitation that the number of servers cannot be greater than the number of threads. Memslap assigns one thread to handle one -server at least. The user can use the ââservers=â or â-sâ option to specify +server at least. The user can use the "--servers=" or "-s" option to specify multi-servers.
For example:
-âservers=10.1.1.1:11211,10.1.1.2:11212,10.1.1.3:11213 âthreads=6 âconcurrency=36
+--servers=10.1.1.1:11211,10.1.1.2:11212,10.1.1.3:11213 --threads=6 --concurrency=36
The above command means that there are 6 threads, with each thread having 6 concurrencies and that threads 0 and 3 handle server 0 (10.1.1.1); threads 1 and 4 handle server 1 (10.1.1.2); and thread 2 and 5 handle server 2 @@ -515,64 +489,64 @@ is 10 minutes. If it times out, memaslap will exit. Do not specify both execute number mode and time mode at the same time; just specify one instead.
For example:
-âtime=30s (It means the test will run 30 seconds.)
-âexecute_number=100000 (It means that after running 100000 commands, the test will exit.)
+--time=30s (It means the test will run 30 seconds.)
+--execute_number=100000 (It means that after running 100000 commands, the test will exit.)
The user can use ââstat_freq=â or â-Sâ to specify the frequency.
+The user can use "--stat_freq=" or "-S" to specify the frequency.
For example:
-âstat_freq=20s
+--stat_freq=20s
Memslap will dump the statistics of the commands (get and set) at the frequency of every 20 seconds.
-For more information on the format of dumping statistic information, refer to âFormat of Outputâ section.
+For more information on the format of dumping statistic information, refer to "Format of Output" section.
The user can use ââdivision=â or â-dâ to specify multi-get keys count. +
The user can use "--division=" or "-d" to specify multi-get keys count. Memslap by default does single get with TCP. Memslap also testss data verification and expire-time verification for multi-get.
Memslap testss multi-get with both TCP and UDP. Because of the different implementation of the ASCII protocol and binary protocol, there are some differences between the two. For the ASCII protocol, -memaslap sends one âmulti-getâ to the server once. For the +memaslap sends one "multi-get" to the server once. For the binary protocol, memaslap sends several single get commands -together as âmulti-getâ to the server.
+together as "multi-get" to the server.Memslap testss both UDP and TCP. For TCP, memaslap does not reconnect the memcached server if socket connections are lost. If all the socket connections are lost or memcached server crashes, -memaslap will exit. If the user specifies the ââreconnectâ +memaslap will exit. If the user specifies the "--reconnect" option when socket connections are lost, it will reconnect them.
-User can use ââudpâ to enable the UDP feature, but UDP comes with some +
User can use "--udp" to enable the UDP feature, but UDP comes with some limitations:
UDP cannot set data more than 1400 bytes.
UDP is not tested by the binary protocol because the binary protocol of memcached does not tests that.
-UDP doesnât tests reconnection.
+UDP doesn't tests reconnection.
Set data with TCP and multi-get with UDP. Specify the following options:
-ââfacebook âdivision=50â
+"--facebook --division=50"
If you want to create thousands of TCP connections, specify the
-ââconn_sock=â option.
-For example: âfacebook âdivision=50 âconn_sock=200
+"--conn_sock=" option.
+For example: --facebook --division=50 --conn_sock=200
The above command means that memaslap will do facebook test, each concurrency has 200 socket TCP connections and one UDP socket.
Memslap sets objects with the TCP socket, and multi-gets 50 objects once with the UDP socket.
-If you specify ââdivision=50â, the key size must be less that 25 bytes +
If you specify "--division=50", the key size must be less that 25 bytes because the UDP packet size is 1400 bytes.
For replication test, the user must specify at least two memcached servers. -The user can use âârep_write=â option to enable feature.
+The user can use "ârep_write=" option to enable feature.For example:
-âservers=10.1.1.1:11211,10.1.1.2:11212 ârep_write=2
+--servers=10.1.1.1:11211,10.1.1.2:11212 ârep_write=2
The above command means that there are 2 replication memcached servers, memaslap will set objects to both server 0 and server 1, get objects which are set to server 0 before from server 1, and also get objects @@ -583,12 +557,12 @@ server 0 and server 1 crash, memaslap will exit.
Start memaslap with ââconn_sock=â or â-nâ to enable this +
Start memaslap with "--conn_sock=" or "-n" to enable this feature. Make sure that your system can tests opening thousands of files and creating thousands of sockets. However, this feature does not tests reconnection if sockets disconnect.
For example:
-âthreads=8 âconcurrency=128 âconn_sock=128
+--threads=8 --concurrency=128 --conn_sock=128
The above command means that memaslap starts up 8 threads, each thread has 16 concurrencies, each concurrency has 128 TCP socket connections, and the total number of TCP socket connections is 128 * 128 = @@ -596,15 +570,15 @@ connections, and the total number of TCP socket connections is 128 * 128 =
Start memaslap with ââbinaryâ or â-Bâ options to enable this +
Start memaslap with "--binary" or "-B" options to enable this feature. It testss all the above features except UDP, because the latest memcached 1.3.3 does not implement binary UDP protocol.
For example:
-âbinary
-Since memcached 1.3.3 doesnât implement binary UDP protocol, +
--binary
+Since memcached 1.3.3 doesn't implement binary UDP protocol, memaslap does not tests UDP. In addition, memcached 1.3.3 does not tests -multi-get. If you specify ââdivision=50â option, it just sends 50 get -commands together as âmulti-getâ to the server.
+multi-get. If you specify "--division=50" option, it just sends 50 get +commands together as "multi-get" to the server.get proportion: get_prop=0.90
servers : âserversâ
+servers : "servers"
-+The servers used by memaslap.
-
threads count
-+The number of threads memaslap runs with.
-
concurrency
-+The number of concurrencies memaslap runs with.
-
run time
-+How long to run memaslap.
-
windows size
-+The task window size of each concurrency.
-
set proportion
-+The proportion of set command.
-
get proportion
-+The proportion of get command.
-
The output of dynamic statistics is something like this:
---------------------------------------------------------------------------------------------------------------------------------
Get Statistics
@@ -760,60 +727,46 @@ one located at ~/.memaslap.cnf.
Where¶
Get Statistics
-Statistics information of get command
-
+Statistics information of get command
Set Statistics
-Statistics information of set command
-
+Statistics information of set command
Total Statistics
-Statistics information of both get and set command
-
+Statistics information of both get and set command
Period
-Result within a period
-
+Result within a period
Global
-Accumulated results
-
+Accumulated results
Ops
-Total operations
-
+Total operations
TPS
-Throughput, operations/second
-
+Throughput, operations/second
Net
-The rate of network
-
+The rate of network
Get_miss
-How many objects canât be gotten
-
+How many objects can't be gotten
Min
-The minimum response time
-
+The minimum response time
Max
-The maximum response time
-
+The maximum response time
Avg:
-The average response time
-
+The average response time
Std_dev
-Standard deviation of response time
-
+Standard deviation of response time
Geo_dist
-Geometric distribution based on natural exponential function
-
+Geometric distribution based on natural exponential function
At the end, memaslap will output something like this:
---------------------------------------------------------------------------------------------------------------------------------
Get Statistics (1257956 events)
@@ -872,177 +825,161 @@ one located at ~/.memaslap.cnf.
Where¶
Get Statistics
-Get statistics of response time
-
+Get statistics of response time
Set Statistics
-Set statistics of response time
-
+Set statistics of response time
Total Statistics
-Both get and set statistics of response time
-
+Both get and set statistics of response time
Min
-The accumulated and minimum response time
-
+The accumulated and minimum response time
Max
-The accumulated and maximum response time
-
+The accumulated and maximum response time
Avg
-The accumulated and average response time
-
+The accumulated and average response time
Std
-Standard deviation of response time
-
+Standard deviation of response time
Log2 Dist
-Geometric distribution based on logarithm 2
-
+Geometric distribution based on logarithm 2
cmd_get
-Total get commands done
-
+Total get commands done
cmd_set
-Total set commands done
-
+Total set commands done
get_misses
-How many objects canât be gotten from server
-
+How many objects can't be gotten from server
verify_misses
-How many objects need to verify but canât get them
-
+How many objects need to verify but can't get them
verify_failed
-How many objects with insistent value
-
+How many objects with insistent value
expired_get
-How many objects are expired but we get them
-
+How many objects are expired but we get them
unexpired_unget
-How many objects are unexpired but we canât get them
-
+How many objects are unexpired but we can't get them
written_bytes
-Total written bytes
-
+Total written bytes
read_bytes
-Total read bytes
-
+Total read bytes
object_bytes
-Total object bytes
-
+Total object bytes
packet_disorder
-How many UDP packages are disorder
-
+How many UDP packages are disorder
packet_drop
-How many UDP packages are lost
-
+How many UDP packages are lost
udp_timeout
-How many times UDP time out happen
-
+How many times UDP time out happen
Run time
-Total run time
-
+Total run time
Ops
-Total operations
-
+Total operations
TPS
-Throughput, operations/second
-
+Throughput, operations/second
Net_rate
-The average rate of network
-
+The average rate of network
OPTIONS¶
-
-- -s, âservers=
List one or more servers to connect. Servers count must be less than
-threads count. e.g.: âservers=localhost:1234,localhost:11211
-
-- -T, âthreads=
Number of threads to startup, better equal to CPU numbers. Default 8.
-
-- -c, âconcurrency=
Number of concurrency to simulate with load. Default 128.
-
-- -n, âconn_sock=
Number of TCP socks per concurrency. Default 1.
-
-- -x, âexecute_number=
Number of operations(get and set) to execute for the
-given test. Default 1000000.
-
-- -t, âtime=
How long the test to run, suffix: s-seconds, m-minutes, h-hours,
-d-days e.g.: âtime=2h.
-
-- -F, âcfg_cmd=
Load the configure file to get command,key and value distribution list.
-
-- -w, âwin_size=
Task window size of each concurrency, suffix: K, M e.g.: âwin_size=10k.
-Default 10k.
-
-- -X, âfixed_size=
Fixed length of value.
-
-- -v, âverify=
The proportion of date verification, e.g.: âverify=0.01
-
-- -d, âdivision=
Number of keys to multi-get once. Default 1, means single get.
-
-- -S, âstat_freq=
Frequency of dumping statistic information. suffix: s-seconds,
-m-minutes, e.g.: âresp_freq=10s.
-
-- -e, âexp_verify=
The proportion of objects with expire time, e.g.: âexp_verify=0.01.
-Default no object with expire time
-
-- -o, âoverwrite=
The proportion of objects need overwrite, e.g.: âoverwrite=0.01.
-Default never overwrite object.
-
-
-
-- -R, --reconnect
-Reconnect tests, when connection is closed it will be reconnected.
-
-- -U, --udp
-UDP tests, default memaslap uses TCP, TCP port and UDP port of
-server must be same.
-
-- -a, --facebook
-Whether it enables facebook test feature, set with TCP and multi-get with UDP.
-
-- -B, --binary
-Whether it enables binary protocol. Default with ASCII protocol.
-
-
-
-- -P, âtps=
Expected throughput, suffix: K, e.g.: âtps=10k.
-
-- -p, ârep_write=
The first nth servers can write data, e.g.: ârep_write=2.
-
+
+- -s, --servers=
+- List one or more servers to connect. Servers count must be less than
+threads count. e.g.: --servers=localhost:1234,localhost:11211
+- -T, --threads=
+- Number of threads to startup, better equal to CPU numbers. Default 8.
+- -c, --concurrency=
+- Number of concurrency to simulate with load. Default 128.
+- -n, --conn_sock=
+- Number of TCP socks per concurrency. Default 1.
+- -x, --execute_number=
+- Number of operations(get and set) to execute for the
+given test. Default 1000000.
+- -t, --time=
+- How long the test to run, suffix: s-seconds, m-minutes, h-hours,
+d-days e.g.: --time=2h.
+- -F, --cfg_cmd=
+- Load the configure file to get command,key and value distribution list.
+- -w, --win_size=
+- Task window size of each concurrency, suffix: K, M e.g.: --win_size=10k.
+Default 10k.
+- -X, --fixed_size=
+- Fixed length of value.
+- -v, --verify=
+- The proportion of date verification, e.g.: --verify=0.01
+- -d, --division=
+- Number of keys to multi-get once. Default 1, means single get.
+- -S, --stat_freq=
+- Frequency of dumping statistic information. suffix: s-seconds,
+m-minutes, e.g.: --resp_freq=10s.
+- -e, --exp_verify=
+- The proportion of objects with expire time, e.g.: --exp_verify=0.01.
+Default no object with expire time
+- -o, --overwrite=
+- The proportion of objects need overwrite, e.g.: --overwrite=0.01.
+Default never overwrite object.
-
-- -b, --verbose
-Whether it outputs detailed information when verification fails.
-
-- -h, --help
-Display this message and then exit.
-
-- -V, --version
-Display the version of the application and then exit.
-
+
+
+
+
+
+-R, --reconnect
+
+ Reconnect tests, when connection is closed it will be reconnected.
+
+-U, --udp
+UDP tests, default memaslap uses TCP, TCP port and UDP port of
+server must be same.
+
+-a, --facebook
+Whether it enables facebook test feature, set with TCP and multi-get with UDP.
+
+-B, --binary
+Whether it enables binary protocol. Default with ASCII protocol.
+
+
+
+- -P, --tps=
+- Expected throughput, suffix: K, e.g.: --tps=10k.
+- -p, --rep_write=
+- The first nth servers can write data, e.g.: --rep_write=2.
+
+
+
+
+
+-b, --verbose
+Whether it outputs detailed information when verification fails.
+
+-h, --help
+Display this message and then exit.
+
+-V, --version
+Display the version of the application and then exit.
+
+
EXAMPLES¶
@@ -1067,10 +1004,10 @@ server must be same.