More documentation fixing.
[m6w6/libmemcached] / docs / memaslap.rst
1 ========
2 memaslap
3 ========
4
5
6 memaslap - Load testing and benchmarking tool for memcached
7
8
9 ********
10 SYNOPSIS
11 ********
12
13
14
15 .. code-block:: perl
16
17 memaslap [options]
18
19
20
21 ***********
22 DESCRIPTION
23 ***********
24
25
26 \ **memaslap**\ is a load generation and benchmark tool for memcached(1)
27 servers. It generates configurable workload such as threads, concurrencies, connections,
28 run time, overwrite, miss rate, key size, value size, get/set proportion,
29 expected throughput, and so on. Furthermore, it also testss data
30 verification, expire-time verification, UDP, binary protocol, facebook test,
31 replication test, multi-get and reconnection, etc.
32
33 Memslap manages network connections like memcached with
34 libevent. Each thread of memaslap is bound with a CPU core, all
35 the threads don't communicate with each other, and there are several socket
36 connections in each thread. Each connection keeps key size distribution,
37 value size distribution, and command distribution by itself.
38
39 You can specify servers via the \ **--servers**\ option or via the
40 environment variable \ ``MEMCACHED_SERVERS``\ .
41
42
43 ********
44 FEATURES
45 ********
46
47
48 Memslap is developed to for the following purposes:
49
50
51 Manages network connections with libevent asynchronously.
52
53
54
55 Set both TCP and UDP up to use non-blocking IO.
56
57
58
59 Improves parallelism: higher performance in multi-threads environments.
60
61
62
63 Improves time efficiency: faster processing speed.
64
65
66
67 Generates key and value more efficiently; key size distribution and value size distribution are configurable.
68
69
70
71 Supports get, multi-get, and set commands; command distribution is configurable.
72
73
74
75 Supports controllable miss rate and overwrite rate.
76
77
78
79 Supports data and expire-time verification.
80
81
82
83 Supports dumping statistic information periodically.
84
85
86
87 Supports thousands of TCP connections.
88
89
90
91 Supports binary protocol.
92
93
94
95 Supports facebook test (set with TCP and multi-get with UDP) and replication test.
96
97
98
99
100 *******
101 DETAILS
102 *******
103
104
105 Effective implementation of network.
106 ____________________________________
107
108
109 For memaslap, both TCP and UDP use non-blocking network IO. All
110 the network events are managed by libevent as memcached. The network module
111 of memaslap is similar to memcached. Libevent can ensure
112 memaslap can handle network very efficiently.
113
114
115 Effective implementation of multi-threads and concurrency
116 _________________________________________________________
117
118
119 Memslap has the similar implementation of multi-threads to
120 memcached. Memslap creates one or more self-governed threads;
121 each thread is bound with one CPU core if the system testss setting CPU
122 core affinity.
123
124 In addition, each thread has a libevent to manage the events of the network;
125 each thread has one or more self-governed concurrencies; and each
126 concurrency has one or more socket connections. All the concurrencies don’t
127 communicate with each other even though they are in the same thread.
128
129 Memslap can create thousands of socket connections, and each
130 concurrency has tens of socket connections. Each concurrency randomly or
131 sequentially selects one socket connection from its socket connection pool
132 to run, so memaslap can ensure each concurrency handles one
133 socket connection at any given time. Users can specify the number of
134 concurrency and socket connections of each concurrency according to their
135 expected workload.
136
137
138 Effective implementation of generating key and value
139 ____________________________________________________
140
141
142 In order to improve time efficiency and space efficiency,
143 memaslap creates a random characters table with 10M characters. All the
144 suffixes of keys and values are generated from this random characters table.
145
146 Memslap uses the offset in the character table and the length
147 of the string to identify a string. It can save much memory.
148 Each key contains two parts, a prefix and a suffix. The prefix is an
149 uint64_t, 8 bytes. In order to verify the data set before,
150 memaslap need to ensure each key is unique, so it uses the prefix to identify
151 a key. The prefix cannot include illegal characters, such as ‘\r’, ‘\n’,
152 ‘\0’ and ‘ ‘. And memaslap has an algorithm to ensure that.
153
154 Memslap doesn’t generate all the objects (key-value pairs) at
155 the beginning. It only generates enough objects to fill the task window
156 (default 10K objects) of each concurrency. Each object has the following
157 basic information, key prefix, key suffix offset in the character table, key
158 length, value offset in the character table, and value length.
159
160 In the work process, each concurrency sequentially or randomly selects an
161 object from the window to do set operation or get operation. At the same
162 time, each concurrency kicks objects out of its window and adds new object
163 into it.
164
165
166 Simple but useful task scheduling
167 _________________________________
168
169
170 Memslap uses libevent to schedule all the concurrencies of
171 threads, and each concurrency schedules tasks based on the local task
172 window. Memslap assumes that if each concurrency keeps the same
173 key distribution, value distribution and commands distribution, from
174 outside, memaslap keeps all the distribution as a whole.
175 Each task window includes a lot of objects, each object stores its basic
176 information, such as key, value, expire time, and so on. At any time, all
177 the objects in the window keep the same and fixed key and value
178 distribution. If an object is overwritten, the value of the object will be
179 updated. Memslap verifies the data or expire-time according to
180 the object information stored in the task window.
181
182 Libevent selects which concurrency to handle based on a specific network
183 event. Then the concurrency selects which command (get or set) to operate
184 based on the command distribution. If it needs to kick out an old object and
185 add a new object, in order to keep the same key and value distribution, the
186 new object must have the same key length and value length.
187
188 If memcached server has two cache layers (memory and SSD), running
189 memaslap with different window sizes can get different cache
190 miss rates. If memaslap adds enough objects into the windows at
191 the beginning, and the cache of memcached cannot store all the objects
192 initialized, then memaslap will get some objects from the second
193 cache layer. It causes the first cache layer to miss. So the user can
194 specify the window size to get the expected miss rate of the first cache
195 layer.
196
197
198 Useful implementation of multi-servers , UDP, TCP, multi-get and binary protocol
199 ________________________________________________________________________________
200
201
202 Because each thread is self-governed, memaslap can assign
203 different threads to handle different memcached servers. This is just one of
204 the ways in which memaslap testss multiple servers. The only
205 limitation is that the number of servers cannot be greater than the number
206 of threads. The other way to tests multiple servers is for replication
207 test. Each concurrency has one socket connection to each memcached server.
208 For the implementation, memaslap can set some objects to one
209 memcached server, and get these objects from the other servers.
210
211 By default, Memslap does single get. If the user specifies
212 multi-get option, memaslap will collect enough get commands and
213 pack and send the commands together.
214
215 Memslap testss both the ASCII protocol and binary protocol,
216 but it runs on the ASCII protocol by default.
217 Memslap by default runs on the TCP protocol, but it also
218 testss UDP. Because UDP is unreliable, dropped packages and out-of-order
219 packages may occur. Memslap creates a memory buffer to handle
220 these problems. Memslap tries to read all the response data of
221 one command from the server and reorders the response data. If some packages
222 get lost, the waiting timeout mechanism can ensure half-baked packages will
223 be discarded and the next command will be sent.
224
225
226
227 *****
228 USAGE
229 *****
230
231
232 Below are some usage samples:
233
234
235 memaslap -s 127.0.0.1:11211 -S 5s
236
237
238
239 memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b
240
241
242
243 memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2
244
245
246
247 memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k
248
249
250
251 memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40
252
253
254
255 memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m
256
257
258
259 memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2
260
261
262
263 The user must specify one server at least to run memaslap. The
264 rest of the parameters have default values, as shown below:
265
266 Thread number = 1 Concurrency = 16
267
268 Run time = 600 seconds Configuration file = NULL
269
270 Key size = 64 Value size = 1024
271
272 Get/set = 9:1 Window size = 10k
273
274 Execute number = 0 Single get = true
275
276 Multi-get = false Number of sockets of each concurrency = 1
277
278 Reconnect = false Data verification = false
279
280 Expire-time verification = false ASCII protocol = true
281
282 Binary protocol = false Dumping statistic information
283
284 periodically = false
285
286 Overwrite proportion = 0% UDP = false
287
288 TCP = true Limit throughput = false
289
290 Facebook test = false Replication test = false
291
292 Key size, value size and command distribution.
293 ______________________________________________
294
295
296 All the distributions are read from the configuration file specified by user
297 with “—cfg_cmd” option. If the user does not specify a configuration file,
298 memaslap will run with the default distribution (key size = 64,
299 value size = 1024, get/set = 9:1). For information on how to edit the
300 configuration file, refer to the “Configuration File” section.
301
302 The minimum key size is 16 bytes; the maximum key size is 250 bytes. The
303 precision of proportion is 0.001. The proportion of distribution will be
304 rounded to 3 decimal places.
305
306 The minimum value size is 1 bytes; the maximum value size is 1M bytes. The
307 precision of proportion is 0.001. The proportion of distribution will be
308 rounded to 3 decimal places.
309 Currently, memaslap only testss set and get commands. And it
310 testss 100% set and 100% get. For 100% get, it will preset some objects to
311 the server.
312
313
314 Multi-thread and concurrency
315 ____________________________
316
317
318 The high performance of memaslap benefits from the special
319 schedule of thread and concurrency. It’s important to specify the proper
320 number of them. The default number of threads is 1; the default number of
321 concurrency is 16. The user can use “—threads” and “--concurrency” to
322 specify these variables.
323
324 If the system testss setting CPU affinity and the number of threads
325 specified by the user is greater than 1, memaslap will try to
326 bind each thread to a different CPU core. So if you want to get the best
327 performance memaslap, it is better to specify the number of
328 thread equal to the number of CPU cores. The number of threads specified by
329 the user can also be less or greater than the number of CPU cores. Because
330 of the limitation of implementation, the number of concurrencies could be
331 the multiple of the number of threads.
332
333 1. For 8 CPU cores system
334
335 For example:
336
337 --threads=2 --concurrency=128
338
339 --threads=8 --concurrency=128
340
341 --threads=8 --concurrency=256
342
343 --threads=12 --concurrency=144
344
345 2. For 16 CPU cores system
346
347 For example:
348
349 --threads=8 --concurrency=128
350
351 --threads=16 --concurrency=256
352
353 --threads=16 --concurrency=512
354
355 --threads=24 --concurrency=288
356
357 The memaslap performs very well, when
358 used to test the performance of memcached servers.
359 Most of the time, the bottleneck is the network or
360 the server. If for some reason the user wants to
361 limit the performance of memaslap, there
362 are two ways to do this:
363
364 Decrease the number of threads and concurrencies.
365 Use the option “--tps” that memaslap
366 provides to limit the throughput. This option allows
367 the user to get the expected throughput. For
368 example, assume that the maximum throughput is 50
369 kops/s for a specific configuration, you can specify
370 the throughput equal to or less than the maximum
371 throughput using “--tps” option.
372
373
374 Window size
375 ___________
376
377
378 Most of the time, the user does not need to specify the window size. The
379 default window size is 10k. For Schooner Memcached, the user can specify
380 different window sizes to get different cache miss rates based on the test
381 case. Memslap testss cache miss rate between 0% and 100%.
382 If you use this utility to test the performance of Schooner Memcached, you
383 can specify a proper window size to get the expected cache miss rate. The
384 formula for calculating window size is as follows:
385
386 Assume that the key size is 128 bytes, and the value size is 2048 bytes, and
387 concurrency=128.
388
389 1. Small cache cache_size=1M, 100% cache miss (all data get from SSD).
390 win_size=10k
391
392 2. cache_size=4G
393
394 (1). cache miss rate 0%
395
396 win_size=8k
397
398 (2). cache miss rate 5%
399
400 win_size=11k
401
402 3. cache_size=16G
403
404 (1). cache miss rate 0%
405
406 win_size=32k
407
408 (2). cache miss
409
410 rate 5%
411
412 win_size=46k
413
414 The formula for calculating window size for cache miss rate 0%:
415
416 cache_size / concurrency / (key_size + value_size) \* 0.5
417
418 The formula for calculating window size for cache miss rate 5%:
419
420 cache_size / concurrency / (key_size + value_size) \* 0.7
421
422
423 Verification
424 ____________
425
426
427 Memslap testss both data verification and expire-time
428 verification. The user can use "--verify=" or "-v" to specify the proportion
429 of data verification. In theory, it testss 100% data verification. The
430 user can use "--exp_verify=" or "-e" to specify the proportion of
431 expire-time verification. In theory, it testss 100% expire-time
432 verification. Specify the "--verbose" options to get more detailed error
433 information.
434
435 For example: --exp_verify=0.01 –verify=0.1 , it means that 1% of the objects
436 set with expire-time, 10% of the objects gotten will be verified. If the
437 objects are gotten, memaslap will verify the expire-time and
438 value.
439
440
441 multi-servers and multi-config
442 _______________________________
443
444
445 Memslap testss multi-servers based on self-governed thread.
446 There is a limitation that the number of servers cannot be greater than the
447 number of threads. Memslap assigns one thread to handle one
448 server at least. The user can use the "--servers=" or "-s" option to specify
449 multi-servers.
450
451 For example:
452
453 --servers=10.1.1.1:11211,10.1.1.2:11212,10.1.1.3:11213 --threads=6 --concurrency=36
454
455 The above command means that there are 6 threads, with each thread having 6
456 concurrencies and that threads 0 and 3 handle server 0 (10.1.1.1); threads 1
457 and 4 handle server 1 (10.1.1.2); and thread 2 and 5 handle server 2
458 (10.1.1.3).
459
460 All the threads and concurrencies in memaslap are self-governed.
461
462 So is memaslap. The user can start up several
463 memaslap instances. The user can run memaslap on different client
464 machines to communicate with the same memcached server at the same. It is
465 recommended that the user start different memaslap on different
466 machines using the same configuration.
467
468
469 Run with execute number mode or time mode
470 _________________________________________
471
472
473 The default memaslap runs with time mode. The default run time
474 is 10 minutes. If it times out, memaslap will exit. Do not
475 specify both execute number mode and time mode at the same time; just
476 specify one instead.
477
478 For example:
479
480 --time=30s (It means the test will run 30 seconds.)
481
482 --execute_number=100000 (It means that after running 100000 commands, the test will exit.)
483
484
485 Dump statistic information periodically.
486 ________________________________________
487
488
489 The user can use "--stat_freq=" or "-S" to specify the frequency.
490
491 For example:
492
493 --stat_freq=20s
494
495 Memslap will dump the statistics of the commands (get and set) at the frequency of every 20
496 seconds.
497
498 For more information on the format of dumping statistic information, refer to “Format of Output” section.
499
500
501 Multi-get
502 _________
503
504
505 The user can use "--division=" or "-d" to specify multi-get keys count.
506 Memslap by default does single get with TCP. Memslap also testss data
507 verification and expire-time verification for multi-get.
508
509 Memslap testss multi-get with both TCP and UDP. Because of
510 the different implementation of the ASCII protocol and binary protocol,
511 there are some differences between the two. For the ASCII protocol,
512 memaslap sends one “multi-get” to the server once. For the
513 binary protocol, memaslap sends several single get commands
514 together as “multi-get” to the server.
515
516
517 UDP and TCP
518 ___________
519
520
521 Memslap testss both UDP and TCP. For TCP,
522 memaslap does not reconnect the memcached server if socket connections are
523 lost. If all the socket connections are lost or memcached server crashes,
524 memaslap will exit. If the user specifies the “--reconnect”
525 option when socket connections are lost, it will reconnect them.
526
527 User can use “--udp” to enable the UDP feature, but UDP comes with some
528 limitations:
529
530 UDP cannot set data more than 1400 bytes.
531
532 UDP is not testsed by the binary protocol because the binary protocol of
533 memcached does not tests that.
534
535 UDP doesn’t tests reconnection.
536
537
538 Facebook test
539 _____________
540
541
542 Set data with TCP and multi-get with UDP. Specify the following options:
543
544 "--facebook --division=50"
545
546 If you want to create thousands of TCP connections, specify the
547
548 "--conn_sock=" option.
549
550 For example: --facebook --division=50 --conn_sock=200
551
552 The above command means that memaslap will do facebook test,
553 each concurrency has 200 socket TCP connections and one UDP socket.
554
555 Memslap sets objects with the TCP socket, and multi-gets 50
556 objects once with the UDP socket.
557
558 If you specify "--division=50", the key size must be less that 25 bytes
559 because the UDP packet size is 1400 bytes.
560
561
562 Replication test
563 ________________
564
565
566 For replication test, the user must specify at least two memcached servers.
567 The user can use “—rep_write=” option to enable feature.
568
569 For example:
570
571 --servers=10.1.1.1:11211,10.1.1.2:11212 –rep_write=2
572
573 The above command means that there are 2 replication memcached servers,
574 memaslap will set objects to both server 0 and server 1, get
575 objects which are set to server 0 before from server 1, and also get objects
576 which are set to server 1 before from server 0. If server 0 crashes,
577 memaslap will only get objects from server 1. If server 0 comes
578 back to life again, memaslap will reconnect server 0. If both
579 server 0 and server 1 crash, memaslap will exit.
580
581
582 Supports thousands of TCP connections
583 _____________________________________
584
585
586 Start memaslap with "--conn_sock=" or "-n" to enable this
587 feature. Make sure that your system can tests opening thousands of files
588 and creating thousands of sockets. However, this feature does not tests
589 reconnection if sockets disconnect.
590
591 For example:
592
593 --threads=8 --concurrency=128 --conn_sock=128
594
595 The above command means that memaslap starts up 8 threads, each
596 thread has 16 concurrencies, each concurrency has 128 TCP socket
597 connections, and the total number of TCP socket connections is 128 \* 128 =
598 16384.
599
600
601 Supports binary protocol
602 ________________________
603
604
605 Start memaslap with "--binary" or "-B" options to enable this
606 feature. It testss all the above features except UDP, because the latest
607 memcached 1.3.3 does not implement binary UDP protocol.
608
609 For example:
610
611 --binary
612
613 Since memcached 1.3.3 doesn't implement binary UDP protocol,
614 memaslap does not tests UDP. In addition, memcached 1.3.3 does not tests
615 multi-get. If you specify "--division=50" option, it just sends 50 get
616 commands together as “mulit-get” to the server.
617
618
619
620 ******************
621 Configuration file
622 ******************
623
624
625 This section describes the format of the configuration file. By default
626 when no configuration file is specified memaslap reads the default
627 one located at ~/.memaslap.cnf.
628
629 Below is a sample configuration file:
630
631
632 .. code-block:: perl
633
634 ***************************************************************************
635 #comments should start with '#'
636 #key
637 #start_len end_len proportion
638 #
639 #key length range from start_len to end_len
640 #start_len must be equal to or greater than 16
641 #end_len must be equal to or less than 250
642 #start_len must be equal to or greater than end_len
643 #memaslap will generate keys according to the key range
644 #proportion: indicates keys generated from one range accounts for the total
645 generated keys
646 #
647 #example1: key range 16~100 accounts for 80%
648 # key range 101~200 accounts for 10%
649 # key range 201~250 accounts for 10%
650 # total should be 1 (0.8+0.1+0.1 = 1)
651 #
652 # 16 100 0.8
653 # 101 200 0.1
654 # 201 249 0.1
655 #
656 #example2: all keys length are 128 bytes
657 #
658 # 128 128 1
659 key
660 128 128 1
661 #value
662 #start_len end_len proportion
663 #
664 #value length range from start_len to end_len
665 #start_len must be equal to or greater than 1
666 #end_len must be equal to or less than 1M
667 #start_len must be equal to or greater than end_len
668 #memaslap will generate values according to the value range
669 #proportion: indicates values generated from one range accounts for the
670 total generated values
671 #
672 #example1: value range 1~1000 accounts for 80%
673 # value range 1001~10000 accounts for 10%
674 # value range 10001~100000 accounts for 10%
675 # total should be 1 (0.8+0.1+0.1 = 1)
676 #
677 # 1 1000 0.8
678 # 1001 10000 0.1
679 # 10001 100000 0.1
680 #
681 #example2: all value length are 128 bytes
682 #
683 # 128 128 1
684 value
685 2048 2048 1
686 #cmd
687 #cmd_type cmd_proportion
688 #
689 #currently memaslap only testss get and set command.
690 #
691 #cmd_type
692 #set 0
693 #get 1
694 #
695 #example: set command accounts for 50%
696 # get command accounts for 50%
697 # total should be 1 (0.5+0.5 = 1)
698 #
699 # cmd
700 # 0 0.5
701 # 1 0.5
702 cmd
703 0 0.1
704 1.0 0.9
705
706
707
708 ****************
709 Format of output
710 ****************
711
712
713 At the beginning, memaslap displays some configuration information as follows:
714
715
716 servers : 127.0.0.1:11211
717
718
719
720 threads count: 1
721
722
723
724 concurrency: 16
725
726
727
728 run time: 20s
729
730
731
732 windows size: 10k
733
734
735
736 set proportion: set_prop=0.10
737
738
739
740 get proportion: get_prop=0.90
741
742
743
744 Where
745 _____
746
747
748
749 servers : "servers"
750
751 The servers used by memaslap.
752
753
754
755 threads count
756
757 The number of threads memaslap runs with.
758
759
760
761 concurrency
762
763 The number of concurrencies memaslap runs with.
764
765
766
767 run time
768
769 How long to run memaslap.
770
771
772
773 windows size
774
775 The task window size of each concurrency.
776
777
778
779 set proportion
780
781 The proportion of set command.
782
783
784
785 get proportion
786
787 The proportion of get command.
788
789
790
791 The output of dynamic statistics is something like this:
792
793
794 .. code-block:: perl
795
796 ---------------------------------------------------------------------------------------------------------------------------------
797 Get Statistics
798 Type Time(s) Ops TPS(ops/s) Net(M/s) Get_miss Min(us) Max(us)
799 Avg(us) Std_dev Geo_dist
800 Period 5 345826 69165 65.3 0 27 2198 203
801 95.43 177.29
802 Global 20 1257935 62896 71.8 0 26 3791 224
803 117.79 192.60
804
805
806 Set Statistics
807 Type Time(s) Ops TPS(ops/s) Net(M/s) Get_miss Min(us) Max(us)
808 Avg(us) Std_dev Geo_dist
809 Period 5 38425 7685 7.3 0 42 628 240
810 88.05 220.21
811 Global 20 139780 6989 8.0 0 37 3790 253
812 117.93 224.83
813
814
815 Total Statistics
816 Type Time(s) Ops TPS(ops/s) Net(M/s) Get_miss Min(us) Max(us)
817 Avg(us) Std_dev Geo_dist
818 Period 5 384252 76850 72.5 0 27 2198 207
819 94.72 181.18
820 Global 20 1397720 69886 79.7 0 26 3791 227
821 117.93 195.60
822 ---------------------------------------------------------------------------------------------------------------------------------
823
824
825
826 Where
827 _____
828
829
830
831 Get Statistics
832
833 Statistics information of get command
834
835
836
837 Set Statistics
838
839 Statistics information of set command
840
841
842
843 Total Statistics
844
845 Statistics information of both get and set command
846
847
848
849 Period
850
851 Result within a period
852
853
854
855 Global
856
857 Accumulated results
858
859
860
861 Ops
862
863 Total operations
864
865
866
867 TPS
868
869 Throughput, operations/second
870
871
872
873 Net
874
875 The rate of network
876
877
878
879 Get_miss
880
881 How many objects can’t be gotten
882
883
884
885 Min
886
887 The minimum response time
888
889
890
891 Max
892
893 The maximum response time
894
895
896
897 Avg:
898
899 The average response time
900
901
902
903 Std_dev
904
905 Standard deviation of response time
906
907
908
909 Geo_dist
910
911 Geometric distribution based on natural exponential function
912
913
914
915 At the end, memaslap will output something like this:
916
917
918 .. code-block:: perl
919
920 ---------------------------------------------------------------------------------------------------------------------------------
921 Get Statistics (1257956 events)
922 Min: 26
923 Max: 3791
924 Avg: 224
925 Geo: 192.60
926 Std: 116.23
927 Log2 Dist:
928 4: 0 10 84490 215345
929 8: 484890 459823 12543 824
930 12: 31
931
932 Set Statistics (139782 events)
933 Min: 37
934 Max: 3790
935 Avg: 253
936 Geo: 224.84
937 Std: 116.83
938 Log2 Dist:
939 4: 0 0 4200 16988
940 8: 50784 65574 2064 167
941 12: 5
942
943 Total Statistics (1397738 events)
944 Min: 26
945 Max: 3791
946 Avg: 227
947 Geo: 195.60
948 Std: 116.60
949 Log2 Dist:
950 4: 0 10 88690 232333
951 8: 535674 525397 14607 991
952 12: 36
953
954 cmd_get: 1257969
955 cmd_set: 139785
956 get_misses: 0
957 verify_misses: 0
958 verify_failed: 0
959 expired_get: 0
960 unexpired_unget: 0
961 written_bytes: 242516030
962 read_bytes: 1003702556
963 object_bytes: 152086080
964 packet_disorder: 0
965 packet_drop: 0
966 udp_timeout: 0
967
968 Run time: 20.0s Ops: 1397754 TPS: 69817 Net_rate: 59.4M/s
969 ---------------------------------------------------------------------------------------------------------------------------------
970
971
972
973 Where
974 _____
975
976
977
978 Get Statistics
979
980 Get statistics of response time
981
982
983
984 Set Statistics
985
986 Set statistics of response time
987
988
989
990 Total Statistics
991
992 Both get and set statistics of response time
993
994
995
996 Min
997
998 The accumulated and minimum response time
999
1000
1001
1002 Max
1003
1004 The accumulated and maximum response time
1005
1006
1007
1008 Avg
1009
1010 The accumulated and average response time
1011
1012
1013
1014 Std
1015
1016 Standard deviation of response time
1017
1018
1019
1020 Log2 Dist
1021
1022 Geometric distribution based on logarithm 2
1023
1024
1025
1026 cmd_get
1027
1028 Total get commands done
1029
1030
1031
1032 cmd_set
1033
1034 Total set commands done
1035
1036
1037
1038 get_misses
1039
1040 How many objects can’t be gotten from server
1041
1042
1043
1044 verify_misses
1045
1046 How many objects need to verify but can’t get them
1047
1048
1049
1050 verify_failed
1051
1052 How many objects with insistent value
1053
1054
1055
1056 expired_get
1057
1058 How many objects are expired but we get them
1059
1060
1061
1062 unexpired_unget
1063
1064 How many objects are unexpired but we can’t get them
1065
1066
1067
1068 written_bytes
1069
1070 Total written bytes
1071
1072
1073
1074 read_bytes
1075
1076 Total read bytes
1077
1078
1079
1080 object_bytes
1081
1082 Total object bytes
1083
1084
1085
1086 packet_disorder
1087
1088 How many UDP packages are disorder
1089
1090
1091
1092 packet_drop
1093
1094 How many UDP packages are lost
1095
1096
1097
1098 udp_timeout
1099
1100 How many times UDP time out happen
1101
1102
1103
1104 Run time
1105
1106 Total run time
1107
1108
1109
1110 Ops
1111
1112 Total operations
1113
1114
1115
1116 TPS
1117
1118 Throughput, operations/second
1119
1120
1121
1122 Net_rate
1123
1124 The average rate of network
1125
1126
1127
1128
1129
1130 *******
1131 OPTIONS
1132 *******
1133
1134
1135 -s, --servers=
1136 List one or more servers to connect. Servers count must be less than
1137 threads count. e.g.: --servers=localhost:1234,localhost:11211
1138
1139 -T, --threads=
1140 Number of threads to startup, better equal to CPU numbers. Default 8.
1141
1142 -c, --concurrency=
1143 Number of concurrency to simulate with load. Default 128.
1144
1145 -n, --conn_sock=
1146 Number of TCP socks per concurrency. Default 1.
1147
1148 -x, --execute_number=
1149 Number of operations(get and set) to execute for the
1150 given test. Default 1000000.
1151
1152 -t, --time=
1153 How long the test to run, suffix: s-seconds, m-minutes, h-hours,
1154 d-days e.g.: --time=2h.
1155
1156 -F, --cfg_cmd=
1157 Load the configure file to get command,key and value distribution list.
1158
1159 -w, --win_size=
1160 Task window size of each concurrency, suffix: K, M e.g.: --win_size=10k.
1161 Default 10k.
1162
1163 -X, --fixed_size=
1164 Fixed length of value.
1165
1166 -v, --verify=
1167 The proportion of date verification, e.g.: --verify=0.01
1168
1169 -d, --division=
1170 Number of keys to multi-get once. Default 1, means single get.
1171
1172 -S, --stat_freq=
1173 Frequency of dumping statistic information. suffix: s-seconds,
1174 m-minutes, e.g.: --resp_freq=10s.
1175
1176 -e, --exp_verify=
1177 The proportion of objects with expire time, e.g.: --exp_verify=0.01.
1178 Default no object with expire time
1179
1180 -o, --overwrite=
1181 The proportion of objects need overwrite, e.g.: --overwrite=0.01.
1182 Default never overwrite object.
1183
1184 -R, --reconnect
1185 Reconnect tests, when connection is closed it will be reconnected.
1186
1187 -U, --udp
1188 UDP tests, default memaslap uses TCP, TCP port and UDP port of
1189 server must be same.
1190
1191 -a, --facebook
1192 Whether it enables facebook test feature, set with TCP and multi-get with UDP.
1193
1194 -B, --binary
1195 Whether it enables binary protocol. Default with ASCII protocol.
1196
1197 -P, --tps=
1198 Expected throughput, suffix: K, e.g.: --tps=10k.
1199
1200 -p, --rep_write=
1201 The first nth servers can write data, e.g.: --rep_write=2.
1202
1203 -b, --verbose
1204 Whether it outputs detailed information when verification fails.
1205
1206 -h, --help
1207 Display this message and then exit.
1208
1209 -V, --version
1210 Display the version of the application and then exit.
1211
1212
1213 ********
1214 EXAMPLES
1215 ********
1216
1217
1218 memaslap -s 127.0.0.1:11211 -S 5s
1219
1220 memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b
1221
1222 memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2
1223
1224 memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k
1225
1226 memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40
1227
1228 memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m
1229
1230 memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2
1231
1232
1233 ****
1234 HOME
1235 ****
1236
1237
1238 To find out more information please check:
1239 `http://launchpad.org/libmemcached <http://launchpad.org/libmemcached>`_
1240
1241
1242 *******
1243 AUTHORS
1244 *******
1245
1246
1247 Mingqiang Zhuang <mingqiangzhuang@hengtiansoft.com> (Schooner Technolgy)
1248 Brian Aker, <brian@tangent.org>
1249
1250
1251 ********
1252 SEE ALSO
1253 ********
1254
1255
1256 :manpage:`memcached(1)` :manpage:`libmemcached(3)` :manpage:`memcached_strerror(3)`