nutcracker 0.2.4.12 → 0.3.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +8 -8
  2. data/Rakefile +1 -1
  3. data/ext/nutcracker/ChangeLog +10 -0
  4. data/ext/nutcracker/Makefile.am +2 -0
  5. data/ext/nutcracker/Makefile.in +101 -14
  6. data/ext/nutcracker/README.md +18 -1
  7. data/ext/nutcracker/config.h.in +18 -0
  8. data/ext/nutcracker/configure +196 -25
  9. data/ext/nutcracker/configure.ac +64 -6
  10. data/ext/nutcracker/extconf.rb +1 -1
  11. data/ext/nutcracker/man/nutcracker.8 +76 -0
  12. data/ext/nutcracker/notes/debug.txt +116 -16
  13. data/ext/nutcracker/notes/kqueue.pdf +0 -0
  14. data/ext/nutcracker/notes/recommendation.md +20 -0
  15. data/ext/nutcracker/notes/redis.md +2 -2
  16. data/ext/nutcracker/scripts/nutcracker.spec +1 -1
  17. data/ext/nutcracker/scripts/redis-check.sh +3 -1
  18. data/ext/nutcracker/src/Makefile.am +15 -6
  19. data/ext/nutcracker/src/Makefile.in +39 -36
  20. data/ext/nutcracker/src/event/Makefile.am +16 -0
  21. data/ext/nutcracker/src/event/Makefile.in +492 -0
  22. data/ext/nutcracker/src/event/nc_epoll.c +344 -0
  23. data/ext/nutcracker/src/event/nc_event.h +88 -0
  24. data/ext/nutcracker/src/event/nc_evport.c +420 -0
  25. data/ext/nutcracker/src/event/nc_kqueue.c +412 -0
  26. data/ext/nutcracker/src/hashkit/nc_crc32.c +19 -1
  27. data/ext/nutcracker/src/hashkit/nc_hashkit.h +3 -1
  28. data/ext/nutcracker/src/hashkit/nc_md5.c +257 -315
  29. data/ext/nutcracker/src/nc.c +12 -1
  30. data/ext/nutcracker/src/nc_connection.c +18 -1
  31. data/ext/nutcracker/src/nc_connection.h +1 -0
  32. data/ext/nutcracker/src/nc_core.c +22 -30
  33. data/ext/nutcracker/src/nc_core.h +22 -7
  34. data/ext/nutcracker/src/nc_proxy.c +8 -9
  35. data/ext/nutcracker/src/nc_queue.h +2 -0
  36. data/ext/nutcracker/src/nc_request.c +3 -4
  37. data/ext/nutcracker/src/nc_response.c +25 -8
  38. data/ext/nutcracker/src/nc_server.c +8 -6
  39. data/ext/nutcracker/src/nc_stats.c +46 -43
  40. data/ext/nutcracker/src/nc_stats.h +37 -30
  41. data/ext/nutcracker/src/nc_util.c +6 -1
  42. data/ext/nutcracker/src/proto/nc_redis.c +19 -5
  43. data/lib/nutcracker/version.rb +1 -1
  44. data/lib/nutcracker.rb +1 -1
  45. metadata +10 -4
  46. data/ext/nutcracker/src/nc_event.c +0 -214
  47. data/ext/nutcracker/src/nc_event.h +0 -39
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjMwZTc4ZGQ3NmQ1MTk5YzViYTAwMDJkZWJmOWU4YWE5NTQ4MWQ1OQ==
4
+ ZTlkN2UzMGQyY2ZlYzFhNGViMWIwMDgwNjJjNDUwMzc3NjI2NTI4Mw==
5
5
  data.tar.gz: !binary |-
