Deploy to GitHub pages
[awesomized/libmemcached] / bin / memaslap.html
1
2
3 <!DOCTYPE html>
4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6 <head>
7 <meta charset="utf-8">
8
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
11 <title>memaslap - Load testing and benchmarking a server &mdash; libmemcached-awesome 1.1.4 documentation</title>
12
13
14
15
16
17
18
19
20 <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
21
22
23 <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
24 <script type="text/javascript" src="../_static/jquery.js"></script>
25 <script type="text/javascript" src="../_static/underscore.js"></script>
26 <script type="text/javascript" src="../_static/doctools.js"></script>
27 <script type="text/javascript" src="../_static/language_data.js"></script>
28
29 <script type="text/javascript" src="../_static/js/theme.js"></script>
30
31
32
33
34 <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
35 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
36 <link rel="index" title="Index" href="../genindex.html" />
37 <link rel="search" title="Search" href="../search.html" />
38 <link rel="copyright" title="Copyright" href="../copyright.html" />
39 <link rel="next" title="memslap" href="memslap.html" />
40 <link rel="prev" title="memrm" href="memrm.html" />
41 </head>
42
43 <body class="wy-body-for-nav">
44
45
46 <div class="wy-grid-for-nav">
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search" >
51
52
53
54 <a href="../index.html" class="icon icon-home"> libmemcached-awesome
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 1.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85
86
87
88 <ul class="current">
89 <li class="toctree-l1"><a class="reference internal" href="../libmemcached.html">Introduction</a></li>
90 <li class="toctree-l1"><a class="reference internal" href="../libmemcached/index.html">libmemcached API</a></li>
91 <li class="toctree-l1"><a class="reference internal" href="../libmemcachedutil/index.html">libmemcachedutil API</a></li>
92 <li class="toctree-l1"><a class="reference internal" href="../libhashkit/index.html">libhashkit API</a></li>
93 <li class="toctree-l1 current"><a class="reference internal" href="index.html">Client Applications</a><ul class="current">
94 <li class="toctree-l2"><a class="reference internal" href="memexist.html">memexist — Check for the existence of a key</a></li>
95 <li class="toctree-l2"><a class="reference internal" href="memcat.html">memcat — &quot;cat&quot; data from a server</a></li>
96 <li class="toctree-l2"><a class="reference internal" href="memcp.html">memcp — &quot;cp&quot; files to a server</a></li>
97 <li class="toctree-l2"><a class="reference internal" href="memtouch.html">memtouch — &quot;touch&quot; a key</a></li>
98 <li class="toctree-l2"><a class="reference internal" href="memrm.html">memrm – &quot;rm&quot; a key</a></li>
99 <li class="toctree-l2 current"><a class="current reference internal" href="#">memaslap - Load testing and benchmarking a server</a></li>
100 <li class="toctree-l2"><a class="reference internal" href="memslap.html">memslap - Load testing and benchmarking a server</a></li>
101 <li class="toctree-l2"><a class="reference internal" href="memping.html">memping – Ping a server</a></li>
102 <li class="toctree-l2"><a class="reference internal" href="memstat.html">memstat – Gather statistics from a server</a></li>
103 <li class="toctree-l2"><a class="reference internal" href="memerror.html">memerror — Translate libmemcached error codes</a></li>
104 <li class="toctree-l2"><a class="reference internal" href="memparse.html">memparse — Parse and validate an option string</a></li>
105 <li class="toctree-l2"><a class="reference internal" href="memcapable.html">memcapable — Check a server's capabilities and compatibility</a></li>
106 <li class="toctree-l2"><a class="reference internal" href="memdump.html">memdump — Dump a server's data</a></li>
107 <li class="toctree-l2"><a class="reference internal" href="memflush.html">memflush — Flush a server (erase all cached data)</a></li>
108 </ul>
109 </li>
110 <li class="toctree-l1"><a class="reference internal" href="../libmemcached/index_misc.html">Miscellaneous</a></li>
111 </ul>
112 <ul>
113 <li class="toctree-l1"><a class="reference internal" href="../changelogs.html">Change Logs</a></li>
114 <li class="toctree-l1"><a class="reference internal" href="../issues.html">Known issues</a></li>
115 <li class="toctree-l1"><a class="reference internal" href="../copyright.html">Copyright</a></li>
116 </ul>
117
118
119
120 </div>
121 </div>
122 </nav>
123
124 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
125
126
127 <nav class="wy-nav-top" aria-label="top navigation">
128
129 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
130 <a href="../index.html">libmemcached-awesome</a>
131
132 </nav>
133
134
135 <div class="wy-nav-content">
136
137 <div class="rst-content">
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155 <div role="navigation" aria-label="breadcrumbs navigation">
156
157 <ul class="wy-breadcrumbs">
158
159 <li><a href="../index.html">Docs</a> &raquo;</li>
160
161 <li><a href="index.html">Client Applications</a> &raquo;</li>
162
163 <li>memaslap - Load testing and benchmarking a server</li>
164
165
166 <li class="wy-breadcrumbs-aside">
167
168
169
170 <a href="https://github.com/awesomized/libmemcached/blob/v1.x/docs/source/bin/memaslap.rst" class="fa fa-github"> Edit on GitHub</a>
171
172
173
174 </li>
175
176 </ul>
177
178
179 <hr/>
180 </div>
181 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
182 <div itemprop="articleBody">
183
184 <div class="section" id="memaslap-load-testing-and-benchmarking-a-server">
185 <h1>memaslap - Load testing and benchmarking a server<a class="headerlink" href="#memaslap-load-testing-and-benchmarking-a-server" title="Permalink to this headline"></a></h1>
186 <div class="section" id="synopsis">
187 <h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline"></a></h2>
188 <p>memaslap [options]</p>
189 <dl class="option">
190 <dt id="cmdoption-memaslap-help">
191 <code class="descname">--help</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-memaslap-help" title="Permalink to this definition"></a></dt>
192 <dd></dd></dl>
193
194 <dl class="option">
195 <dt id="cmdoption-memaslap-servers">
196 <code class="descname">--servers</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-memaslap-servers" title="Permalink to this definition"></a></dt>
197 <dd></dd></dl>
198
199 <dl class="envvar">
200 <dt id="envvar-MEMCACHED_SERVERS">
201 <code class="descname">MEMCACHED_SERVERS</code><a class="headerlink" href="#envvar-MEMCACHED_SERVERS" title="Permalink to this definition"></a></dt>
202 <dd></dd></dl>
203
204 </div>
205 <div class="section" id="description">
206 <h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline"></a></h2>
207 <p><strong class="program">memaslap</strong> is a load generation and benchmark tool for memcached
208 servers. It generates configurable workload such as threads, concurrency,
209 connections, run time, overwrite, miss rate, key size, value size, get/set
210 proportion, expected throughput, and so on. Furthermore, it also tests data
211 verification, expire-time verification, UDP, binary protocol, facebook test,
212 replication test, multi-get and reconnection, etc.</p>
213 <p>Memaslap manages network connections like memcached with
214 libevent. Each thread of memaslap is bound with a CPU core, all
215 the threads don't communicate with each other, and there are several socket
216 connections in each thread. Each connection keeps key size distribution,
217 value size distribution, and command distribution by itself.</p>
218 <p>You can specify servers via the <a class="reference internal" href="#cmdoption-memaslap-servers"><code class="xref std std-option docutils literal notranslate"><span class="pre">memaslap</span> <span class="pre">--servers</span></code></a> option or via the
219 environment variable <span class="target" id="index-0"></span><a class="reference internal" href="memtouch.html#envvar-MEMCACHED_SERVERS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">MEMCACHED_SERVERS</span></code></a>.</p>
220 </div>
221 <div class="section" id="features">
222 <h2>FEATURES<a class="headerlink" href="#features" title="Permalink to this headline"></a></h2>
223 <p>Memslap is developed to for the following purposes:</p>
224 <p>Manages network connections with libevent asynchronously.</p>
225 <p>Set both TCP and UDP up to use non-blocking IO.</p>
226 <p>Improves parallelism: higher performance in multi-threads environments.</p>
227 <p>Improves time efficiency: faster processing speed.</p>
228 <p>Generates key and value more efficiently; key size distribution and value size distribution are configurable.</p>
229 <p>Supports get, multi-get, and set commands; command distribution is configurable.</p>
230 <p>Supports controllable miss rate and overwrite rate.</p>
231 <p>Supports data and expire-time verification.</p>
232 <p>Supports dumping statistic information periodically.</p>
233 <p>Supports thousands of TCP connections.</p>
234 <p>Supports binary protocol.</p>
235 <p>Supports facebook test (set with TCP and multi-get with UDP) and replication test.</p>
236 </div>
237 <div class="section" id="details">
238 <h2>DETAILS<a class="headerlink" href="#details" title="Permalink to this headline"></a></h2>
239 <div class="section" id="effective-implementation-of-network">
240 <h3>Effective implementation of network.<a class="headerlink" href="#effective-implementation-of-network" title="Permalink to this headline"></a></h3>
241 <p>For memaslap, both TCP and UDP use non-blocking network IO. All
242 the network events are managed by libevent as memcached. The network module
243 of memaslap is similar to memcached. Libevent can ensure
244 memaslap can handle network very efficiently.</p>
245 </div>
246 <div class="section" id="effective-implementation-of-multi-threads-and-concurrency">
247 <h3>Effective implementation of multi-threads and concurrency<a class="headerlink" href="#effective-implementation-of-multi-threads-and-concurrency" title="Permalink to this headline"></a></h3>
248 <p>Memslap has the similar implementation of multi-threads to
249 memcached. Memslap creates one or more self-governed threads;
250 each thread is bound with one CPU core if the system tests setting CPU
251 core affinity.</p>
252 <p>In addition, each thread has a libevent to manage the events of the network;
253 each thread has one or more self-governed concurrency; and each
254 concurrency has one or more socket connections. All the concurrent tasks don't
255 communicate with each other even though they are in the same thread.</p>
256 <p>Memslap can create thousands of socket connections, and each
257 concurrency has tens of socket connections. Each concurrency randomly or
258 sequentially selects one socket connection from its socket connection pool
259 to run, so memaslap can ensure each concurrency handles one
260 socket connection at any given time. Users can specify the number of
261 concurrency and socket connections of each concurrency according to their
262 expected workload.</p>
263 </div>
264 <div class="section" id="effective-implementation-of-generating-key-and-value">
265 <h3>Effective implementation of generating key and value<a class="headerlink" href="#effective-implementation-of-generating-key-and-value" title="Permalink to this headline"></a></h3>
266 <p>In order to improve time efficiency and space efficiency,
267 memaslap creates a random characters table with 10M characters. All the
268 suffixes of keys and values are generated from this random characters table.</p>
269 <p>Memslap uses the offset in the character table and the length
270 of the string to identify a string. It can save much memory.
271 Each key contains two parts, a prefix and a suffix. The prefix is an
272 uint64_t, 8 bytes. In order to verify the data set before,
273 memaslap need to ensure each key is unique, so it uses the prefix to identify
274 a key. The prefix cannot include illegal characters, such as 'r', 'n',
275 '0' and ' '. And memaslap has an algorithm to ensure that.</p>
276 <p>Memslap doesn't generate all the objects (key-value pairs) at
277 the beginning. It only generates enough objects to fill the task window
278 (default 10K objects) of each concurrency. Each object has the following
279 basic information, key prefix, key suffix offset in the character table, key
280 length, value offset in the character table, and value length.</p>
281 <p>In the work process, each concurrency sequentially or randomly selects an
282 object from the window to do set operation or get operation. At the same
283 time, each concurrency kicks objects out of its window and adds new object
284 into it.</p>
285 </div>
286 <div class="section" id="simple-but-useful-task-scheduling">
287 <h3>Simple but useful task scheduling<a class="headerlink" href="#simple-but-useful-task-scheduling" title="Permalink to this headline"></a></h3>
288 <p>Memslap uses libevent to schedule all concurrent tasks of
289 threads, and each concurrency schedules tasks based on the local task
290 window. Memslap assumes that if each concurrency keeps the same
291 key distribution, value distribution and commands distribution, from
292 outside, memaslap keeps all the distribution as a whole.
293 Each task window includes a lot of objects, each object stores its basic
294 information, such as key, value, expire time, and so on. At any time, all
295 the objects in the window keep the same and fixed key and value
296 distribution. If an object is overwritten, the value of the object will be
297 updated. Memslap verifies the data or expire-time according to
298 the object information stored in the task window.</p>
299 <p>Libevent selects which concurrency to handle based on a specific network
300 event. Then the concurrency selects which command (get or set) to operate
301 based on the command distribution. If it needs to kick out an old object and
302 add a new object, in order to keep the same key and value distribution, the
303 new object must have the same key length and value length.</p>
304 <p>If memcached server has two cache layers (memory and SSD), running
305 memaslap with different window sizes can get different cache
306 miss rates. If memaslap adds enough objects into the windows at
307 the beginning, and the cache of memcached cannot store all the objects
308 initialized, then memaslap will get some objects from the second
309 cache layer. It causes the first cache layer to miss. So the user can
310 specify the window size to get the expected miss rate of the first cache
311 layer.</p>
312 </div>
313 <div class="section" id="useful-implementation-of-multi-servers-udp-tcp-multi-get-and-binary-protocol">
314 <h3>Useful implementation of multi-servers , UDP, TCP, multi-get and binary protocol<a class="headerlink" href="#useful-implementation-of-multi-servers-udp-tcp-multi-get-and-binary-protocol" title="Permalink to this headline"></a></h3>
315 <p>Because each thread is self-governed, memaslap can assign
316 different threads to handle different memcached servers. This is just one of
317 the ways in which memaslap tests multiple servers. The only
318 limitation is that the number of servers cannot be greater than the number
319 of threads. The other way to test multiple servers is for replication
320 test. Each concurrency has one socket connection to each memcached server.
321 For the implementation, memaslap can set some objects to one
322 memcached server, and get these objects from the other servers.</p>
323 <p>By default, Memslap does single get. If the user specifies
324 multi-get option, memaslap will collect enough get commands and
325 pack and send the commands together.</p>
326 <p>Memslap tests both the ASCII protocol and binary protocol,
327 but it runs on the ASCII protocol by default.
328 Memslap by default runs on the TCP protocol, but it also
329 tests UDP. Because UDP is unreliable, dropped packages and out-of-order
330 packages may occur. Memslap creates a memory buffer to handle
331 these problems. Memslap tries to read all the response data of
332 one command from the server and reorders the response data. If some packages
333 get lost, the waiting timeout mechanism can ensure half-baked packages will
334 be discarded and the next command will be sent.</p>
335 </div>
336 </div>
337 <div class="section" id="usage">
338 <h2>USAGE<a class="headerlink" href="#usage" title="Permalink to this headline"></a></h2>
339 <p>Below are some usage samples:</p>
340 <p>memaslap -s 127.0.0.1:11211 -S 5s</p>
341 <p>memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b</p>
342 <p>memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2</p>
343 <p>memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k</p>
344 <p>memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40</p>
345 <p>memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m</p>
346 <p>memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2</p>
347 <p>The user must specify one server at least to run memaslap. The
348 rest of the parameters have default values, as shown below:</p>
349 <p>Thread number = 1 Concurrency = 16</p>
350 <p>Run time = 600 seconds Configuration file = NULL</p>
351 <p>Key size = 64 Value size = 1024</p>
352 <p>Get/set = 9:1 Window size = 10k</p>
353 <p>Execute number = 0 Single get = true</p>
354 <p>Multi-get = false Number of sockets of each concurrency = 1</p>
355 <p>Reconnect = false Data verification = false</p>
356 <p>Expire-time verification = false ASCII protocol = true</p>
357 <p>Binary protocol = false Dumping statistic information periodically = false</p>
358 <p>Overwrite proportion = 0% UDP = false</p>
359 <p>TCP = true Limit throughput = false</p>
360 <p>Facebook test = false Replication test = false</p>
361 <div class="section" id="key-size-value-size-and-command-distribution">
362 <h3>Key size, value size and command distribution.<a class="headerlink" href="#key-size-value-size-and-command-distribution" title="Permalink to this headline"></a></h3>
363 <p>All the distributions are read from the configuration file specified by user
364 with &quot;—cfg_cmd&quot; option. If the user does not specify a configuration file,
365 memaslap will run with the default distribution (key size = 64,
366 value size = 1024, get/set = 9:1). For information on how to edit the
367 configuration file, refer to the &quot;Configuration File&quot; section.</p>
368 <p>The minimum key size is 16 bytes; the maximum key size is 250 bytes. The
369 precision of proportion is 0.001. The proportion of distribution will be
370 rounded to 3 decimal places.</p>
371 <p>The minimum value size is 1 bytes; the maximum value size is 1M bytes. The
372 precision of proportion is 0.001. The proportion of distribution will be
373 rounded to 3 decimal places.
374 Currently, memaslap only tests set and get commands. And it
375 testss 100% set and 100% get. For 100% get, it will preset some objects to
376 the server.</p>
377 </div>
378 <div class="section" id="multi-thread-and-concurrency">
379 <h3>Multi-thread and concurrency<a class="headerlink" href="#multi-thread-and-concurrency" title="Permalink to this headline"></a></h3>
380 <p>The high performance of memaslap benefits from the special
381 schedule of thread and concurrency. It's important to specify the proper
382 number of them. The default number of threads is 1; the default number of
383 concurrency is 16. The user can use &quot;—threads&quot; and &quot;--concurrency&quot; to
384 specify these variables.</p>
385 <p>If the system tests setting CPU affinity and the number of threads
386 specified by the user is greater than 1, memaslap will try to
387 bind each thread to a different CPU core. So if you want to get the best
388 performance memaslap, it is better to specify the number of
389 thread equal to the number of CPU cores. The number of threads specified by
390 the user can also be less or greater than the number of CPU cores. Because
391 of the limitation of implementation, the number of concurrencies could be
392 the multiple of the number of threads.</p>
393 <ol class="arabic simple">
394 <li>For 8 CPU cores system</li>
395 </ol>
396 <p>For example:</p>
397 <p>--threads=2 --concurrency=128</p>
398 <p>--threads=8 --concurrency=128</p>
399 <p>--threads=8 --concurrency=256</p>
400 <p>--threads=12 --concurrency=144</p>
401 <ol class="arabic simple" start="2">
402 <li>For 16 CPU cores system</li>
403 </ol>
404 <p>For example:</p>
405 <p>--threads=8 --concurrency=128</p>
406 <p>--threads=16 --concurrency=256</p>
407 <p>--threads=16 --concurrency=512</p>
408 <p>--threads=24 --concurrency=288</p>
409 <p>The memaslap performs very well, when
410 used to test the performance of memcached servers.
411 Most of the time, the bottleneck is the network or
412 the server. If for some reason the user wants to
413 limit the performance of memaslap, there
414 are two ways to do this:</p>
415 <p>Decrease the number of threads and concurrencies.
416 Use the option &quot;--tps&quot; that memaslap
417 provides to limit the throughput. This option allows
418 the user to get the expected throughput. For
419 example, assume that the maximum throughput is 50
420 kops/s for a specific configuration, you can specify
421 the throughput equal to or less than the maximum
422 throughput using &quot;--tps&quot; option.</p>
423 </div>
424 <div class="section" id="window-size">
425 <h3>Window size<a class="headerlink" href="#window-size" title="Permalink to this headline"></a></h3>
426 <p>Most of the time, the user does not need to specify the window size. The
427 default window size is 10k. For Schooner Memcached, the user can specify
428 different window sizes to get different cache miss rates based on the test
429 case. Memslap testss cache miss rate between 0% and 100%.
430 If you use this utility to test the performance of Schooner Memcached, you
431 can specify a proper window size to get the expected cache miss rate. The
432 formula for calculating window size is as follows:</p>
433 <p>Assume that the key size is 128 bytes, and the value size is 2048 bytes, and
434 concurrency=128.</p>
435 <p>1. Small cache cache_size=1M, 100% cache miss (all data get from SSD).
436 win_size=10k</p>
437 <ol class="arabic simple" start="2">
438 <li>cache_size=4G</li>
439 </ol>
440 <p>(1). cache miss rate 0%</p>
441 <p>win_size=8k</p>
442 <p>(2). cache miss rate 5%</p>
443 <p>win_size=11k</p>
444 <ol class="arabic simple" start="3">
445 <li>cache_size=16G</li>
446 </ol>
447 <p>(1). cache miss rate 0%</p>
448 <p>win_size=32k</p>
449 <p>(2). cache miss</p>
450 <p>rate 5%</p>
451 <p>win_size=46k</p>
452 <p>The formula for calculating window size for cache miss rate 0%:</p>
453 <p>cache_size / concurrency / (key_size + value_size) * 0.5</p>
454 <p>The formula for calculating window size for cache miss rate 5%:</p>
455 <p>cache_size / concurrency / (key_size + value_size) * 0.7</p>
456 </div>
457 <div class="section" id="verification">
458 <h3>Verification<a class="headerlink" href="#verification" title="Permalink to this headline"></a></h3>
459 <p>Memslap testss both data verification and expire-time
460 verification. The user can use &quot;--verify=&quot; or &quot;-v&quot; to specify the proportion
461 of data verification. In theory, it testss 100% data verification. The
462 user can use &quot;--exp_verify=&quot; or &quot;-e&quot; to specify the proportion of
463 expire-time verification. In theory, it testss 100% expire-time
464 verification. Specify the &quot;--verbose&quot; options to get more detailed error
465 information.</p>
466 <p>For example: --exp_verify=0.01 –verify=0.1 , it means that 1% of the objects
467 set with expire-time, 10% of the objects gotten will be verified. If the
468 objects are gotten, memaslap will verify the expire-time and
469 value.</p>
470 </div>
471 <div class="section" id="multi-servers-and-multi-config">
472 <h3>multi-servers and multi-config<a class="headerlink" href="#multi-servers-and-multi-config" title="Permalink to this headline"></a></h3>
473 <p>Memslap testss multi-servers based on self-governed thread.
474 There is a limitation that the number of servers cannot be greater than the
475 number of threads. Memslap assigns one thread to handle one
476 server at least. The user can use the &quot;--servers=&quot; or &quot;-s&quot; option to specify
477 multi-servers.</p>
478 <p>For example:</p>
479 <p>--servers=10.1.1.1:11211,10.1.1.2:11212,10.1.1.3:11213 --threads=6 --concurrency=36</p>
480 <p>The above command means that there are 6 threads, with each thread having 6
481 concurrencies and that threads 0 and 3 handle server 0 (10.1.1.1); threads 1
482 and 4 handle server 1 (10.1.1.2); and thread 2 and 5 handle server 2
483 (10.1.1.3).</p>
484 <p>All the threads and concurrencies in memaslap are self-governed.</p>
485 <p>So is memaslap. The user can start up several
486 memaslap instances. The user can run memaslap on different client
487 machines to communicate with the same memcached server at the same. It is
488 recommended that the user start different memaslap on different
489 machines using the same configuration.</p>
490 </div>
491 <div class="section" id="run-with-execute-number-mode-or-time-mode">
492 <h3>Run with execute number mode or time mode<a class="headerlink" href="#run-with-execute-number-mode-or-time-mode" title="Permalink to this headline"></a></h3>
493 <p>The default memaslap runs with time mode. The default run time
494 is 10 minutes. If it times out, memaslap will exit. Do not
495 specify both execute number mode and time mode at the same time; just
496 specify one instead.</p>
497 <p>For example:</p>
498 <p>--time=30s (It means the test will run 30 seconds.)</p>
499 <p>--execute_number=100000 (It means that after running 100000 commands, the test will exit.)</p>
500 </div>
501 <div class="section" id="dump-statistic-information-periodically">
502 <h3>Dump statistic information periodically.<a class="headerlink" href="#dump-statistic-information-periodically" title="Permalink to this headline"></a></h3>
503 <p>The user can use &quot;--stat_freq=&quot; or &quot;-S&quot; to specify the frequency.</p>
504 <p>For example:</p>
505 <p>--stat_freq=20s</p>
506 <p>Memslap will dump the statistics of the commands (get and set) at the frequency of every 20
507 seconds.</p>
508 <p>For more information on the format of dumping statistic information, refer to &quot;Format of Output&quot; section.</p>
509 </div>
510 <div class="section" id="multi-get">
511 <h3>Multi-get<a class="headerlink" href="#multi-get" title="Permalink to this headline"></a></h3>
512 <p>The user can use &quot;--division=&quot; or &quot;-d&quot; to specify multi-get keys count.
513 Memslap by default does single get with TCP. Memslap also testss data
514 verification and expire-time verification for multi-get.</p>
515 <p>Memslap testss multi-get with both TCP and UDP. Because of
516 the different implementation of the ASCII protocol and binary protocol,
517 there are some differences between the two. For the ASCII protocol,
518 memaslap sends one &quot;multi-get&quot; to the server once. For the
519 binary protocol, memaslap sends several single get commands
520 together as &quot;multi-get&quot; to the server.</p>
521 </div>
522 <div class="section" id="udp-and-tcp">
523 <h3>UDP and TCP<a class="headerlink" href="#udp-and-tcp" title="Permalink to this headline"></a></h3>
524 <p>Memslap testss both UDP and TCP. For TCP,
525 memaslap does not reconnect the memcached server if socket connections are
526 lost. If all the socket connections are lost or memcached server crashes,
527 memaslap will exit. If the user specifies the &quot;--reconnect&quot;
528 option when socket connections are lost, it will reconnect them.</p>
529 <p>User can use &quot;--udp&quot; to enable the UDP feature, but UDP comes with some
530 limitations:</p>
531 <p>UDP cannot set data more than 1400 bytes.</p>
532 <p>UDP is not tested by the binary protocol because the binary protocol of
533 memcached does not tests that.</p>
534 <p>UDP doesn't tests reconnection.</p>
535 </div>
536 <div class="section" id="facebook-test">
537 <h3>Facebook test<a class="headerlink" href="#facebook-test" title="Permalink to this headline"></a></h3>
538 <p>Set data with TCP and multi-get with UDP. Specify the following options:</p>
539 <p>&quot;--facebook --division=50&quot;</p>
540 <p>If you want to create thousands of TCP connections, specify the</p>
541 <p>&quot;--conn_sock=&quot; option.</p>
542 <p>For example: --facebook --division=50 --conn_sock=200</p>
543 <p>The above command means that memaslap will do facebook test,
544 each concurrency has 200 socket TCP connections and one UDP socket.</p>
545 <p>Memslap sets objects with the TCP socket, and multi-gets 50
546 objects once with the UDP socket.</p>
547 <p>If you specify &quot;--division=50&quot;, the key size must be less that 25 bytes
548 because the UDP packet size is 1400 bytes.</p>
549 </div>
550 <div class="section" id="replication-test">
551 <h3>Replication test<a class="headerlink" href="#replication-test" title="Permalink to this headline"></a></h3>
552 <p>For replication test, the user must specify at least two memcached servers.
553 The user can use &quot;—rep_write=&quot; option to enable feature.</p>
554 <p>For example:</p>
555 <p>--servers=10.1.1.1:11211,10.1.1.2:11212 –rep_write=2</p>
556 <p>The above command means that there are 2 replication memcached servers,
557 memaslap will set objects to both server 0 and server 1, get
558 objects which are set to server 0 before from server 1, and also get objects
559 which are set to server 1 before from server 0. If server 0 crashes,
560 memaslap will only get objects from server 1. If server 0 comes
561 back to life again, memaslap will reconnect server 0. If both
562 server 0 and server 1 crash, memaslap will exit.</p>
563 </div>
564 <div class="section" id="supports-thousands-of-tcp-connections">
565 <h3>Supports thousands of TCP connections<a class="headerlink" href="#supports-thousands-of-tcp-connections" title="Permalink to this headline"></a></h3>
566 <p>Start memaslap with &quot;--conn_sock=&quot; or &quot;-n&quot; to enable this
567 feature. Make sure that your system can tests opening thousands of files
568 and creating thousands of sockets. However, this feature does not tests
569 reconnection if sockets disconnect.</p>
570 <p>For example:</p>
571 <p>--threads=8 --concurrency=128 --conn_sock=128</p>
572 <p>The above command means that memaslap starts up 8 threads, each
573 thread has 16 concurrencies, each concurrency has 128 TCP socket
574 connections, and the total number of TCP socket connections is 128 * 128 =
575 16384.</p>
576 </div>
577 <div class="section" id="supports-binary-protocol">
578 <h3>Supports binary protocol<a class="headerlink" href="#supports-binary-protocol" title="Permalink to this headline"></a></h3>
579 <p>Start memaslap with &quot;--binary&quot; or &quot;-B&quot; options to enable this
580 feature. It testss all the above features except UDP, because the latest
581 memcached 1.3.3 does not implement binary UDP protocol.</p>
582 <p>For example:</p>
583 <p>--binary</p>
584 <p>Since memcached 1.3.3 doesn't implement binary UDP protocol,
585 memaslap does not tests UDP. In addition, memcached 1.3.3 does not tests
586 multi-get. If you specify &quot;--division=50&quot; option, it just sends 50 get
587 commands together as &quot;multi-get&quot; to the server.</p>
588 </div>
589 </div>
590 <div class="section" id="configuration-file">
591 <h2>Configuration file<a class="headerlink" href="#configuration-file" title="Permalink to this headline"></a></h2>
592 <p>This section describes the format of the configuration file. By default
593 when no configuration file is specified memaslap reads the default
594 one located at ~/.memaslap.cnf.</p>
595 <p>Below is a sample configuration file:</p>
596 <div class="highlight-perl notranslate"><div class="highlight"><pre><span></span><span class="o">---------------------------------------------------------------------------</span>
597 <span class="c1">#comments should start with &#39;#&#39;</span>
598 <span class="c1">#key</span>
599 <span class="c1">#start_len end_len proportion</span>
600 <span class="c1">#</span>
601 <span class="c1">#key length range from start_len to end_len</span>
602 <span class="c1">#start_len must be equal to or greater than 16</span>
603 <span class="c1">#end_len must be equal to or less than 250</span>
604 <span class="c1">#start_len must be equal to or greater than end_len</span>
605 <span class="c1">#memaslap will generate keys according to the key range</span>
606 <span class="c1">#proportion: indicates keys generated from one range accounts for the total</span>
607 <span class="n">generated</span> <span class="nb">keys</span>
608 <span class="c1">#</span>
609 <span class="c1">#example1: key range 16~100 accounts for 80%</span>
610 <span class="c1"># key range 101~200 accounts for 10%</span>
611 <span class="c1"># key range 201~250 accounts for 10%</span>
612 <span class="c1"># total should be 1 (0.8+0.1+0.1 = 1)</span>
613 <span class="c1">#</span>
614 <span class="c1"># 16 100 0.8</span>
615 <span class="c1"># 101 200 0.1</span>
616 <span class="c1"># 201 249 0.1</span>
617 <span class="c1">#</span>
618 <span class="c1">#example2: all keys length are 128 bytes</span>
619 <span class="c1">#</span>
620 <span class="c1"># 128 128 1</span>
621 <span class="n">key</span>
622 <span class="mi">128</span> <span class="mi">128</span> <span class="mi">1</span>
623 <span class="c1">#value</span>
624 <span class="c1">#start_len end_len proportion</span>
625 <span class="c1">#</span>
626 <span class="c1">#value length range from start_len to end_len</span>
627 <span class="c1">#start_len must be equal to or greater than 1</span>
628 <span class="c1">#end_len must be equal to or less than 1M</span>
629 <span class="c1">#start_len must be equal to or greater than end_len</span>
630 <span class="c1">#memaslap will generate values according to the value range</span>
631 <span class="c1">#proportion: indicates values generated from one range accounts for the</span>
632 <span class="n">total</span> <span class="n">generated</span> <span class="nb">values</span>
633 <span class="c1">#</span>
634 <span class="c1">#example1: value range 1~1000 accounts for 80%</span>
635 <span class="c1"># value range 1001~10000 accounts for 10%</span>
636 <span class="c1"># value range 10001~100000 accounts for 10%</span>
637 <span class="c1"># total should be 1 (0.8+0.1+0.1 = 1)</span>
638 <span class="c1">#</span>
639 <span class="c1"># 1 1000 0.8</span>
640 <span class="c1"># 1001 10000 0.1</span>
641 <span class="c1"># 10001 100000 0.1</span>
642 <span class="c1">#</span>
643 <span class="c1">#example2: all value length are 128 bytes</span>
644 <span class="c1">#</span>
645 <span class="c1"># 128 128 1</span>
646 <span class="n">value</span>
647 <span class="mi">2048</span> <span class="mi">2048</span> <span class="mi">1</span>
648 <span class="c1">#cmd</span>
649 <span class="c1">#cmd_type cmd_proportion</span>
650 <span class="c1">#</span>
651 <span class="c1">#currently memaslap only testss get and set command.</span>
652 <span class="c1">#</span>
653 <span class="c1">#cmd_type</span>
654 <span class="c1">#set 0</span>
655 <span class="c1">#get 1</span>
656 <span class="c1">#</span>
657 <span class="c1">#example: set command accounts for 50%</span>
658 <span class="c1"># get command accounts for 50%</span>
659 <span class="c1"># total should be 1 (0.5+0.5 = 1)</span>
660 <span class="c1">#</span>
661 <span class="c1"># cmd</span>
662 <span class="c1"># 0 0.5</span>
663 <span class="c1"># 1 0.5</span>
664 <span class="n">cmd</span>
665 <span class="mi">0</span> <span class="mf">0.1</span>
666 <span class="mf">1.0</span> <span class="mf">0.9</span>
667 </pre></div>
668 </div>
669 </div>
670 <div class="section" id="format-of-output">
671 <h2>Format of output<a class="headerlink" href="#format-of-output" title="Permalink to this headline"></a></h2>
672 <p>At the beginning, memaslap displays some configuration information as follows:</p>
673 <p>servers : 127.0.0.1:11211</p>
674 <p>threads count: 1</p>
675 <p>concurrency: 16</p>
676 <p>run time: 20s</p>
677 <p>windows size: 10k</p>
678 <p>set proportion: set_prop=0.10</p>
679 <p>get proportion: get_prop=0.90</p>
680 <div class="section" id="where">
681 <h3>Where<a class="headerlink" href="#where" title="Permalink to this headline"></a></h3>
682 <p>servers : &quot;servers&quot;</p>
683 <blockquote>
684 <div>The servers used by memaslap.</div></blockquote>
685 <p>threads count</p>
686 <blockquote>
687 <div>The number of threads memaslap runs with.</div></blockquote>
688 <p>concurrency</p>
689 <blockquote>
690 <div>The number of concurrencies memaslap runs with.</div></blockquote>
691 <p>run time</p>
692 <blockquote>
693 <div>How long to run memaslap.</div></blockquote>
694 <p>windows size</p>
695 <blockquote>
696 <div>The task window size of each concurrency.</div></blockquote>
697 <p>set proportion</p>
698 <blockquote>
699 <div>The proportion of set command.</div></blockquote>
700 <p>get proportion</p>
701 <blockquote>
702 <div>The proportion of get command.</div></blockquote>
703 <p>The output of dynamic statistics is something like this:</p>
704 <div class="highlight-perl notranslate"><div class="highlight"><pre><span></span><span class="o">---------------------------------------------------------------------------------------------------------------------------------</span>
705 <span class="n">Get</span> <span class="n">Statistics</span>
706 <span class="n">Type</span> <span class="n">Time</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="n">Ops</span> <span class="n">TPS</span><span class="p">(</span><span class="n">ops</span><span class="sr">/s) Net(M/s</span><span class="p">)</span> <span class="n">Get_miss</span> <span class="n">Min</span><span class="p">(</span><span class="n">us</span><span class="p">)</span> <span class="n">Max</span><span class="p">(</span><span class="n">us</span><span class="p">)</span>
707 <span class="n">Avg</span><span class="p">(</span><span class="n">us</span><span class="p">)</span> <span class="n">Std_dev</span> <span class="n">Geo_dist</span>
708 <span class="n">Period</span> <span class="mi">5</span> <span class="mi">345826</span> <span class="mi">69165</span> <span class="mf">65.3</span> <span class="mi">0</span> <span class="mi">27</span> <span class="mi">2198</span> <span class="mi">203</span>
709 <span class="mf">95.43</span> <span class="mf">177.29</span>
710 <span class="n">Global</span> <span class="mi">20</span> <span class="mi">1257935</span> <span class="mi">62896</span> <span class="mf">71.8</span> <span class="mi">0</span> <span class="mi">26</span> <span class="mi">3791</span> <span class="mi">224</span>
711 <span class="mf">117.79</span> <span class="mf">192.60</span>
712 <span class="n">Set</span> <span class="n">Statistics</span>
713
714 <span class="n">Type</span> <span class="n">Time</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="n">Ops</span> <span class="n">TPS</span><span class="p">(</span><span class="n">ops</span><span class="sr">/s) Net(M/s</span><span class="p">)</span> <span class="n">Get_miss</span> <span class="n">Min</span><span class="p">(</span><span class="n">us</span><span class="p">)</span> <span class="n">Max</span><span class="p">(</span><span class="n">us</span><span class="p">)</span>
715 <span class="n">Avg</span><span class="p">(</span><span class="n">us</span><span class="p">)</span> <span class="n">Std_dev</span> <span class="n">Geo_dist</span>
716 <span class="n">Period</span> <span class="mi">5</span> <span class="mi">38425</span> <span class="mi">7685</span> <span class="mf">7.3</span> <span class="mi">0</span> <span class="mi">42</span> <span class="mi">628</span> <span class="mi">240</span>
717 <span class="mf">88.05</span> <span class="mf">220.21</span>
718 <span class="n">Global</span> <span class="mi">20</span> <span class="mi">139780</span> <span class="mi">6989</span> <span class="mf">8.0</span> <span class="mi">0</span> <span class="mi">37</span> <span class="mi">3790</span> <span class="mi">253</span>
719 <span class="mf">117.93</span> <span class="mf">224.83</span>
720 <span class="n">Total</span> <span class="n">Statistics</span>
721
722 <span class="n">Type</span> <span class="n">Time</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="n">Ops</span> <span class="n">TPS</span><span class="p">(</span><span class="n">ops</span><span class="sr">/s) Net(M/s</span><span class="p">)</span> <span class="n">Get_miss</span> <span class="n">Min</span><span class="p">(</span><span class="n">us</span><span class="p">)</span> <span class="n">Max</span><span class="p">(</span><span class="n">us</span><span class="p">)</span>
723 <span class="n">Avg</span><span class="p">(</span><span class="n">us</span><span class="p">)</span> <span class="n">Std_dev</span> <span class="n">Geo_dist</span>
724 <span class="n">Period</span> <span class="mi">5</span> <span class="mi">384252</span> <span class="mi">76850</span> <span class="mf">72.5</span> <span class="mi">0</span> <span class="mi">27</span> <span class="mi">2198</span> <span class="mi">207</span>
725 <span class="mf">94.72</span> <span class="mf">181.18</span>
726 <span class="n">Global</span> <span class="mi">20</span> <span class="mi">1397720</span> <span class="mi">69886</span> <span class="mf">79.7</span> <span class="mi">0</span> <span class="mi">26</span> <span class="mi">3791</span> <span class="mi">227</span>
727 <span class="mf">117.93</span> <span class="mf">195.60</span>
728 <span class="o">---------------------------------------------------------------------------------------------------------------------------------</span>
729 </pre></div>
730 </div>
731 </div>
732 <div class="section" id="id1">
733 <h3>Where<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h3>
734 <p>Get Statistics</p>
735 <blockquote>
736 <div>Statistics information of get command</div></blockquote>
737 <p>Set Statistics</p>
738 <blockquote>
739 <div>Statistics information of set command</div></blockquote>
740 <p>Total Statistics</p>
741 <blockquote>
742 <div>Statistics information of both get and set command</div></blockquote>
743 <p>Period</p>
744 <blockquote>
745 <div>Result within a period</div></blockquote>
746 <p>Global</p>
747 <blockquote>
748 <div>Accumulated results</div></blockquote>
749 <p>Ops</p>
750 <blockquote>
751 <div>Total operations</div></blockquote>
752 <p>TPS</p>
753 <blockquote>
754 <div>Throughput, operations/second</div></blockquote>
755 <p>Net</p>
756 <blockquote>
757 <div>The rate of network</div></blockquote>
758 <p>Get_miss</p>
759 <blockquote>
760 <div>How many objects can't be gotten</div></blockquote>
761 <p>Min</p>
762 <blockquote>
763 <div>The minimum response time</div></blockquote>
764 <p>Max</p>
765 <blockquote>
766 <div>The maximum response time</div></blockquote>
767 <p>Avg:</p>
768 <blockquote>
769 <div>The average response time</div></blockquote>
770 <p>Std_dev</p>
771 <blockquote>
772 <div>Standard deviation of response time</div></blockquote>
773 <p>Geo_dist</p>
774 <blockquote>
775 <div>Geometric distribution based on natural exponential function</div></blockquote>
776 <p>At the end, memaslap will output something like this:</p>
777 <div class="highlight-perl notranslate"><div class="highlight"><pre><span></span><span class="o">---------------------------------------------------------------------------------------------------------------------------------</span>
778 <span class="n">Get</span> <span class="n">Statistics</span> <span class="p">(</span><span class="mi">1257956</span> <span class="n">events</span><span class="p">)</span>
779 <span class="n">Min:</span> <span class="mi">26</span>
780 <span class="n">Max:</span> <span class="mi">3791</span>
781 <span class="n">Avg:</span> <span class="mi">224</span>
782 <span class="n">Geo:</span> <span class="mf">192.60</span>
783 <span class="n">Std:</span> <span class="mf">116.23</span>
784 <span class="n">Log2</span> <span class="n">Dist:</span>
785 <span class="mi">4</span><span class="p">:</span> <span class="mi">0</span> <span class="mi">10</span> <span class="mi">84490</span> <span class="mi">215345</span>
786 <span class="mi">8</span><span class="p">:</span> <span class="mi">484890</span> <span class="mi">459823</span> <span class="mi">12543</span> <span class="mi">824</span>
787 <span class="mi">12</span><span class="p">:</span> <span class="mi">31</span>
788
789 <span class="n">Set</span> <span class="n">Statistics</span> <span class="p">(</span><span class="mi">139782</span> <span class="n">events</span><span class="p">)</span>
790 <span class="n">Min:</span> <span class="mi">37</span>
791 <span class="n">Max:</span> <span class="mi">3790</span>
792 <span class="n">Avg:</span> <span class="mi">253</span>
793 <span class="n">Geo:</span> <span class="mf">224.84</span>
794 <span class="n">Std:</span> <span class="mf">116.83</span>
795 <span class="n">Log2</span> <span class="n">Dist:</span>
796 <span class="mi">4</span><span class="p">:</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">4200</span> <span class="mi">16988</span>
797 <span class="mi">8</span><span class="p">:</span> <span class="mi">50784</span> <span class="mi">65574</span> <span class="mi">2064</span> <span class="mi">167</span>
798 <span class="mi">12</span><span class="p">:</span> <span class="mi">5</span>
799
800 <span class="n">Total</span> <span class="n">Statistics</span> <span class="p">(</span><span class="mi">1397738</span> <span class="n">events</span><span class="p">)</span>
801 <span class="n">Min:</span> <span class="mi">26</span>
802 <span class="n">Max:</span> <span class="mi">3791</span>
803 <span class="n">Avg:</span> <span class="mi">227</span>
804 <span class="n">Geo:</span> <span class="mf">195.60</span>
805 <span class="n">Std:</span> <span class="mf">116.60</span>
806 <span class="n">Log2</span> <span class="n">Dist:</span>
807 <span class="mi">4</span><span class="p">:</span> <span class="mi">0</span> <span class="mi">10</span> <span class="mi">88690</span> <span class="mi">232333</span>
808 <span class="mi">8</span><span class="p">:</span> <span class="mi">535674</span> <span class="mi">525397</span> <span class="mi">14607</span> <span class="mi">991</span>
809 <span class="mi">12</span><span class="p">:</span> <span class="mi">36</span>
810
811 <span class="n">cmd_get:</span> <span class="mi">1257969</span>
812 <span class="n">cmd_set:</span> <span class="mi">139785</span>
813 <span class="n">get_misses:</span> <span class="mi">0</span>
814 <span class="n">verify_misses:</span> <span class="mi">0</span>
815 <span class="n">verify_failed:</span> <span class="mi">0</span>
816 <span class="n">expired_get:</span> <span class="mi">0</span>
817 <span class="n">unexpired_unget:</span> <span class="mi">0</span>
818 <span class="n">written_bytes:</span> <span class="mi">242516030</span>
819 <span class="n">read_bytes:</span> <span class="mi">1003702556</span>
820 <span class="n">object_bytes:</span> <span class="mi">152086080</span>
821 <span class="n">packet_disorder:</span> <span class="mi">0</span>
822 <span class="n">packet_drop:</span> <span class="mi">0</span>
823 <span class="n">udp_timeout:</span> <span class="mi">0</span>
824
825 <span class="n">Run</span> <span class="nb">time</span><span class="p">:</span> <span class="mf">20.0</span><span class="n">s</span> <span class="n">Ops:</span> <span class="mi">1397754</span> <span class="n">TPS:</span> <span class="mi">69817</span> <span class="n">Net_rate:</span> <span class="mf">59.4</span><span class="n">M</span><span class="o">/</span><span class="n">s</span>
826 <span class="o">---------------------------------------------------------------------------------------------------------------------------------</span>
827 </pre></div>
828 </div>
829 </div>
830 <div class="section" id="id2">
831 <h3>Where<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
832 <p>Get Statistics</p>
833 <blockquote>
834 <div>Get statistics of response time</div></blockquote>
835 <p>Set Statistics</p>
836 <blockquote>
837 <div>Set statistics of response time</div></blockquote>
838 <p>Total Statistics</p>
839 <blockquote>
840 <div>Both get and set statistics of response time</div></blockquote>
841 <p>Min</p>
842 <blockquote>
843 <div>The accumulated and minimum response time</div></blockquote>
844 <p>Max</p>
845 <blockquote>
846 <div>The accumulated and maximum response time</div></blockquote>
847 <p>Avg</p>
848 <blockquote>
849 <div>The accumulated and average response time</div></blockquote>
850 <p>Std</p>
851 <blockquote>
852 <div>Standard deviation of response time</div></blockquote>
853 <p>Log2 Dist</p>
854 <blockquote>
855 <div>Geometric distribution based on logarithm 2</div></blockquote>
856 <p>cmd_get</p>
857 <blockquote>
858 <div>Total get commands done</div></blockquote>
859 <p>cmd_set</p>
860 <blockquote>
861 <div>Total set commands done</div></blockquote>
862 <p>get_misses</p>
863 <blockquote>
864 <div>How many objects can't be gotten from server</div></blockquote>
865 <p>verify_misses</p>
866 <blockquote>
867 <div>How many objects need to verify but can't get them</div></blockquote>
868 <p>verify_failed</p>
869 <blockquote>
870 <div>How many objects with insistent value</div></blockquote>
871 <p>expired_get</p>
872 <blockquote>
873 <div>How many objects are expired but we get them</div></blockquote>
874 <p>unexpired_unget</p>
875 <blockquote>
876 <div>How many objects are unexpired but we can't get them</div></blockquote>
877 <p>written_bytes</p>
878 <blockquote>
879 <div>Total written bytes</div></blockquote>
880 <p>read_bytes</p>
881 <blockquote>
882 <div>Total read bytes</div></blockquote>
883 <p>object_bytes</p>
884 <blockquote>
885 <div>Total object bytes</div></blockquote>
886 <p>packet_disorder</p>
887 <blockquote>
888 <div>How many UDP packages are disorder</div></blockquote>
889 <p>packet_drop</p>
890 <blockquote>
891 <div>How many UDP packages are lost</div></blockquote>
892 <p>udp_timeout</p>
893 <blockquote>
894 <div>How many times UDP time out happen</div></blockquote>
895 <p>Run time</p>
896 <blockquote>
897 <div>Total run time</div></blockquote>
898 <p>Ops</p>
899 <blockquote>
900 <div>Total operations</div></blockquote>
901 <p>TPS</p>
902 <blockquote>
903 <div>Throughput, operations/second</div></blockquote>
904 <p>Net_rate</p>
905 <blockquote>
906 <div>The average rate of network</div></blockquote>
907 </div>
908 </div>
909 <div class="section" id="options">
910 <h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline"></a></h2>
911 <dl class="docutils">
912 <dt>-s, --servers=</dt>
913 <dd>List one or more servers to connect. Servers count must be less than
914 threads count. e.g.: --servers=localhost:1234,localhost:11211</dd>
915 <dt>-T, --threads=</dt>
916 <dd>Number of threads to startup, better equal to CPU numbers. Default 8.</dd>
917 <dt>-c, --concurrency=</dt>
918 <dd>Number of concurrency to simulate with load. Default 128.</dd>
919 <dt>-n, --conn_sock=</dt>
920 <dd>Number of TCP socks per concurrency. Default 1.</dd>
921 <dt>-x, --execute_number=</dt>
922 <dd>Number of operations(get and set) to execute for the
923 given test. Default 1000000.</dd>
924 <dt>-t, --time=</dt>
925 <dd>How long the test to run, suffix: s-seconds, m-minutes, h-hours,
926 d-days e.g.: --time=2h.</dd>
927 <dt>-F, --cfg_cmd=</dt>
928 <dd>Load the configure file to get command,key and value distribution list.</dd>
929 <dt>-w, --win_size=</dt>
930 <dd>Task window size of each concurrency, suffix: K, M e.g.: --win_size=10k.
931 Default 10k.</dd>
932 <dt>-X, --fixed_size=</dt>
933 <dd>Fixed length of value.</dd>
934 <dt>-v, --verify=</dt>
935 <dd>The proportion of date verification, e.g.: --verify=0.01</dd>
936 <dt>-d, --division=</dt>
937 <dd>Number of keys to multi-get once. Default 1, means single get.</dd>
938 <dt>-S, --stat_freq=</dt>
939 <dd>Frequency of dumping statistic information. suffix: s-seconds,
940 m-minutes, e.g.: --resp_freq=10s.</dd>
941 <dt>-e, --exp_verify=</dt>
942 <dd>The proportion of objects with expire time, e.g.: --exp_verify=0.01.
943 Default no object with expire time</dd>
944 <dt>-o, --overwrite=</dt>
945 <dd>The proportion of objects need overwrite, e.g.: --overwrite=0.01.
946 Default never overwrite object.</dd>
947 </dl>
948 <table class="docutils option-list" frame="void" rules="none">
949 <col class="option" />
950 <col class="description" />
951 <tbody valign="top">
952 <tr><td class="option-group" colspan="2">
953 <kbd><span class="option">-R</span>, <span class="option">--reconnect</span></kbd></td>
954 </tr>
955 <tr><td>&#160;</td><td>Reconnect tests, when connection is closed it will be reconnected.</td></tr>
956 <tr><td class="option-group">
957 <kbd><span class="option">-U</span>, <span class="option">--udp</span></kbd></td>
958 <td>UDP tests, default memaslap uses TCP, TCP port and UDP port of
959 server must be same.</td></tr>
960 <tr><td class="option-group">
961 <kbd><span class="option">-a</span>, <span class="option">--facebook</span></kbd></td>
962 <td>Whether it enables facebook test feature, set with TCP and multi-get with UDP.</td></tr>
963 <tr><td class="option-group">
964 <kbd><span class="option">-B</span>, <span class="option">--binary</span></kbd></td>
965 <td>Whether it enables binary protocol. Default with ASCII protocol.</td></tr>
966 </tbody>
967 </table>
968 <dl class="docutils">
969 <dt>-P, --tps=</dt>
970 <dd>Expected throughput, suffix: K, e.g.: --tps=10k.</dd>
971 <dt>-p, --rep_write=</dt>
972 <dd>The first nth servers can write data, e.g.: --rep_write=2.</dd>
973 </dl>
974 <table class="docutils option-list" frame="void" rules="none">
975 <col class="option" />
976 <col class="description" />
977 <tbody valign="top">
978 <tr><td class="option-group">
979 <kbd><span class="option">-b</span>, <span class="option">--verbose</span></kbd></td>
980 <td>Whether it outputs detailed information when verification fails.</td></tr>
981 <tr><td class="option-group">
982 <kbd><span class="option">-h</span>, <span class="option">--help</span></kbd></td>
983 <td>Display this message and then exit.</td></tr>
984 <tr><td class="option-group">
985 <kbd><span class="option">-V</span>, <span class="option">--version</span></kbd></td>
986 <td>Display the version of the application and then exit.</td></tr>
987 </tbody>
988 </table>
989 </div>
990 <div class="section" id="examples">
991 <h2>EXAMPLES<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h2>
992 <p>memaslap -s 127.0.0.1:11211 -S 5s</p>
993 <p>memaslap -s 127.0.0.1:11211 -t 2m -v 0.2 -e 0.05 -b</p>
994 <p>memaslap -s 127.0.0.1:11211 -F config -t 2m -w 40k -S 20s -o 0.2</p>
995 <p>memaslap -s 127.0.0.1:11211 -F config -t 2m -T 4 -c 128 -d 20 -P 40k</p>
996 <p>memaslap -s 127.0.0.1:11211 -F config -t 2m -d 50 -a -n 40</p>
997 <p>memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m</p>
998 <p>memaslap -s 127.0.0.1:11211,127.0.0.1:11212 -F config -t 2m -p 2</p>
999 </div>
1000 <div class="section" id="notes">
1001 <h2>NOTES<a class="headerlink" href="#notes" title="Permalink to this headline"></a></h2>
1002 <p>The prefix of this program is variable, i.e. it can be configured at build time.</p>
1003 <p>Usually the client programs of <code class="docutils literal notranslate"><span class="pre">libmemcached-awesome</span></code> are prefixed with <code class="docutils literal notranslate"><span class="pre">mem</span></code>, like <code class="docutils literal notranslate"><span class="pre">memcat</span></code> or <code class="docutils literal notranslate"><span class="pre">memcp</span></code>.</p>
1004 <p>It can be configured, though, to replace the prefix with something else like <code class="docutils literal notranslate"><span class="pre">mc</span></code>, in case of that,
1005 the client programs of <code class="docutils literal notranslate"><span class="pre">libmemcached-awesome</span></code> would be called <code class="docutils literal notranslate"><span class="pre">mccat</span></code>, <code class="docutils literal notranslate"><span class="pre">mccp</span></code>, etc. respectively.</p>
1006 <p>This is a contributed program.</p>
1007 <p>This program doesn't follow the standard flag/option scheme.</p>
1008 </div>
1009 <div class="section" id="see-also">
1010 <h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline"></a></h2>
1011 </div>
1012 </div>
1013
1014
1015 </div>
1016
1017 </div>
1018 <footer>
1019
1020 <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
1021
1022 <a href="memslap.html" class="btn btn-neutral float-right" title="memslap" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
1023
1024
1025 <a href="memrm.html" class="btn btn-neutral float-left" title="memrm" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
1026
1027 </div>
1028
1029
1030 <hr/>
1031
1032 <div role="contentinfo">
1033 <p>
1034 &copy; <a href="../copyright.html">Copyright</a>
1035
1036 </p>
1037 </div>
1038 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
1039
1040 </footer>
1041
1042 </div>
1043 </div>
1044
1045 </section>
1046
1047 </div>
1048
1049
1050
1051 <script type="text/javascript">
1052 jQuery(function () {
1053 SphinxRtdTheme.Navigation.enable(true);
1054 });
1055 </script>
1056
1057
1058
1059
1060
1061
1062 </body>
1063 </html>