Permalink
Browse files

tools: wrk update to 5b2fa06

  • Loading branch information...
1 parent d2952cc commit 407e295f4359b62d2d298ec5aaa9f075cf45eb4f @tjfontaine tjfontaine committed Feb 25, 2014
Showing with 115,294 additions and 461 deletions.
  1. +14 −2 tools/wrk/.gitignore
  2. +43 −14 tools/wrk/Makefile
  3. +28 −0 tools/wrk/NOTICE
  4. +82 −13 tools/wrk/README
  5. +56 −0 tools/wrk/deps/luajit/COPYRIGHT
  6. +149 −0 tools/wrk/deps/luajit/Makefile
  7. +16 −0 tools/wrk/deps/luajit/README
  8. +166 −0 tools/wrk/deps/luajit/doc/bluequad-print.css
  9. +325 −0 tools/wrk/deps/luajit/doc/bluequad.css
  10. +892 −0 tools/wrk/deps/luajit/doc/changes.html
  11. +102 −0 tools/wrk/deps/luajit/doc/contact.html
  12. +187 −0 tools/wrk/deps/luajit/doc/ext_c_api.html
  13. +330 −0 tools/wrk/deps/luajit/doc/ext_ffi.html
  14. +566 −0 tools/wrk/deps/luajit/doc/ext_ffi_api.html
  15. +1,243 −0 tools/wrk/deps/luajit/doc/ext_ffi_semantics.html
  16. +601 −0 tools/wrk/deps/luajit/doc/ext_ffi_tutorial.html
  17. +199 −0 tools/wrk/deps/luajit/doc/ext_jit.html
  18. +408 −0 tools/wrk/deps/luajit/doc/extensions.html
  19. +184 −0 tools/wrk/deps/luajit/doc/faq.html
  20. BIN tools/wrk/deps/luajit/doc/img/contact.png
  21. +613 −0 tools/wrk/deps/luajit/doc/install.html
  22. +228 −0 tools/wrk/deps/luajit/doc/luajit.html
  23. +306 −0 tools/wrk/deps/luajit/doc/running.html
  24. +125 −0 tools/wrk/deps/luajit/doc/status.html
  25. +456 −0 tools/wrk/deps/luajit/dynasm/dasm_arm.h
  26. +1,122 −0 tools/wrk/deps/luajit/dynasm/dasm_arm.lua
  27. +416 −0 tools/wrk/deps/luajit/dynasm/dasm_mips.h
  28. +953 −0 tools/wrk/deps/luajit/dynasm/dasm_mips.lua
  29. +412 −0 tools/wrk/deps/luajit/dynasm/dasm_ppc.h
  30. +1,249 −0 tools/wrk/deps/luajit/dynasm/dasm_ppc.lua
  31. +83 −0 tools/wrk/deps/luajit/dynasm/dasm_proto.h
  32. +12 −0 tools/wrk/deps/luajit/dynasm/dasm_x64.lua
  33. +471 −0 tools/wrk/deps/luajit/dynasm/dasm_x86.h
  34. +1,931 −0 tools/wrk/deps/luajit/dynasm/dasm_x86.lua
  35. +1,095 −0 tools/wrk/deps/luajit/dynasm/dynasm.lua
  36. +88 −0 tools/wrk/deps/luajit/etc/luajit.1
  37. +24 −0 tools/wrk/deps/luajit/etc/luajit.pc
  38. +677 −0 tools/wrk/deps/luajit/src/Makefile
  39. +226 −0 tools/wrk/deps/luajit/src/Makefile.dep
  40. +4 −0 tools/wrk/deps/luajit/src/host/README
  41. +516 −0 tools/wrk/deps/luajit/src/host/buildvm.c
  42. +104 −0 tools/wrk/deps/luajit/src/host/buildvm.h
  43. +313 −0 tools/wrk/deps/luajit/src/host/buildvm_asm.c
  44. +229 −0 tools/wrk/deps/luajit/src/host/buildvm_fold.c
  45. +398 −0 tools/wrk/deps/luajit/src/host/buildvm_lib.c
  46. +368 −0 tools/wrk/deps/luajit/src/host/buildvm_peobj.c
  47. +427 −0 tools/wrk/deps/luajit/src/host/genminilua.lua
  48. +7,769 −0 tools/wrk/deps/luajit/src/host/minilua.c
  49. +191 −0 tools/wrk/deps/luajit/src/jit/bc.lua
  50. +659 −0 tools/wrk/deps/luajit/src/jit/bcsave.lua
  51. +689 −0 tools/wrk/deps/luajit/src/jit/dis_arm.lua
  52. +428 −0 tools/wrk/deps/luajit/src/jit/dis_mips.lua
  53. +20 −0 tools/wrk/deps/luajit/src/jit/dis_mipsel.lua
  54. +591 −0 tools/wrk/deps/luajit/src/jit/dis_ppc.lua
  55. +20 −0 tools/wrk/deps/luajit/src/jit/dis_x64.lua
  56. +836 −0 tools/wrk/deps/luajit/src/jit/dis_x86.lua
  57. +700 −0 tools/wrk/deps/luajit/src/jit/dump.lua
  58. +167 −0 tools/wrk/deps/luajit/src/jit/v.lua
  59. +167 −0 tools/wrk/deps/luajit/src/lauxlib.h
  60. +356 −0 tools/wrk/deps/luajit/src/lib_aux.c
  61. +683 −0 tools/wrk/deps/luajit/src/lib_base.c
  62. +74 −0 tools/wrk/deps/luajit/src/lib_bit.c
  63. +405 −0 tools/wrk/deps/luajit/src/lib_debug.c
  64. +850 −0 tools/wrk/deps/luajit/src/lib_ffi.c
  65. +55 −0 tools/wrk/deps/luajit/src/lib_init.c
  66. +539 −0 tools/wrk/deps/luajit/src/lib_io.c
  67. +663 −0 tools/wrk/deps/luajit/src/lib_jit.c
  68. +233 −0 tools/wrk/deps/luajit/src/lib_math.c
  69. +280 −0 tools/wrk/deps/luajit/src/lib_os.c
  70. +605 −0 tools/wrk/deps/luajit/src/lib_package.c
  71. +940 −0 tools/wrk/deps/luajit/src/lib_string.c
  72. +300 −0 tools/wrk/deps/luajit/src/lib_table.c
  73. +26 −0 tools/wrk/deps/luajit/src/lj.supp
  74. +1,388 −0 tools/wrk/deps/luajit/src/lj_alloc.c
  75. +17 −0 tools/wrk/deps/luajit/src/lj_alloc.h
  76. +1,200 −0 tools/wrk/deps/luajit/src/lj_api.c
  77. +419 −0 tools/wrk/deps/luajit/src/lj_arch.h
  78. +1,912 −0 tools/wrk/deps/luajit/src/lj_asm.c
  79. +17 −0 tools/wrk/deps/luajit/src/lj_asm.h
  80. +2,358 −0 tools/wrk/deps/luajit/src/lj_asm_arm.h
  81. +1,976 −0 tools/wrk/deps/luajit/src/lj_asm_mips.h
  82. +2,166 −0 tools/wrk/deps/luajit/src/lj_asm_ppc.h
  83. +2,793 −0 tools/wrk/deps/luajit/src/lj_asm_x86.h
  84. +14 −0 tools/wrk/deps/luajit/src/lj_bc.c
  85. +261 −0 tools/wrk/deps/luajit/src/lj_bc.h
  86. +66 −0 tools/wrk/deps/luajit/src/lj_bcdump.h
  87. +476 −0 tools/wrk/deps/luajit/src/lj_bcread.c
  88. +396 −0 tools/wrk/deps/luajit/src/lj_bcwrite.c
  89. +351 −0 tools/wrk/deps/luajit/src/lj_carith.c
  90. +27 −0 tools/wrk/deps/luajit/src/lj_carith.h
  91. +899 −0 tools/wrk/deps/luajit/src/lj_ccall.c
  92. +171 −0 tools/wrk/deps/luajit/src/lj_ccall.h
  93. +641 −0 tools/wrk/deps/luajit/src/lj_ccallback.c
  94. +25 −0 tools/wrk/deps/luajit/src/lj_ccallback.h
  95. +751 −0 tools/wrk/deps/luajit/src/lj_cconv.c
  96. +70 −0 tools/wrk/deps/luajit/src/lj_cconv.h
  97. +285 −0 tools/wrk/deps/luajit/src/lj_cdata.c
  98. +75 −0 tools/wrk/deps/luajit/src/lj_cdata.h
  99. +43 −0 tools/wrk/deps/luajit/src/lj_char.c
  100. +42 −0 tools/wrk/deps/luajit/src/lj_char.h
  101. +412 −0 tools/wrk/deps/luajit/src/lj_clib.c
  102. +29 −0 tools/wrk/deps/luajit/src/lj_clib.h
  103. +1,872 −0 tools/wrk/deps/luajit/src/lj_cparse.c
  104. +65 −0 tools/wrk/deps/luajit/src/lj_cparse.h
  105. +1,653 −0 tools/wrk/deps/luajit/src/lj_crecord.c
  106. +31 −0 tools/wrk/deps/luajit/src/lj_crecord.h
  107. +634 −0 tools/wrk/deps/luajit/src/lj_ctype.c
  108. +461 −0 tools/wrk/deps/luajit/src/lj_ctype.h
  109. +596 −0 tools/wrk/deps/luajit/src/lj_debug.c
  110. +61 −0 tools/wrk/deps/luajit/src/lj_debug.h
  111. +349 −0 tools/wrk/deps/luajit/src/lj_def.h
  112. +494 −0 tools/wrk/deps/luajit/src/lj_dispatch.c
  113. +131 −0 tools/wrk/deps/luajit/src/lj_dispatch.h
  114. +356 −0 tools/wrk/deps/luajit/src/lj_emit_arm.h
  115. +211 −0 tools/wrk/deps/luajit/src/lj_emit_mips.h
  116. +238 −0 tools/wrk/deps/luajit/src/lj_emit_ppc.h
  117. +466 −0 tools/wrk/deps/luajit/src/lj_emit_x86.h
  118. +785 −0 tools/wrk/deps/luajit/src/lj_err.c
  119. +41 −0 tools/wrk/deps/luajit/src/lj_err.h
  120. +192 −0 tools/wrk/deps/luajit/src/lj_errmsg.h
  121. +18 −0 tools/wrk/deps/luajit/src/lj_ff.h
  122. +889 −0 tools/wrk/deps/luajit/src/lj_ffrecord.c
  123. +24 −0 tools/wrk/deps/luajit/src/lj_ffrecord.h
  124. +183 −0 tools/wrk/deps/luajit/src/lj_frame.h
  125. +185 −0 tools/wrk/deps/luajit/src/lj_func.c
  126. +24 −0 tools/wrk/deps/luajit/src/lj_func.h
  127. +839 −0 tools/wrk/deps/luajit/src/lj_gc.c
  128. +134 −0 tools/wrk/deps/luajit/src/lj_gc.h
  129. +793 −0 tools/wrk/deps/luajit/src/lj_gdbjit.c
  130. +22 −0 tools/wrk/deps/luajit/src/lj_gdbjit.h
  131. +501 −0 tools/wrk/deps/luajit/src/lj_ir.c
  132. +551 −0 tools/wrk/deps/luajit/src/lj_ir.h
  133. +271 −0 tools/wrk/deps/luajit/src/lj_ircall.h
  134. +161 −0 tools/wrk/deps/luajit/src/lj_iropt.h
  135. +416 −0 tools/wrk/deps/luajit/src/lj_jit.h
  136. +481 −0 tools/wrk/deps/luajit/src/lj_lex.c
  137. +85 −0 tools/wrk/deps/luajit/src/lj_lex.h
  138. +258 −0 tools/wrk/deps/luajit/src/lj_lib.c
  139. +112 −0 tools/wrk/deps/luajit/src/lj_lib.h
  140. +168 −0 tools/wrk/deps/luajit/src/lj_load.c
  141. +360 −0 tools/wrk/deps/luajit/src/lj_mcode.c
  142. +30 −0 tools/wrk/deps/luajit/src/lj_mcode.h
  143. +466 −0 tools/wrk/deps/luajit/src/lj_meta.c
  144. +37 −0 tools/wrk/deps/luajit/src/lj_meta.h
  145. +35 −0 tools/wrk/deps/luajit/src/lj_obj.c
  146. +856 −0 tools/wrk/deps/luajit/src/lj_obj.h
  147. +77 −0 tools/wrk/deps/luajit/src/lj_opt_dce.c
  148. +2,295 −0 tools/wrk/deps/luajit/src/lj_opt_fold.c
  149. +437 −0 tools/wrk/deps/luajit/src/lj_opt_loop.c
  150. +907 −0 tools/wrk/deps/luajit/src/lj_opt_mem.c
  151. +648 −0 tools/wrk/deps/luajit/src/lj_opt_narrow.c
  152. +245 −0 tools/wrk/deps/luajit/src/lj_opt_sink.c
  153. +731 −0 tools/wrk/deps/luajit/src/lj_opt_split.c
  154. +2,750 −0 tools/wrk/deps/luajit/src/lj_parse.c
  155. +18 −0 tools/wrk/deps/luajit/src/lj_parse.h
  156. +2,247 −0 tools/wrk/deps/luajit/src/lj_record.c
  157. +44 −0 tools/wrk/deps/luajit/src/lj_record.h
  158. +862 −0 tools/wrk/deps/luajit/src/lj_snap.c
  159. +34 −0 tools/wrk/deps/luajit/src/lj_snap.h
  160. +287 −0 tools/wrk/deps/luajit/src/lj_state.c
  161. +35 −0 tools/wrk/deps/luajit/src/lj_state.h
  162. +339 −0 tools/wrk/deps/luajit/src/lj_str.c
  163. +50 −0 tools/wrk/deps/luajit/src/lj_str.h
  164. +497 −0 tools/wrk/deps/luajit/src/lj_strscan.c
  165. +39 −0 tools/wrk/deps/luajit/src/lj_strscan.h
  166. +624 −0 tools/wrk/deps/luajit/src/lj_tab.c
  167. +67 −0 tools/wrk/deps/luajit/src/lj_tab.h
  168. +162 −0 tools/wrk/deps/luajit/src/lj_target.h
  169. +274 −0 tools/wrk/deps/luajit/src/lj_target_arm.h
  170. +257 −0 tools/wrk/deps/luajit/src/lj_target_mips.h
  171. +280 −0 tools/wrk/deps/luajit/src/lj_target_ppc.h
  172. +342 −0 tools/wrk/deps/luajit/src/lj_target_x86.h
  173. +815 −0 tools/wrk/deps/luajit/src/lj_trace.c
  174. +53 −0 tools/wrk/deps/luajit/src/lj_trace.h
  175. +61 −0 tools/wrk/deps/luajit/src/lj_traceerr.h
  176. +34 −0 tools/wrk/deps/luajit/src/lj_udata.c
  177. +14 −0 tools/wrk/deps/luajit/src/lj_udata.h
  178. +116 −0 tools/wrk/deps/luajit/src/lj_vm.h
  179. +57 −0 tools/wrk/deps/luajit/src/lj_vmevent.c
  180. +59 −0 tools/wrk/deps/luajit/src/lj_vmevent.h
  181. +140 −0 tools/wrk/deps/luajit/src/lj_vmmath.c
  182. +93 −0 tools/wrk/deps/luajit/src/ljamalg.c
  183. +393 −0 tools/wrk/deps/luajit/src/lua.h
  184. +9 −0 tools/wrk/deps/luajit/src/lua.hpp
  185. +139 −0 tools/wrk/deps/luajit/src/luaconf.h
  186. +571 −0 tools/wrk/deps/luajit/src/luajit.c
  187. +70 −0 tools/wrk/deps/luajit/src/luajit.h
  188. +43 −0 tools/wrk/deps/luajit/src/lualib.h
  189. +113 −0 tools/wrk/deps/luajit/src/msvcbuild.bat
  190. +4,487 −0 tools/wrk/deps/luajit/src/vm_arm.dasc
  191. +4,241 −0 tools/wrk/deps/luajit/src/vm_mips.dasc
  192. +5,137 −0 tools/wrk/deps/luajit/src/vm_ppc.dasc
  193. +3,691 −0 tools/wrk/deps/luajit/src/vm_ppcspe.dasc
  194. +6,374 −0 tools/wrk/deps/luajit/src/vm_x86.dasc
  195. +92 −0 tools/wrk/deps/luajit/src/xedkbuild.bat
  196. +18 −0 tools/wrk/scripts/auth.lua
  197. +14 −0 tools/wrk/scripts/counter.lua
  198. +16 −0 tools/wrk/scripts/pipeline.lua
  199. +6 −0 tools/wrk/scripts/post.lua
  200. +10 −0 tools/wrk/scripts/report.lua
  201. +3 −3 tools/wrk/src/ae.c
  202. +6 −6 tools/wrk/src/ae_evport.c
  203. +2 −2 tools/wrk/src/config.h
  204. +270 −153 tools/wrk/src/http_parser.c
  205. +48 −61 tools/wrk/src/http_parser.h
  206. +58 −0 tools/wrk/src/main.h
  207. +39 −0 tools/wrk/src/net.c
  208. +29 −0 tools/wrk/src/net.h
  209. +296 −0 tools/wrk/src/script.c
  210. +35 −0 tools/wrk/src/script.h
  211. +99 −0 tools/wrk/src/ssl.c
  212. +14 −0 tools/wrk/src/ssl.h
  213. +48 −18 tools/wrk/src/stats.c
  214. +25 −3 tools/wrk/src/stats.h
  215. +10 −2 tools/wrk/src/units.c
  216. +2 −0 tools/wrk/src/units.h
  217. +317 −147 tools/wrk/src/wrk.c
  218. +24 −37 tools/wrk/src/wrk.h
  219. +57 −0 tools/wrk/src/wrk.lua