6
- NjJmMWRiODY4YWRhN2I2NjdlMjk1MjBhMGRmMGVjNGNhZWRmYWY0Mg==
6
+ ODAyMDQ4MDdmYWI1NWRhYjc5YTIxOGYyZjA0NzRmMzBhMzZmODc1NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjRkNDE0MTZmMmRlNmYyNWQxYmEyNjExNmU5Y2M1ODkwZGYwYmVjMWE0NTU3
10
- MTI5OGVmODRkNGU2MjY1Zjg0ZmZiYTg5ZGE1Mzg1MDczODA4OTJkMGIzYzcw
11
- NjQzNzAyODczYjdhOTkwOGM3YmFkMmU3NWFmY2MxODE4ZjdkN2U=
9
+ NTEzZjc4NjUwMDFmM2ZkZmMyNjU5NDVjZjE5MGY3ZjEyOTc5NDM4ZGU3MGVm
10
+ OWU5OWY1ZTFhNjk5Zjg3YTdkYWNhNzEwMzQwNzk2MjlmODFiNzI1MjkwYTBi
11
+ MGY3MzVkNjk1NjNlODEzMTRmN2I3MWU3YjMzZjRmMGEwMTEzOTg=
12
12
  data.tar.gz: !binary |-
13
- NDY2MWExOThjZjQxYTM0ZjBhZmMwMjI5YzI1NzViMTlkNmRiNjNhY2VlN2Ri
14
- MGFmMWQ3ZGVhZDM3Mjg3MWY3ZDYwYjUwZGYzMTJiMjRjMzY3NTgzZjg5OTg1
15
- MTViODBjN2JhMjJmNDFjYzUxZGNiMzNjYjU5MTJjMTZiNDViNGE=
13
+ OGZiZmU3NmM5NzBlYzE4YTkzMGViYzZiNjU3ZjMwNjNmMThmYmJhZTAyYTBi
14
+ MjQ4NWYzMTA2ZDFjNmRiMjQyOTZjYTljYjZkYjQ3NWVjOWUwNjExY2FlMzBm
15
+ MmY3ZDg1YzNhZjY0NGY0MmRhMjFjZjViNzYxYzE5NjU2MDhmZGE=
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ task :download do
17
17
  sh "mv nutcracker-#{sversion} ext/nutcracker"
18
18
  File.open("ext/nutcracker/extconf.rb",'w') do |file|
19
19
  file.puts %q{
20
- raise "no support for #{RUBY_PLATFORM}" if RUBY_PLATFORM =~ /darwin|mswin|mingw/
20
+ #raise "no support for #{RUBY_PLATFORM}" if RUBY_PLATFORM =~ /darwin|mswin|mingw/
21
21
  system "./configure --prefix=#{File.expand_path('..',__FILE__)}"
22
22
  system 'make'
23
23
  }
@@ -1,3 +1,13 @@
1
+ 2013-20-12 Manju Rajashekhar <manj@cs.stanford.edu>
2
+ * twemproxy: version 0.3.0 release
3
+ SRANDMEMBER support for the optional count argument (mkhq)
4
+ Handle case where server responds while the request is still being sent (jdi-tagged)
5
+ event ports (solaris/smartos) support
6
+ add timestamp when the server was ejected
7
+ support for set ex/px/nx/xx for redis 2.6.12 and up (ypocat)
8
+ kqueue (bsd) support (ferenyx)
9
+ fix parsing redis response to accept integer reply (charsyam)
10
+
1
11
  2013-23-04 Manju Rajashekhar <manj@cs.stanford.edu>
2
12
  * twemproxy: version 0.2.4 release
3
13
  redis keys must be less than mbuf_data_size() in length (fifsky)
@@ -4,4 +4,6 @@ ACLOCAL_AMFLAGS = -I m4
4
4
 
5
5
  SUBDIRS = contrib src
6
6
 
7
+ dist_man_MANS = man/nutcracker.8
8
+
7
9
  EXTRA_DIST = README.md NOTICE LICENSE ChangeLog conf scripts notes
@@ -34,11 +34,11 @@ POST_UNINSTALL = :
34
34
  build_triplet = @build@