View
@@ -1,2 +1,14 @@
-obj/*
-/wrk
+*.o
+*.a
+wrk
+deps/luajit/src/host/buildvm
+deps/luajit/src/host/buildvm_arch.h
+deps/luajit/src/host/minilua
+deps/luajit/src/jit/vmdef.lua
+deps/luajit/src/lj_bcdef.h
+deps/luajit/src/lj_ffdef.h
+deps/luajit/src/lj_folddef.h
+deps/luajit/src/lj_libdef.h
+deps/luajit/src/lj_recdef.h
+deps/luajit/src/lj_vm.s
+deps/luajit/src/luajit
View
@@ -1,35 +1,64 @@
-CFLAGS := -std=c99 -Wall -O2 -pthread
-LDFLAGS := -pthread
-LIBS := -lm
-ifeq ($(shell uname),SunOS)
-LIBS += -lnsl -lsocket -lresolv
+CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT
+LIBS := -lpthread -lm -lcrypto -lssl
+
+TARGET := $(shell uname -s | tr [A-Z] [a-z] 2>/dev/null || echo unknown)
+
+ifeq ($(TARGET), sunos)
+ CFLAGS += -D_PTHREADS -D_POSIX_C_SOURCE=200112L
+ LIBS += -lsocket
+else ifeq ($(TARGET), darwin)
+ LDFLAGS += -pagezero_size 10000 -image_base 100000000
+else ifeq ($(TARGET), linux)
+ LIBS += -ldl
+ LDFLAGS += -Wl,-E
+else ifeq ($(TARGET), freebsd)
+ CFLAGS += -D_DECLARE_C99_LDBL_MATH
+ LDFLAGS += -Wl,-E
endif
-SRC := wrk.c aprintf.c stats.c units.c ae.c zmalloc.c http_parser.c tinymt64.c
+SRC := wrk.c net.c ssl.c aprintf.c stats.c script.c units.c \
+ ae.c zmalloc.c http_parser.c tinymt64.c
BIN := wrk
ODIR := obj
-OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC))
+OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o
+
+LDIR = deps/luajit/src
+LIBS := -lluajit $(LIBS)
+CFLAGS += -I $(LDIR)
+LDFLAGS += -L $(LDIR)
all: $(BIN)
clean:
$(RM) $(BIN) obj/*
+ @$(MAKE) -C deps/luajit clean
$(BIN): $(OBJ)
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+ @echo LINK $(BIN)
+ @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-$(OBJ): config.h Makefile | $(ODIR)
+$(OBJ): config.h Makefile $(LDIR)/libluajit.a | $(ODIR)
$(ODIR):
- @mkdir $@
+ @mkdir -p $@
+
+$(ODIR)/bytecode.o: src/wrk.lua
+ @echo LUAJIT $<
+ @$(SHELL) -c 'cd $(LDIR) && ./luajit -b $(CURDIR)/$< $(CURDIR)/$@'
$(ODIR)/%.o : %.c
- $(CC) $(CFLAGS) -c -o $@ $<
+ @echo CC $<
+ @$(CC) $(CFLAGS) -c -o $@ $<
+
+$(LDIR)/libluajit.a:
+ @echo Building LuaJIT...
+ @$(MAKE) -C $(LDIR) BUILDMODE=static
.PHONY: all clean
.SUFFIXES:
-.SUFFIXES: .c .o
+.SUFFIXES: .c .o .lua
-vpath %.c src
-vpath %.h src
+vpath %.c src
+vpath %.h src
+vpath %.lua scripts
View
@@ -14,7 +14,9 @@ This product includes software developed by Salvatore Sanfilippo and
other contributors to the redis project.
Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com>
+Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
Copyright (C) 2009 Harish Mallipeddi - harish.mallipeddi@gmail.com
+Copyright (c) 2012, Joyent, Inc. All rights reserved.
Copyright (c) 2006-2009, Salvatore Sanfilippo
All rights reserved.
@@ -80,6 +82,32 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================================================
+== LuaJIT Notice ==
+=========================================================================
+
+LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/
+
+Copyright (C) 2005-2013 Mike Pall. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+=========================================================================
== Tiny Mersenne Twister (TinyMT) Notice ==
=========================================================================
View
@@ -4,23 +4,85 @@ wrk - a HTTP benchmarking tool
load when run on a single multi-core CPU. It combines a multithreaded
design with scalable event notification systems such as epoll and kqueue.
+ An optional LuaJIT script can perform HTTP request generation, response
+ processing, and custom reporting. Several example scripts are located in
+ scripts/
+
Basic Usage
- wrk -t8 -c400 -r10m http://localhost:8080/index.html
+ wrk -t12 -c400 -d30s http://127.0.0.1:8080/index.html
- This runs wrk with 8 threads, keeping 400 connections open, and making a
- total of 10 million HTTP GET requests to http://localhost:8080/index.html
+ This runs a benchmark for 30 seconds, using 12 threads, and keeping
+ 400 HTTP connections open.
Output:
- Making 10000000 requests to http://localhost:8080/index.html
- 8 threads and 400 connections
+ Running 30s test @ http://127.0.0.1:8080/index.html
+ 12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
- Latency 439.75us 350.49us 7.60ms 92.88%
- Req/Sec 61.13k 8.26k 72.00k 87.54%
- 10000088 requests in 19.87s, 3.42GB read
- Requests/sec: 503396.23
- Transfer/sec: 176.16MB
+ Latency 635.91us 0.89ms 12.92ms 93.69%
+ Req/Sec 56.20k 8.07k 62.00k 86.54%
+ 22464657 requests in 30.00s, 17.76GB read
+ Requests/sec: 748868.53
+ Transfer/sec: 606.33MB
+
+Scripting
+
+ wrk's public Lua API is:
+
+ init = function(args)
+ request = function()
+ response = function(status, headers, body)
+ done = function(summary, latency, requests)
+
+ wrk = {
+ scheme = "http",
+ host = "localhost",
+ port = nil,
+ method = "GET",
+ path = "/",
+ headers = {},
+ body = nil
+ }
+
+ function wrk.format(method, path, headers, body)
+
+ wrk.format returns a HTTP request string containing the passed
+ parameters merged with values from the wrk table.
+
+ global init -- function called when the thread is initialized
+ global request -- function returning the HTTP message for each request
+ global response -- optional function called with HTTP response data
+ global done -- optional function called with results of run
+
+ The init() function receives any extra command line arguments for the
+ script. Script arguments must be separated from wrk arguments with "--"
+ and scripts that override init() but not request() must call wrk.init()
+
+ The done() function receives a table containing result data, and two
+ statistics objects representing the sampled per-request latency and
+ per-thread request rate. Duration and latency are microsecond values
+ and rate is measured in requests per second.
+
+ latency.min -- minimum value seen
+ latency.max -- maximum value seen
+ latency.mean -- average value seen
+ latency.stdev -- standard deviation
+ latency:percentile(99.0) -- 99th percentile value
+ latency[i] -- raw sample value
+
+ summary = {
+ duration = N, -- run duration in microseconds
+ requests = N, -- total completed requests
+ bytes = N, -- total bytes received
+ errors = {
+ connect = N, -- total socket connection errors
+ read = N, -- total socket read errors
+ write = N, -- total socket write errors
+ status = N, -- total HTTP status codes > 399
+ timeout = N -- total request timeouts
+ }
+ }
Benchmarking Tips
@@ -29,9 +91,16 @@ Benchmarking Tips
initial connection burst the server's listen(2) backlog should be greater
than the number of concurrent connections being tested.
+ A user script that only changes the HTTP method, path, adds headers or
+ a body, will have no performance impact. If multiple HTTP requests are
+ necessary they should be pre-generated and returned via a quick lookup in
+ the request() call. Per-request actions, particularly building a new HTTP
+ request, and use of response() will necessarily reduce the amount of load
+ that can be generated.
+
Acknowledgements
wrk contains code from a number of open source projects including the
- 'ae' event loop from redis, the nginx/joyent/node.js 'http-parser' and
- the Tiny Mersenne Twister PRNG. Please consult the NOTICE file for
- licensing details.
+ 'ae' event loop from redis, the nginx/joyent/node.js 'http-parser',
+ Mike Pall's LuaJIT, and the Tiny Mersenne Twister PRNG. Please consult
+ the NOTICE file for licensing details.
@@ -0,0 +1,56 @@
+===============================================================================
+LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/
+
+Copyright (C) 2005-2013 Mike Pall. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+[ MIT license: http://www.opensource.org/licenses/mit-license.php ]
+
+===============================================================================
+[ LuaJIT includes code from Lua 5.1/5.2, which has this license statement: ]
+
+Copyright (C) 1994-2012 Lua.org, PUC-Rio.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+===============================================================================
+[ LuaJIT includes code from dlmalloc, which has this license statement: ]
+
+This is a version (aka dlmalloc) of malloc/free/realloc written by
+Doug Lea and released to the public domain, as explained at
+http://creativecommons.org/licenses/publicdomain
+
+===============================================================================
Oops, something went wrong.

0 comments on commit 407e295

Please sign in to comment.