35
35
  host_triplet = @host@
36
36
  subdir = .
37
- DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
38
- $(srcdir)/Makefile.in $(srcdir)/config.h.in \
39
- $(top_srcdir)/configure ChangeLog config/config.guess \
40
- config/config.sub config/depcomp config/install-sh \
41
- config/ltmain.sh config/missing
37
+ DIST_COMMON = $(am__configure_deps) $(dist_man_MANS) \
38
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
39
+ $(srcdir)/config.h.in $(top_srcdir)/configure ChangeLog \
40
+ config/config.guess config/config.sub config/depcomp \
41
+ config/install-sh config/ltmain.sh config/missing
42
42
  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43
43
  am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
44
44
  $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -61,6 +61,37 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
61
61
  install-pdf-recursive install-ps-recursive install-recursive \
62
62
  installcheck-recursive installdirs-recursive pdf-recursive \
63
63
  ps-recursive uninstall-recursive
64
+ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
65
+ am__vpath_adj = case $$p in \
66
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
67
+ *) f=$$p;; \
68
+ esac;
69
+ am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
70
+ am__install_max = 40
71
+ am__nobase_strip_setup = \
72
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
73
+ am__nobase_strip = \
74
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
75
+ am__nobase_list = $(am__nobase_strip_setup); \
76
+ for p in $$list; do echo "$$p $$p"; done | \
77
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
78
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
79
+ if (++n[$$2] == $(am__install_max)) \
80
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
81
+ END { for (dir in files) print dir, files[dir] }'
82
+ am__base_list = \
83
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
84
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
85
+ am__uninstall_files_from_dir = { \
86
+ test -z "$$files" \
87
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
88
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
89
+ $(am__cd) "$$dir" && rm -f $$files; }; \
90
+ }
91
+ man8dir = $(mandir)/man8
92
+ am__installdirs = "$(DESTDIR)$(man8dir)"
93
+ NROFF = nroff
94
+ MANS = $(dist_man_MANS)
64
95
  RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
65
96
  distclean-recursive maintainer-clean-recursive
66
97
  AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -231,6 +262,7 @@ top_srcdir = @top_srcdir@
231
262
  MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config.h.in config.h.in~ stamp-h.in
232
263
  ACLOCAL_AMFLAGS = -I m4
233
264
  SUBDIRS = contrib src
265
+ dist_man_MANS = man/nutcracker.8
234
266
  EXTRA_DIST = README.md NOTICE LICENSE ChangeLog conf scripts notes
235
267
  all: config.h
236
268
  $(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -294,6 +326,42 @@ clean-libtool:
294
326
 
295
327
  distclean-libtool:
296
328
  -rm -f libtool config.lt
329
+ install-man8: $(dist_man_MANS)
330
+ @$(NORMAL_INSTALL)
331
+ test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)"
332
+ @list=''; test -n "$(man8dir)" || exit 0; \
333
+ { for i in $$list; do echo "$$i"; done; \
334
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
335
+ sed -n '/\.8[a-z]*$$/p'; \
336
+ } | while read p; do \
337
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
338
+ echo "$$d$$p"; echo "$$p"; \
339
+ done | \
340
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
341
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
342
+ sed 'N;N;s,\n, ,g' | { \
343
+ list=; while read file base inst; do \
344
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
345
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
346
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
347
+ fi; \
348
+ done; \
349
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
350
+ while read files; do \
351
+ test -z "$$files" || { \
352
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
353
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
354
+ done; }
355
+
356
+ uninstall-man8:
357
+ @$(NORMAL_UNINSTALL)
358
+ @list=''; test -n "$(man8dir)" || exit 0; \
359
+ files=`{ for i in $$list; do echo "$$i"; done; \
360
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
361
+ sed -n '/\.8[a-z]*$$/p'; \
362
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
363
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
364
+ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
297
365
 
298
366
  # This directory's subdirectories are mostly independent; you can cd
299
367
  # into them and run `make' without going through this Makefile.
@@ -431,6 +499,19 @@ distclean-tags:
431
499
  -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
432
500
 
433
501
  distdir: $(DISTFILES)
502
+ @list='$(MANS)'; if test -n "$$list"; then \
503
+ list=`for p in $$list; do \
504
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
505
+ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
506
+ if test -n "$$list" && \
507
+ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
508
+ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
509
+ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
510
+ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
511
+ echo " typically \`make maintainer-clean' will remove them" >&2; \
512
+ exit 1; \
513
+ else :; fi; \
514
+ else :; fi
434
515
  $(am__remove_distdir)
435
516
  test -d "$(distdir)" || mkdir "$(distdir)"
436
517
  @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -622,9 +703,12 @@ distcleancheck: distclean
622
703
  exit 1; } >&2
623
704
  check-am: all-am
624
705
  check: check-recursive
625
- all-am: Makefile config.h
706
+ all-am: Makefile $(MANS) config.h
626
707
  installdirs: installdirs-recursive
627
708
  installdirs-am:
709
+ for dir in "$(DESTDIR)$(man8dir)"; do \
710
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
711
+ done
628
712
  install: install-recursive
629
713
  install-exec: install-exec-recursive
630
714
  install-data: install-data-recursive
@@ -678,7 +762,7 @@ info: info-recursive
678
762
 
679
763
  info-am:
680
764
 
681
- install-data-am:
765
+ install-data-am: install-man
682
766
 
683
767
  install-dvi: install-dvi-recursive
684
768
 
@@ -694,7 +778,7 @@ install-info: install-info-recursive
694
778
 
695
779
  install-info-am:
696
780
 
697
- install-man:
781
+ install-man: install-man8
698
782
 
699
783
  install-pdf: install-pdf-recursive
700
784
 
@@ -724,7 +808,9 @@ ps: ps-recursive
724
808
 
725
809
  ps-am:
726
810
 
727
- uninstall-am:
811
+ uninstall-am: uninstall-man
812
+
813
+ uninstall-man: uninstall-man8
728
814
 
729
815
  .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
730
816
  ctags-recursive install-am install-strip tags-recursive
@@ -739,11 +825,12 @@ uninstall-am:
739
825
  install install-am install-data install-data-am install-dvi \
740
826
  install-dvi-am install-exec install-exec-am install-html \
741
827
  install-html-am install-info install-info-am install-man \
742
- install-pdf install-pdf-am install-ps install-ps-am \
743
- install-strip installcheck installcheck-am installdirs \
744
- installdirs-am maintainer-clean maintainer-clean-generic \
745
- mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
746
- ps ps-am tags tags-recursive uninstall uninstall-am
828
+ install-man8 install-pdf install-pdf-am install-ps \
829
+ install-ps-am install-strip installcheck installcheck-am \
830
+ installdirs installdirs-am maintainer-clean \
831
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
832
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
833
+ uninstall uninstall-am uninstall-man uninstall-man8
747
834
 
748
835
 
749
836
  # Tell versions [3.59,3.63) of GNU make to not export all variables.
@@ -40,6 +40,7 @@ To build nutcracker from source with _debug logs enabled_ and _assertions disabl
40
40
  + Supports multiple hashing modes including consistent hashing and distribution.
41
41
  + Can be configured to disable nodes on failures.
42
42
  + Observability through stats exposed on stats monitoring port.
43
+ + Works with Linux, *BSD, OS X and Solaris (SmartOS)
43
44
 
44
45
  ## Help
45
46
 
@@ -77,7 +78,8 @@ nutcracker can be configured through a YAML file specified by the -c or --conf-f
77
78
  + one_at_a_time
78
79
  + md5
79
80
  + crc16
80
- + crc32
81
+ + crc32 (crc32 implementation compatible with [libmemcached](http://libmemcached.org/))
82
+ + crc32a (correct crc32 implementation as per the spec)
81
83
  + fnv1_64
82
84
  + fnv1a_64
83
85
  + fnv1_32
@@ -218,12 +220,27 @@ Pipelining is the reason why nutcracker ends up doing better in terms of through
218
220
 
219
221
  If you are deploying nutcracker in production, you might consider reading through the [recommendation document](notes/recommendation.md) to understand the parameters you could tune in nutcracker to run it efficiently in the production environment.
220
222
 
223
+ ## Utils
224
+ + [nagios checks](https://github.com/wanelo/nagios-checks/blob/master/check_twemproxy)
225
+ + [circunous](https://github.com/wanelo-chef/nad-checks/blob/master/recipes/twemproxy.rb)
226
+ + [puppet module](https://github.com/wuakitv/puppet-twemproxy)
227
+ + [nutcracker-web](https://github.com/kontera-technologies/nutcracker-web)
228
+ + [munin-plugin](https://github.com/eveiga/contrib/tree/nutcracker/plugins/nutcracker)
229
+ + [redis-twemproxy agent](https://github.com/Stono/redis-twemproxy-agent)
230
+
221
231
  ## Users
222
232
  + [Pinterest](http://pinterest.com/)
223
233
  + [Tumblr](https://www.tumblr.com/)
224
234
  + [Twitter](https://twitter.com/)
225
235
  + [Vine](http://vine.co/)
226
236
  + [Kiip](http://www.kiip.me/)
237
+ + [Wuaki.tv](https://wuaki.tv/)
238
+ + [Wanelo](http://wanelo.com/)
239
+ + [Kontera](http://kontera.com/)
240
+ + [Wikimedia](http://www.wikimedia.org/)
241
+ + [Bright](http://www.bright.com/)
242
+ + [56.com](http://www.56.com/)
243
+ + [Snapchat](http://www.snapchat.com/)
227
244
 
228
245
  ## Issues and Support
229
246
 
@@ -9,6 +9,9 @@
9
9
  /* Define to 1 if panic on an assert is enabled */
10
10
  #undef HAVE_ASSERT_PANIC
11
11
 
12
+ /* Define to 1 if backtrace is supported */
13
+ #undef HAVE_BACKTRACE
14
+
12
15
  /* Define to 1 if debug log is enabled */
13
16
  #undef HAVE_DEBUG_LOG
14
17
 
@@ -18,6 +21,15 @@
18
21
  /* Define to 1 if you have the `dup2' function. */
19
22
  #undef HAVE_DUP2
20
23
 
24
+ /* Define to 1 if epoll is supported */
25
+ #undef HAVE_EPOLL
26
+
27
+ /* Define to 1 if event ports is supported */
28
+ #undef HAVE_EVENT_PORTS
29
+
30
+ /* Define to 1 if you have the <execinfo.h> header file. */
31
+ #undef HAVE_EXECINFO_H
32
+
21
33
  /* Define to 1 if you have the <fcntl.h> header file. */
22
34
  #undef HAVE_FCNTL_H
23
35
 
@@ -42,6 +54,9 @@
42
54
  /* Define to 1 if you have the <inttypes.h> header file. */
43
55
  #undef HAVE_INTTYPES_H
44
56
 
57
+ /* Define to 1 if kqueue is supported */
58
+ #undef HAVE_KQUEUE
59
+
45
60
  /* Define to 1 if you have the `m' library (-lm). */
46
61
  #undef HAVE_LIBM
47
62
 
@@ -122,6 +137,9 @@
122
137
  /* Define to 1 if you have the <sys/epoll.h> header file. */
123
138
  #undef HAVE_SYS_EPOLL_H
124
139
 
140
+ /* Define to 1 if you have the <sys/event.h> header file. */
141
+ #undef HAVE_SYS_EVENT_H
142
+
125
143
  /* Define to 1 if you have the <sys/ioctl.h> header file. */
126
144
  #undef HAVE_SYS_IOCTL_H
127
145