redis-server 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. data/LICENSE +38 -0
  2. data/README.md +33 -0
  3. data/bin/redis +114 -0
  4. data/redis/Makefile +5 -0
  5. data/redis/extconf.rb +3 -0
  6. data/redis/redis-2.2.11/00-RELEASENOTES +199 -0
  7. data/redis/redis-2.2.11/BUGS +1 -0
  8. data/redis/redis-2.2.11/CONTRIBUTING +13 -0
  9. data/redis/redis-2.2.11/COPYING +10 -0
  10. data/redis/redis-2.2.11/Changelog +1032 -0
  11. data/redis/redis-2.2.11/INSTALL +30 -0
  12. data/redis/redis-2.2.11/Makefile +22 -0
  13. data/redis/redis-2.2.11/README +83 -0
  14. data/redis/redis-2.2.11/TODO +4 -0
  15. data/redis/redis-2.2.11/client-libraries/README +11 -0
  16. data/redis/redis-2.2.11/deps/hiredis/COPYING +10 -0
  17. data/redis/redis-2.2.11/deps/hiredis/Makefile +115 -0
  18. data/redis/redis-2.2.11/deps/hiredis/README.md +311 -0
  19. data/redis/redis-2.2.11/deps/hiredis/TODO +2 -0
  20. data/redis/redis-2.2.11/deps/hiredis/adapters/ae.h +95 -0
  21. data/redis/redis-2.2.11/deps/hiredis/adapters/libev.h +113 -0
  22. data/redis/redis-2.2.11/deps/hiredis/adapters/libevent.h +76 -0
  23. data/redis/redis-2.2.11/deps/hiredis/async.c +321 -0
  24. data/redis/redis-2.2.11/deps/hiredis/async.h +112 -0
  25. data/redis/redis-2.2.11/deps/hiredis/example-ae.c +53 -0
  26. data/redis/redis-2.2.11/deps/hiredis/example-libev.c +47 -0
  27. data/redis/redis-2.2.11/deps/hiredis/example-libevent.c +48 -0
  28. data/redis/redis-2.2.11/deps/hiredis/example.c +67 -0
  29. data/redis/redis-2.2.11/deps/hiredis/fmacros.h +15 -0
  30. data/redis/redis-2.2.11/deps/hiredis/hiredis.c +1058 -0
  31. data/redis/redis-2.2.11/deps/hiredis/hiredis.h +170 -0
  32. data/redis/redis-2.2.11/deps/hiredis/net.c +170 -0
  33. data/redis/redis-2.2.11/deps/hiredis/net.h +43 -0
  34. data/redis/redis-2.2.11/deps/hiredis/sds.c +479 -0
  35. data/redis/redis-2.2.11/deps/hiredis/sds.h +77 -0
  36. data/redis/redis-2.2.11/deps/hiredis/test.c +479 -0
  37. data/redis/redis-2.2.11/deps/hiredis/util.h +40 -0
  38. data/redis/redis-2.2.11/deps/linenoise/Makefile +10 -0
  39. data/redis/redis-2.2.11/deps/linenoise/README.markdown +45 -0
  40. data/redis/redis-2.2.11/deps/linenoise/example.c +27 -0
  41. data/redis/redis-2.2.11/deps/linenoise/linenoise.c +609 -0
  42. data/redis/redis-2.2.11/deps/linenoise/linenoise.h +55 -0
  43. data/redis/redis-2.2.11/design-documents/REDIS-CLUSTER +214 -0
  44. data/redis/redis-2.2.11/design-documents/REDIS-CLUSTER-2 +343 -0
  45. data/redis/redis-2.2.11/doc/AppendCommand.html +48 -0
  46. data/redis/redis-2.2.11/doc/AppendOnlyFileHowto.html +41 -0
  47. data/redis/redis-2.2.11/doc/AuthCommand.html +39 -0
  48. data/redis/redis-2.2.11/doc/Benchmarks.html +129 -0
  49. data/redis/redis-2.2.11/doc/BgrewriteaofCommand.html +41 -0
  50. data/redis/redis-2.2.11/doc/BgsaveCommand.html +39 -0
  51. data/redis/redis-2.2.11/doc/BlpopCommand.html +51 -0
  52. data/redis/redis-2.2.11/doc/BrpoplpushCommand.html +39 -0
  53. data/redis/redis-2.2.11/doc/CommandReference.html +47 -0
  54. data/redis/redis-2.2.11/doc/Comparisons.html +42 -0
  55. data/redis/redis-2.2.11/doc/ConfigCommand.html +76 -0
  56. data/redis/redis-2.2.11/doc/Configuration.html +38 -0
  57. data/redis/redis-2.2.11/doc/ConnectionHandlingSidebar.html +36 -0
  58. data/redis/redis-2.2.11/doc/ControlCommandsSidebar.html +36 -0
  59. data/redis/redis-2.2.11/doc/Credits.html +38 -0
  60. data/redis/redis-2.2.11/doc/DbsizeCommand.html +38 -0
  61. data/redis/redis-2.2.11/doc/DelCommand.html +41 -0
  62. data/redis/redis-2.2.11/doc/DesignPatterns.html +37 -0
  63. data/redis/redis-2.2.11/doc/EventLibray.html +44 -0
  64. data/redis/redis-2.2.11/doc/ExistsCommand.html +42 -0
  65. data/redis/redis-2.2.11/doc/ExpireCommand.html +96 -0
  66. data/redis/redis-2.2.11/doc/FAQ.html +70 -0
  67. data/redis/redis-2.2.11/doc/Features.html +38 -0
  68. data/redis/redis-2.2.11/doc/FlushallCommand.html +39 -0
  69. data/redis/redis-2.2.11/doc/FlushdbCommand.html +39 -0
  70. data/redis/redis-2.2.11/doc/FromSqlToDataStructures.html +37 -0
  71. data/redis/redis-2.2.11/doc/GenericCommandsSidebar.html +36 -0
  72. data/redis/redis-2.2.11/doc/GetCommand.html +39 -0
  73. data/redis/redis-2.2.11/doc/GetbitCommand.html +39 -0
  74. data/redis/redis-2.2.11/doc/GetsetCommand.html +38 -0
  75. data/redis/redis-2.2.11/doc/HackingStrings.html +83 -0
  76. data/redis/redis-2.2.11/doc/HashCommandsSidebar.html +36 -0
  77. data/redis/redis-2.2.11/doc/Hashes.html +37 -0
  78. data/redis/redis-2.2.11/doc/HdelCommand.html +39 -0
  79. data/redis/redis-2.2.11/doc/HexistsCommand.html +39 -0
  80. data/redis/redis-2.2.11/doc/HgetCommand.html +39 -0
  81. data/redis/redis-2.2.11/doc/HgetallCommand.html +40 -0
  82. data/redis/redis-2.2.11/doc/HincrbyCommand.html +45 -0
  83. data/redis/redis-2.2.11/doc/HlenCommand.html +38 -0
  84. data/redis/redis-2.2.11/doc/HmgetCommand.html +40 -0
  85. data/redis/redis-2.2.11/doc/HmsetCommand.html +40 -0
  86. data/redis/redis-2.2.11/doc/HsetCommand.html +40 -0
  87. data/redis/redis-2.2.11/doc/HsetnxCommand.html +41 -0
  88. data/redis/redis-2.2.11/doc/IncrCommand.html +43 -0
  89. data/redis/redis-2.2.11/doc/InfoCommand.html +48 -0
  90. data/redis/redis-2.2.11/doc/IntroductionToRedisDataTypes.html +152 -0
  91. data/redis/redis-2.2.11/doc/KeysCommand.html +43 -0
  92. data/redis/redis-2.2.11/doc/LastsaveCommand.html +39 -0
  93. data/redis/redis-2.2.11/doc/LindexCommand.html +40 -0
  94. data/redis/redis-2.2.11/doc/ListCommandsSidebar.html +36 -0
  95. data/redis/redis-2.2.11/doc/Lists.html +42 -0
  96. data/redis/redis-2.2.11/doc/LlenCommand.html +41 -0
  97. data/redis/redis-2.2.11/doc/LpopCommand.html +41 -0
  98. data/redis/redis-2.2.11/doc/LrangeCommand.html +47 -0
  99. data/redis/redis-2.2.11/doc/LremCommand.html +41 -0
  100. data/redis/redis-2.2.11/doc/LsetCommand.html +38 -0
  101. data/redis/redis-2.2.11/doc/LtrimCommand.html +47 -0
  102. data/redis/redis-2.2.11/doc/MgetCommand.html +52 -0
  103. data/redis/redis-2.2.11/doc/MonitorCommand.html +63 -0
  104. data/redis/redis-2.2.11/doc/MoveCommand.html +42 -0
  105. data/redis/redis-2.2.11/doc/MsetCommand.html +44 -0
  106. data/redis/redis-2.2.11/doc/MultiExecCommand.html +166 -0
  107. data/redis/redis-2.2.11/doc/NonexistentCommands.html +51 -0
  108. data/redis/redis-2.2.11/doc/ObjectHashMappers.html +39 -0
  109. data/redis/redis-2.2.11/doc/Pipelining.html +36 -0
  110. data/redis/redis-2.2.11/doc/ProgrammingExamples.html +38 -0
  111. data/redis/redis-2.2.11/doc/ProtocolSpecification.html +137 -0
  112. data/redis/redis-2.2.11/doc/PublishSubscribe.html +115 -0
  113. data/redis/redis-2.2.11/doc/QuickStart.html +68 -0
  114. data/redis/redis-2.2.11/doc/QuitCommand.html +38 -0
  115. data/redis/redis-2.2.11/doc/README.html +119 -0
  116. data/redis/redis-2.2.11/doc/RandomkeyCommand.html +39 -0
  117. data/redis/redis-2.2.11/doc/Redis0100ChangeLog.html +67 -0
  118. data/redis/redis-2.2.11/doc/Redis0900ChangeLog.html +56 -0
  119. data/redis/redis-2.2.11/doc/RedisBigData.html +61 -0
  120. data/redis/redis-2.2.11/doc/RedisCLI.html +37 -0
  121. data/redis/redis-2.2.11/doc/RedisEventLibrary.html +70 -0
  122. data/redis/redis-2.2.11/doc/RedisGuides.html +37 -0
  123. data/redis/redis-2.2.11/doc/RedisInternals.html +38 -0
  124. data/redis/redis-2.2.11/doc/RedisPipelining.html +93 -0
  125. data/redis/redis-2.2.11/doc/RedisStatus.html +56 -0
  126. data/redis/redis-2.2.11/doc/Redis_1_2_0_Changelog.html +40 -0
  127. data/redis/redis-2.2.11/doc/Redis_2_0_0_Changelog.html +62 -0
  128. data/redis/redis-2.2.11/doc/Redis_2_0_Whats_new.html +59 -0
  129. data/redis/redis-2.2.11/doc/RenameCommand.html +39 -0
  130. data/redis/redis-2.2.11/doc/RenamenxCommand.html +42 -0
  131. data/redis/redis-2.2.11/doc/ReplicationHowto.html +43 -0
  132. data/redis/redis-2.2.11/doc/ReplyTypes.html +42 -0
  133. data/redis/redis-2.2.11/doc/RoadMap.html +38 -0
  134. data/redis/redis-2.2.11/doc/RpoplpushCommand.html +44 -0
  135. data/redis/redis-2.2.11/doc/RpushCommand.html +40 -0
  136. data/redis/redis-2.2.11/doc/SaddCommand.html +41 -0
  137. data/redis/redis-2.2.11/doc/SaveCommand.html +39 -0
  138. data/redis/redis-2.2.11/doc/ScardCommand.html +41 -0
  139. data/redis/redis-2.2.11/doc/SdiffCommand.html +45 -0
  140. data/redis/redis-2.2.11/doc/SdiffstoreCommand.html +38 -0
  141. data/redis/redis-2.2.11/doc/SelectCommand.html +39 -0
  142. data/redis/redis-2.2.11/doc/SetCommand.html +39 -0
  143. data/redis/redis-2.2.11/doc/SetCommandsSidebar.html +36 -0
  144. data/redis/redis-2.2.11/doc/SetbitCommand.html +45 -0
  145. data/redis/redis-2.2.11/doc/SetexCommand.html +42 -0
  146. data/redis/redis-2.2.11/doc/SetnxCommand.html +51 -0
  147. data/redis/redis-2.2.11/doc/SetrangeCommand.html +58 -0
  148. data/redis/redis-2.2.11/doc/Sets.html +36 -0
  149. data/redis/redis-2.2.11/doc/ShutdownCommand.html +39 -0
  150. data/redis/redis-2.2.11/doc/SideBar.html +36 -0
  151. data/redis/redis-2.2.11/doc/SinterCommand.html +40 -0
  152. data/redis/redis-2.2.11/doc/SinterstoreCommand.html +39 -0
  153. data/redis/redis-2.2.11/doc/SismemberCommand.html +42 -0
  154. data/redis/redis-2.2.11/doc/SlaveofCommand.html +41 -0
  155. data/redis/redis-2.2.11/doc/SmembersCommand.html +38 -0
  156. data/redis/redis-2.2.11/doc/SmoveCommand.html +44 -0
  157. data/redis/redis-2.2.11/doc/SortCommand.html +75 -0
  158. data/redis/redis-2.2.11/doc/SortedSetCommandsSidebar.html +36 -0
  159. data/redis/redis-2.2.11/doc/SortedSets.html +36 -0
  160. data/redis/redis-2.2.11/doc/Speed.html +38 -0
  161. data/redis/redis-2.2.11/doc/SponsorshipHistory.html +38 -0
  162. data/redis/redis-2.2.11/doc/SpopCommand.html +40 -0
  163. data/redis/redis-2.2.11/doc/SrandmemberCommand.html +40 -0
  164. data/redis/redis-2.2.11/doc/SremCommand.html +42 -0
  165. data/redis/redis-2.2.11/doc/StringCommandsSidebar.html +36 -0
  166. data/redis/redis-2.2.11/doc/Strings.html +37 -0
  167. data/redis/redis-2.2.11/doc/StrlenCommand.html +39 -0
  168. data/redis/redis-2.2.11/doc/SubstrCommand.html +52 -0
  169. data/redis/redis-2.2.11/doc/SunionCommand.html +40 -0
  170. data/redis/redis-2.2.11/doc/SunionstoreCommand.html +38 -0
  171. data/redis/redis-2.2.11/doc/SupportedLanguages.html +60 -0
  172. data/redis/redis-2.2.11/doc/SupportedPlatforms.html +37 -0
  173. data/redis/redis-2.2.11/doc/TemplateCommand.html +38 -0
  174. data/redis/redis-2.2.11/doc/TtlCommand.html +38 -0
  175. data/redis/redis-2.2.11/doc/TwitterAlikeExample.html +250 -0
  176. data/redis/redis-2.2.11/doc/TypeCommand.html +46 -0
  177. data/redis/redis-2.2.11/doc/UnstableSource.html +39 -0
  178. data/redis/redis-2.2.11/doc/VirtualMemorySpecification.html +156 -0
  179. data/redis/redis-2.2.11/doc/VirtualMemoryUserGuide.html +66 -0
  180. data/redis/redis-2.2.11/doc/ZaddCommand.html +43 -0
  181. data/redis/redis-2.2.11/doc/ZcardCommand.html +41 -0
  182. data/redis/redis-2.2.11/doc/ZincrbyCommand.html +42 -0
  183. data/redis/redis-2.2.11/doc/ZrangeCommand.html +42 -0
  184. data/redis/redis-2.2.11/doc/ZrangebyscoreCommand.html +77 -0
  185. data/redis/redis-2.2.11/doc/ZrankCommand.html +43 -0
  186. data/redis/redis-2.2.11/doc/ZremCommand.html +42 -0
  187. data/redis/redis-2.2.11/doc/ZremrangebyrankCommand.html +39 -0
  188. data/redis/redis-2.2.11/doc/ZremrangebyscoreCommand.html +39 -0
  189. data/redis/redis-2.2.11/doc/ZscoreCommand.html +41 -0
  190. data/redis/redis-2.2.11/doc/ZunionCommand.html +42 -0
  191. data/redis/redis-2.2.11/doc/ZunionstoreCommand.html +43 -0
  192. data/redis/redis-2.2.11/doc/index.html +43 -0
  193. data/redis/redis-2.2.11/doc/redis.png +0 -0
  194. data/redis/redis-2.2.11/doc/style.css +25 -0
  195. data/redis/redis-2.2.11/redis.conf +417 -0
  196. data/redis/redis-2.2.11/src/Makefile +177 -0
  197. data/redis/redis-2.2.11/src/adlist.c +325 -0
  198. data/redis/redis-2.2.11/src/adlist.h +92 -0
  199. data/redis/redis-2.2.11/src/ae.c +390 -0
  200. data/redis/redis-2.2.11/src/ae.h +117 -0
  201. data/redis/redis-2.2.11/src/ae_epoll.c +91 -0
  202. data/redis/redis-2.2.11/src/ae_kqueue.c +93 -0
  203. data/redis/redis-2.2.11/src/ae_select.c +72 -0
  204. data/redis/redis-2.2.11/src/anet.c +347 -0
  205. data/redis/redis-2.2.11/src/anet.h +57 -0
  206. data/redis/redis-2.2.11/src/aof.c +675 -0
  207. data/redis/redis-2.2.11/src/config.c +627 -0
  208. data/redis/redis-2.2.11/src/config.h +64 -0
  209. data/redis/redis-2.2.11/src/db.c +543 -0
  210. data/redis/redis-2.2.11/src/debug.c +314 -0
  211. data/redis/redis-2.2.11/src/dict.c +721 -0
  212. data/redis/redis-2.2.11/src/dict.h +156 -0
  213. data/redis/redis-2.2.11/src/fmacros.h +15 -0
  214. data/redis/redis-2.2.11/src/help.h +638 -0
  215. data/redis/redis-2.2.11/src/intset.c +422 -0
  216. data/redis/redis-2.2.11/src/intset.h +19 -0
  217. data/redis/redis-2.2.11/src/lzf.h +100 -0
  218. data/redis/redis-2.2.11/src/lzfP.h +159 -0
  219. data/redis/redis-2.2.11/src/lzf_c.c +295 -0
  220. data/redis/redis-2.2.11/src/lzf_d.c +150 -0
  221. data/redis/redis-2.2.11/src/mkreleasehdr.sh +9 -0
  222. data/redis/redis-2.2.11/src/multi.c +268 -0
  223. data/redis/redis-2.2.11/src/networking.c +899 -0
  224. data/redis/redis-2.2.11/src/object.c +484 -0
  225. data/redis/redis-2.2.11/src/pqsort.c +197 -0
  226. data/redis/redis-2.2.11/src/pqsort.h +15 -0
  227. data/redis/redis-2.2.11/src/pubsub.c +267 -0
  228. data/redis/redis-2.2.11/src/rdb.c +1020 -0
  229. data/redis/redis-2.2.11/src/redis-benchmark.c +530 -0
  230. data/redis/redis-2.2.11/src/redis-check-aof.c +185 -0
  231. data/redis/redis-2.2.11/src/redis-check-dump.c +681 -0
  232. data/redis/redis-2.2.11/src/redis-cli.c +773 -0
  233. data/redis/redis-2.2.11/src/redis.c +1677 -0
  234. data/redis/redis-2.2.11/src/redis.h +1022 -0
  235. data/redis/redis-2.2.11/src/release.c +13 -0
  236. data/redis/redis-2.2.11/src/replication.c +557 -0
  237. data/redis/redis-2.2.11/src/sds.c +639 -0
  238. data/redis/redis-2.2.11/src/sds.h +78 -0
  239. data/redis/redis-2.2.11/src/sha1.c +276 -0
  240. data/redis/redis-2.2.11/src/sha1.h +17 -0
  241. data/redis/redis-2.2.11/src/solarisfixes.h +22 -0
  242. data/redis/redis-2.2.11/src/sort.c +389 -0
  243. data/redis/redis-2.2.11/src/syncio.c +154 -0
  244. data/redis/redis-2.2.11/src/t_hash.c +476 -0
  245. data/redis/redis-2.2.11/src/t_list.c +986 -0
  246. data/redis/redis-2.2.11/src/t_set.c +610 -0
  247. data/redis/redis-2.2.11/src/t_string.c +438 -0
  248. data/redis/redis-2.2.11/src/t_zset.c +1084 -0
  249. data/redis/redis-2.2.11/src/testhelp.h +54 -0
  250. data/redis/redis-2.2.11/src/util.c +243 -0
  251. data/redis/redis-2.2.11/src/valgrind.sup +5 -0
  252. data/redis/redis-2.2.11/src/version.h +1 -0
  253. data/redis/redis-2.2.11/src/vm.c +1149 -0
  254. data/redis/redis-2.2.11/src/ziplist.c +1323 -0
  255. data/redis/redis-2.2.11/src/ziplist.h +15 -0
  256. data/redis/redis-2.2.11/src/zipmap.c +455 -0
  257. data/redis/redis-2.2.11/src/zipmap.h +48 -0
  258. data/redis/redis-2.2.11/src/zmalloc.c +278 -0
  259. data/redis/redis-2.2.11/src/zmalloc.h +47 -0
  260. data/redis/redis-2.2.11/tests/assets/default.conf +308 -0
  261. data/redis/redis-2.2.11/tests/integration/aof.tcl +104 -0
  262. data/redis/redis-2.2.11/tests/integration/redis-cli.tcl +208 -0
  263. data/redis/redis-2.2.11/tests/integration/replication.tcl +98 -0
  264. data/redis/redis-2.2.11/tests/support/redis.tcl +241 -0
  265. data/redis/redis-2.2.11/tests/support/server.tcl +294 -0
  266. data/redis/redis-2.2.11/tests/support/test.tcl +190 -0
  267. data/redis/redis-2.2.11/tests/support/tmpfile.tcl +15 -0
  268. data/redis/redis-2.2.11/tests/support/util.tcl +296 -0
  269. data/redis/redis-2.2.11/tests/test_helper.tcl +221 -0
  270. data/redis/redis-2.2.11/tests/unit/auth.tcl +15 -0
  271. data/redis/redis-2.2.11/tests/unit/basic.tcl +616 -0
  272. data/redis/redis-2.2.11/tests/unit/cas.tcl +135 -0
  273. data/redis/redis-2.2.11/tests/unit/expire.tcl +74 -0
  274. data/redis/redis-2.2.11/tests/unit/other.tcl +240 -0
  275. data/redis/redis-2.2.11/tests/unit/printver.tcl +6 -0
  276. data/redis/redis-2.2.11/tests/unit/protocol.tcl +62 -0
  277. data/redis/redis-2.2.11/tests/unit/pubsub.tcl +195 -0
  278. data/redis/redis-2.2.11/tests/unit/quit.tcl +40 -0
  279. data/redis/redis-2.2.11/tests/unit/sort.tcl +189 -0
  280. data/redis/redis-2.2.11/tests/unit/type/hash.tcl +300 -0
  281. data/redis/redis-2.2.11/tests/unit/type/list.tcl +819 -0
  282. data/redis/redis-2.2.11/tests/unit/type/set.tcl +334 -0
  283. data/redis/redis-2.2.11/tests/unit/type/zset.tcl +587 -0
  284. data/redis/redis-2.2.11/utils/build-static-symbols.tcl +22 -0
  285. data/redis/redis-2.2.11/utils/generate-command-help.rb +112 -0
  286. data/redis/redis-2.2.11/utils/mktarball.sh +13 -0
  287. data/redis/redis-2.2.11/utils/redis-copy.rb +78 -0
  288. data/redis/redis-2.2.11/utils/redis-sha1.rb +52 -0
  289. data/redis/redis-2.2.11/utils/redis_init_script +42 -0
  290. metadata +362 -0
@@ -0,0 +1,96 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>ExpireCommand: Contents</b><br>&nbsp;&nbsp;<a href="#EXPIRE _key_ _seconds_">EXPIRE _key_ _seconds_</a><br>&nbsp;&nbsp;<a href="#EXPIREAT _key_ _unixtime_ (Redis &gt;">EXPIREAT _key_ _unixtime_ (Redis &gt;</a><br>&nbsp;&nbsp;<a href="#PERSIST _key_ (Redis &gt;">PERSIST _key_ (Redis &gt;</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#How the expire is removed from a key">How the expire is removed from a key</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Restrictions with write operations against volatile keys">Restrictions with write operations against volatile keys</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Restrictions for write operations with volatile keys as sources">Restrictions for write operations with volatile keys as sources</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Setting the timeout again on already volatile keys">Setting the timeout again on already volatile keys</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Enhanced Lazy Expiration algorithm">Enhanced Lazy Expiration algorithm</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Version 1.0">Version 1.0</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Version 1.1">Version 1.1</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#FAQ: Can you explain better why Redis &lt; 2.1.3 deletes keys with an EXPIRE on write operations?">FAQ: Can you explain better why Redis &lt; 2.1.3 deletes keys with an EXPIRE on write operations?</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#FAQ: How this limitations were solved in Redis versions &gt; 2.1.3?">FAQ: How this limitations were solved in Redis versions &gt; 2.1.3?</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">ExpireCommand</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;#sidebar <a href="GenericCommandsSidebar.html">GenericCommandsSidebar</a><h1><a name="EXPIRE _key_ _seconds_">EXPIRE _key_ _seconds_</a></h1>
30
+ <h1><a name="EXPIREAT _key_ _unixtime_ (Redis &gt;">EXPIREAT _key_ _unixtime_ (Redis &gt;</a></h1> 1.1)=
31
+ <h1><a name="PERSIST _key_ (Redis &gt;">PERSIST _key_ (Redis &gt;</a></h1> 2.1.3) =
32
+ <i>Time complexity: O(1)</i><blockquote>Set a timeout on the specified key. After the timeout the key will beautomatically deleted by the server. A key with an associated timeout issaid to be <i>volatile</i> in Redis terminology.</blockquote>
33
+ <blockquote>Voltile keys are stored on disk like the other keys, the timeout is persistenttoo like all the other aspects of the dataset. Saving a dataset containingexpires and stopping the server does not stop the flow of time as Redisstores on disk the time when the key will no longer be available as Unixtime, and not the remaining seconds.</blockquote>
34
+ <blockquote>EXPIREAT works exctly like EXPIRE but instead to get the number of secondsrepresenting the Time To Live of the key as a second argument (that is arelative way of specifing the TTL), it takes an absolute one in the form ofa UNIX timestamp (Number of seconds elapsed since 1 Gen 1970).</blockquote>
35
+ <blockquote>EXPIREAT was introduced in order to implement <a href="AppendOnlyFileHowto.html">the Append Only File persistence mode</a>so that EXPIRE commands are automatically translated into EXPIREAT commands for the append only file. Of course EXPIREAT can alsoused by programmers that need a way to simply specify that a given key should expire at a given time in the future.</blockquote>
36
+ <blockquote>Since Redis 2.1.3 you can update the value of the timeout of a key alreadyhaving an expire set. It is also possible to undo the expire at allturning the key into a normal key using the PERSIST command.</blockquote>
37
+ <h2><a name="How the expire is removed from a key">How the expire is removed from a key</a></h2><blockquote>When the key is set to a new value using the SET command, or when a keyis destroied via DEL, the timeout is removed from the key.</blockquote>
38
+ <h2><a name="Restrictions with write operations against volatile keys">Restrictions with write operations against volatile keys</a></h2><blockquote>IMPORTANT: Since Redis 2.1.3 or greater, there are no restrictions aboutthe operations you can perform against volatile keys, however older versionsof Redis, including the current stable version 2.0.0, has the followinglimitations:</blockquote>
39
+ <blockquote>Write operations like LPUSH, LSET and every other command that has theeffect of modifying the value stored at a volatile key have a special semantic:basically a volatile key is destroyed when it is target of a write operation.See for example the following usage pattern:</blockquote>
40
+ <pre class="codeblock python" name="code">
41
+ % ./redis-cli lpush mylist foobar /Users/antirez/hack/redis
42
+ OK
43
+ % ./redis-cli lpush mylist hello /Users/antirez/hack/redis
44
+ OK
45
+ % ./redis-cli expire mylist 10000 /Users/antirez/hack/redis
46
+ 1
47
+ % ./redis-cli lpush mylist newelement
48
+ OK
49
+ % ./redis-cli lrange mylist 0 -1 /Users/antirez/hack/redis
50
+ 1. newelement
51
+ </pre><blockquote>What happened here is that LPUSH against the key with a timeout set deletedthe key before to perform the operation. There is so a simple rule, writeoperations against volatile keys will destroy the key before to perform theoperation. Why Redis uses this behavior? In order to retain an importantproperty: a server that receives a given number of commands in the samesequence will end with the same dataset in memory. Without the delete-on-writesemantic what happens is that the state of the server depends on the timethe commands were issued. This is not a desirable property in a distributed databasethat supports replication.</blockquote>
52
+ <h2><a name="Restrictions for write operations with volatile keys as sources">Restrictions for write operations with volatile keys as sources</a></h2>Even when the volatile key is not modified as part of a write operation, if it is
53
+ read in a composite write operation (such as SINTERSTORE) it will be cleared at the
54
+ start of the operation. This is done to avoid concurrency issues in replication.
55
+ Imagine a key that is about to expire and the composite operation is run against it.
56
+ On a slave node, this key might already be expired, which leaves you with a
57
+ desync in your dataset.<h2><a name="Setting the timeout again on already volatile keys">Setting the timeout again on already volatile keys</a></h2><blockquote>Trying to call EXPIRE against a key that already has an associated timeoutwill not change the timeout of the key, but will just return 0. If insteadthe key does not have a timeout associated the timeout will be set and EXPIREwill return 1.</blockquote>
58
+ <h2><a name="Enhanced Lazy Expiration algorithm">Enhanced Lazy Expiration algorithm</a></h2><blockquote>Redis does not constantly monitor keys that are going to be expired.Keys are expired simply when some client tries to access a key, andthe key is found to be timed out.</blockquote>
59
+ <blockquote>Of course this is not enough as there are expired keys that will neverbe accessed again. This keys should be expired anyway, so once everysecond Redis test a few keys at random among keys with an expire set.All the keys that are already expired are deleted from the keyspace. </blockquote>
60
+ <h3><a name="Version 1.0">Version 1.0</a></h3><blockquote>Each time a fixed number of keys where tested (100 by default). So ifyou had a client setting keys with a very short expire faster than 100for second the memory continued to grow. When you stopped to insertnew keys the memory started to be freed, 100 keys every second in thebest conditions. Under a peak Redis continues to use more and more RAMeven if most keys are expired in each sweep.</blockquote>
61
+ <h3><a name="Version 1.1">Version 1.1</a></h3><blockquote>Each time Redis:</blockquote>
62
+ <ol><li> Tests 100 random keys from expired keys set.</li><li> Deletes all the keys found expired.</li><li> If more than 25 keys were expired, it start again from 1.</li></ol>
63
+ <blockquote>This is a trivial probabilistic algorithm, basically the assumption isthat our sample is representative of the whole key space,and we continue to expire until the percentage of keys that are likelyto be expired is under 25%</blockquote>
64
+ <blockquote>This means that at any given moment the maximum amount of keys alreadyexpired that are using memory is at max equal to max setting operations per second divided by 4.</blockquote>
65
+ <h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python python" name="code">
66
+ 1: the timeout was set.
67
+ 0: the timeout was not set since the key already has an associated timeout
68
+ (this may happen only in Redis versions &lt; 2.1.3, Redis &gt;= 2.1.3 will
69
+ happily update the timeout), or the key does not exist.
70
+ </pre><h2><a name="FAQ: Can you explain better why Redis &lt; 2.1.3 deletes keys with an EXPIRE on write operations?">FAQ: Can you explain better why Redis &lt; 2.1.3 deletes keys with an EXPIRE on write operations?</a></h2>
71
+ Ok let's start with the problem:
72
+ <pre class="codeblock python python python" name="code">
73
+ redis&gt; set a 100
74
+ OK
75
+ redis&gt; expire a 360
76
+ (integer) 1
77
+ redis&gt; incr a
78
+ (integer) 1
79
+ </pre>
80
+ I set a key to the value of 100, then set an expire of 360 seconds, and then incremented the key (before the 360 timeout expired of course). The obvious result would be: 101, instead the key is set to the value of 1. Why?
81
+ There is a very important reason involving the Append Only File and Replication. Let's rework a bit our example adding the notion of time to the mix:
82
+ <pre class="codeblock python python python python" name="code">
83
+ SET a 100
84
+ EXPIRE a 5
85
+ ... wait 10 seconds ...
86
+ INCR a
87
+ </pre>
88
+ Imagine a Redis version that does not implement the &quot;Delete keys with an expire set on write operation&quot; semantic.
89
+ Running the above example with the 10 seconds pause will lead to 'a' being set to the value of 1, as it no longer exists when INCR is called 10 seconds later.<br/><br/>Instead if we drop the 10 seconds pause, the result is that 'a' is set to 101.<br/><br/>And in the practice timing changes! For instance the client may wait 10 seconds before INCR, but the sequence written in the Append Only File (and later replayed-back as fast as possible when Redis is restarted) will not have the pause. Even if we add a timestamp in the AOF, when the time difference is smaller than our timer resolution, we have a race condition.<br/><br/>The same happens with master-slave replication. Again, consider the example above: the client will use the same sequence of commands without the 10 seconds pause, but the replication link will slow down for a few seconds due to a network problem. Result? The master will contain 'a' set to 101, the slave 'a' set to 1.<br/><br/>The only way to avoid this but at the same time have reliable non time dependent timeouts on keys is to destroy volatile keys when a write operation is attempted against it.<br/><br/>After all Redis is one of the rare fully persistent databases that will give you EXPIRE. This comes to a cost :)<h2><a name="FAQ: How this limitations were solved in Redis versions &gt; 2.1.3?">FAQ: How this limitations were solved in Redis versions &gt; 2.1.3?</a></h2>Since Redis 2.1.3 there are no longer restrictions in the use you can do of write commands against volatile keys, still the replication and AOF file are guaranteed to be fully consistent.<br/><br/>In order to obtain a correct behavior without sacrificing consistency now when a key expires, a DEL operation is synthesized in both the AOF file and against all the attached slaves. This way the expiration process is centralized in the master instance, and there is no longer a chance of consistency errors.<br/><br/>However while the slaves while connected to a master will not expire keys independently, they'll still take the full state of the expires existing in the dataset, so when a slave is elected to a master it will be able to expire the keys independently, fully acting as a master.
90
+ </div>
91
+
92
+ </div>
93
+ </div>
94
+ </body>
95
+ </html>
96
+
@@ -0,0 +1,70 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>FAQ: Contents</b><br>&nbsp;&nbsp;<a href="#Isn't this key-value thing just hype?">Isn't this key-value thing just hype?</a><br>&nbsp;&nbsp;<a href="#Can I backup a Redis DB while the server is working?">Can I backup a Redis DB while the server is working?</a><br>&nbsp;&nbsp;<a href="#What's the Redis memory footprint?">What's the Redis memory footprint?</a><br>&nbsp;&nbsp;<a href="#I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?">I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?</a><br>&nbsp;&nbsp;<a href="#Why Redis takes the whole dataset in RAM?">Why Redis takes the whole dataset in RAM?</a><br>&nbsp;&nbsp;<a href="#If my dataset is too big for RAM and I don't want to use consistent hashing or other ways to distribute the dataset across different nodes, what I can do to use Redis anyway?">If my dataset is too big for RAM and I don't want to use consistent hashing or other ways to distribute the dataset across different nodes, what I can do to use Redis anyway?</a><br>&nbsp;&nbsp;<a href="#Do you plan to implement Virtual Memory in Redis? Why don't just let the Operating System handle it for you?">Do you plan to implement Virtual Memory in Redis? Why don't just let the Operating System handle it for you?</a><br>&nbsp;&nbsp;<a href="#Is there something I can do to lower the Redis memory usage?">Is there something I can do to lower the Redis memory usage?</a><br>&nbsp;&nbsp;<a href="#I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!">I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!</a><br>&nbsp;&nbsp;<a href="#What happens if Redis runs out of memory?">What happens if Redis runs out of memory?</a><br>&nbsp;&nbsp;<a href="#Does Redis use more memory running in 64 bit boxes? Can I use 32 bit Redis in 64 bit systems?">Does Redis use more memory running in 64 bit boxes? Can I use 32 bit Redis in 64 bit systems?</a><br>&nbsp;&nbsp;<a href="#How much time it takes to load a big database at server startup?">How much time it takes to load a big database at server startup?</a><br>&nbsp;&nbsp;<a href="#Background saving is failing with a fork() error under Linux even if I've a lot of free RAM!">Background saving is failing with a fork() error under Linux even if I've a lot of free RAM!</a><br>&nbsp;&nbsp;<a href="#Are Redis on disk snapshots atomic?">Are Redis on disk snapshots atomic?</a><br>&nbsp;&nbsp;<a href="#Redis is single threaded, how can I exploit multiple CPU / cores?">Redis is single threaded, how can I exploit multiple CPU / cores?</a><br>&nbsp;&nbsp;<a href="#I'm using some form of key hashing for partitioning, but what about SORT BY?">I'm using some form of key hashing for partitioning, but what about SORT BY?</a><br>&nbsp;&nbsp;<a href="#What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a List, Set, Ordered Set?">What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a List, Set, Ordered Set?</a><br>&nbsp;&nbsp;<a href="#What Redis means actually?">What Redis means actually?</a><br>&nbsp;&nbsp;<a href="#Why did you started the Redis project?">Why did you started the Redis project?</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">FAQ</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;= Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...? =<br/><br/>Memcachedb is basically memcached done persistent. Redis is a different evolution
30
+ path in the key-value DBs, the idea is that the main advantages of key-value DBs
31
+ are retained even without a so severe loss of comfort of plain key-value DBs.
32
+ So Redis offers more features:<br/><br/><ul><li> Keys can store different data types, not just strings. Notably Lists and Sets. For example if you want to use Redis as a log storage system for different computers every computer can just <code name="code" class="python">RPUSH data to the computer_ID key</code>. Don't want to save more than 1000 log lines per computer? Just issue a <code name="code" class="python">LTRIM computer_ID 0 999</code> command to trim the list after every push.</li></ul>
33
+ <ul><li> Another example is about Sets. Imagine to build a social news site like <a href="http://reddit.com" target="_blank">Reddit</a>. Every time a user upvote a given news you can just add to the news_ID_upmods key holding a value of type SET the id of the user that did the upmodding. Sets can also be used to index things. Every key can be a tag holding a SET with the IDs of all the objects associated to this tag. Using Redis set intersection you obtain the list of IDs having all this tags at the same time.</li></ul>
34
+ <ul><li> We wrote a <a href="http://retwis.antirez.com" target="_blank">simple Twitter Clone</a> using just Redis as database. Download the source code from the download section and imagine to write it with a plain key-value DB without support for lists and sets... it's <b>much</b> harder.</li></ul>
35
+ <ul><li> Multiple DBs. Using the SELECT command the client can select different datasets. This is useful because Redis provides a MOVE atomic primitive that moves a key form a DB to another one, if the target DB already contains such a key it returns an error: this basically means a way to perform locking in distributed processing.</li></ul>
36
+ <ul><li> <b>So what is Redis really about?</b> The User interface with the programmer. Redis aims to export to the programmer the right tools to model a wide range of problems. <b>Sets, Lists with O(1) push operation, lrange and ltrim, server-side fast intersection between sets, are primitives that allow to model complex problems with a key value database</b>.</li></ul>
37
+ <h1><a name="Isn't this key-value thing just hype?">Isn't this key-value thing just hype?</a></h1>I imagine key-value DBs, in the short term future, to be used like you use memory in a program, with lists, hashes, and so on. With Redis it's like this, but this special kind of memory containing your data structures is shared, atomic, persistent.<br/><br/>When we write code it is obvious, when we take data in memory, to use the most sensible data structure for the work, right? Incredibly when data is put inside a relational DB this is no longer true, and we create an absurd data model even if our need is to put data and get this data back in the same order we put it inside (an ORDER BY is required when the data should be already sorted. Strange, dont' you think?).<br/><br/>Key-value DBs bring this back at home, to create sensible data models and use the right data structures for the problem we are trying to solve.<h1><a name="Can I backup a Redis DB while the server is working?">Can I backup a Redis DB while the server is working?</a></h1>Yes you can. When Redis saves the DB it actually creates a temp file, then rename(2) that temp file name to the destination file name. So even while the server is working it is safe to save the database file just with the <i>cp</i> unix command. Note that you can use master-slave replication in order to have redundancy of data, but if all you need is backups, cp or scp will do the work pretty well.<h1><a name="What's the Redis memory footprint?">What's the Redis memory footprint?</a></h1>Worst case scenario: 1 Million keys with the key being the natural numbers from 0 to 999999 and the string &quot;Hello World&quot; as value use 100MB on my Intel macbook (32bit). Note that the same data stored linearly in an unique string takes something like 16MB, this is the norm because with small keys and values there is a lot of overhead. Memcached will perform similarly.<br/><br/>With large keys/values the ratio is much better of course.<br/><br/>64 bit systems will use much more memory than 32 bit systems to store the same keys, especially if the keys and values are small, this is because pointers takes 8 bytes in 64 bit systems. But of course the advantage is that you can have a lot of memory in 64 bit systems, so to run large Redis servers a 64 bit system is more or less required.<h1><a name="I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?">I like Redis high level operations and features, but I don't like it takes everything in memory and I can't have a dataset larger the memory. Plans to change this?</a></h1>Short answer: If you are using a Redis client that supports consistent hashing you can distribute the dataset across different nodes. For instance the Ruby clients supports this feature. There are plans to develop redis-cluster that basically is a dummy Redis server that is only used in order to distribute the requests among N different nodes using consistent hashing.<h1><a name="Why Redis takes the whole dataset in RAM?">Why Redis takes the whole dataset in RAM?</a></h1>Redis takes the whole dataset in memory and writes asynchronously on disk in order to be very fast, you have the best of both worlds: hyper-speed and persistence of data, but the price to pay is exactly this, that the dataset must fit on your computers RAM.<br/><br/>If the data is larger then memory, and this data is stored on disk, what happens is that the bottleneck of the disk I/O speed will start to ruin the performances. Maybe not in benchmarks, but once you have real load from multiple clients with distributed key accesses the data must come from disk, and the disk is damn slow. Not only, but Redis supports higher level data structures than the plain values. To implement this things on disk is even slower.<br/><br/>Redis will always continue to hold the whole dataset in memory because this days scalability requires to use RAM as storage media, and RAM is getting cheaper and cheaper. Today it is common for an entry level server to have 16 GB of RAM! And in the 64-bit era there are no longer limits to the amount of RAM you can have in theory.<br/><br/>Amazon EC2 now provides instances with 32 or 64 GB of RAM.<h1><a name="If my dataset is too big for RAM and I don't want to use consistent hashing or other ways to distribute the dataset across different nodes, what I can do to use Redis anyway?">If my dataset is too big for RAM and I don't want to use consistent hashing or other ways to distribute the dataset across different nodes, what I can do to use Redis anyway?</a></h1>You may try to load a dataset larger than your memory in Redis and see what happens, basically if you are using a modern Operating System, and you have a lot of data in the DB that is rarely accessed, the OS's virtual memory implementation will try to swap rarely used pages of memory on the disk, to only recall this pages when they are needed. If you have many large values rarely used this will work. If your DB is big because you have tons of little values accessed at random without a specific pattern this will not work (at low level a page is usually 4096 bytes, and you can have different keys/values stored at a single page. The OS can't swap this page on disk if there are even few keys used frequently).<br/><br/>Another possible solution is to use both MySQL and Redis at the same time, basically take the state on Redis, and all the things that get accessed very frequently: user auth tokens, Redis Lists with chronologically ordered IDs of the last N-comments, N-posts, and so on. Then use MySQL as a simple storage engine for larger data, that is just create a table with an auto-incrementing ID as primary key and a large BLOB field as data field. Access MySQL data only by primary key (the ID). The application will run the high traffic queries against Redis but when there is to take the big data will ask MySQL for specific resources IDs.<br/><br/>Update: it could be interesting to test how Redis performs with datasets larger than memory if the OS swap partition is in one of this very fast Intel SSD disks.<h1><a name="Do you plan to implement Virtual Memory in Redis? Why don't just let the Operating System handle it for you?">Do you plan to implement Virtual Memory in Redis? Why don't just let the Operating System handle it for you?</a></h1>Yes, in order to support datasets bigger than RAM there is the plan to
38
+ implement transparent Virtual Memory in Redis, that is, the ability to
39
+ transfer large values associated to keys rarely used on Disk, and
40
+ reload them transparently in memory when this values are requested in
41
+ some way.<br/><br/>So you may ask why don't let the operating system VM do the work for
42
+ us. There are two main reasons: in Redis even a large value stored at
43
+ a given key, for instance a 1 million elements list, is not allocated
44
+ in a contiguous piece of memory. It's actually <b>very</b> fragmented since
45
+ Redis uses quite aggressive object sharing and allocated Redis Objects
46
+ structures reuse.<br/><br/>So you can imagine the memory layout composed of 4096 bytes pages that
47
+ actually contain different parts of different large values. Not only,
48
+ but a lot of values that are large enough for us to swap out to disk,
49
+ like a 1024k value, is just one quarter the size of a memory page, and
50
+ likely in the same page there are other values that are not rarely
51
+ used. So this value wil never be swapped out by the operating system.
52
+ This is the first reason for implementing application-level virtual
53
+ memory in Redis.<br/><br/>There is another one, as important as the first. A complex object in
54
+ memory like a list or a set is something <b>10 times bigger</b> than the
55
+ same object serialized on disk. Probably you already noticed how Redis
56
+ snapshots on disk are damn smaller compared to the memory usage of
57
+ Redis for the same objects. This happens because when data is in
58
+ memory is full of pointers, reference counters and other metadata. Add
59
+ to this malloc fragmentation and need to return word-aligned chunks of
60
+ memory and you have a clear picture of what happens. So this means to
61
+ have 10 times the I/O between memory and disk than otherwise needed.<h1><a name="Is there something I can do to lower the Redis memory usage?">Is there something I can do to lower the Redis memory usage?</a></h1>Yes, try to compile it with 32 bit target if you are using a 64 bit box.<br/><br/>If you are using Redis &gt;= 1.3, try using the Hash data type, it can save a lot of memory.<br/><br/>If you are using hashes or any other type with values bigger than 128 bytes try also this to lower the RSS usage (Resident Set Size): EXPORT MMAP_THRESHOLD=4096<h1><a name="I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!">I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!</a></h1>This may happen and it's prefectly ok. Redis objects are small C structures allocated and freed a lot of times. This costs a lot of CPU so instead of being freed, released objects are taken into a free list and reused when needed. This memory is taken exactly by this free objects ready to be reused.<h1><a name="What happens if Redis runs out of memory?">What happens if Redis runs out of memory?</a></h1>With modern operating systems malloc() returning NULL is not common, usually the server will start swapping and Redis performances will be disastrous so you'll know it's time to use more Redis servers or get more RAM.<br/><br/>The INFO command (work in progress in this days) will report the amount of memory Redis is using so you can write scripts that monitor your Redis servers checking for critical conditions.<br/><br/>You can also use the &quot;maxmemory&quot; option in the config file to put a limit to the memory Redis can use. If this limit is reached Redis will start to reply with an error to write commands (but will continue to accept read-only commands).<h1><a name="Does Redis use more memory running in 64 bit boxes? Can I use 32 bit Redis in 64 bit systems?">Does Redis use more memory running in 64 bit boxes? Can I use 32 bit Redis in 64 bit systems?</a></h1>Redis uses a lot more memory when compiled for 64 bit target, especially if the dataset is composed of many small keys and values. Such a database will, for instance, consume 50 MB of RAM when compiled for the 32 bit target, and 80 MB for 64 bit! That's a big difference.<br/><br/>You can run 32 bit Redis binaries in a 64 bit Linux and Mac OS X system without problems. For OS X just use <b>make 32bit</b>. For Linux instead, make sure you have <b>libc6-dev-i386</b> installed, then use <b>make 32bit</b> if you are using the latest Git version. Instead for Redis &lt;= 1.2.2 you have to edit the Makefile and replace &quot;-arch i386&quot; with &quot;-m32&quot;.<br/><br/>If your application is already able to perform application-level sharding, it is very advisable to run N instances of Redis 32bit against a big 64 bit Redis box (with more than 4GB of RAM) instead than a single 64 bit instance, as this is much more memory efficient. <h1><a name="How much time it takes to load a big database at server startup?">How much time it takes to load a big database at server startup?</a></h1>Just an example on normal hardware: It takes about 45 seconds to restore a 2 GB database on a fairly standard system, no RAID. This can give you some kind of feeling about the order of magnitude of the time needed to load data when you restart the server.<h1><a name="Background saving is failing with a fork() error under Linux even if I've a lot of free RAM!">Background saving is failing with a fork() error under Linux even if I've a lot of free RAM!</a></h1>Short answer: <code name="code" class="python">echo 1 &gt; /proc/sys/vm/overcommit_memory</code> :)<br/><br/>And now the long one:<br/><br/>Redis background saving schema relies on the copy-on-write semantic of fork in modern operating systems: Redis forks (creates a child process) that is an exact copy of the parent. The child process dumps the DB on disk and finally exits. In theory the child should use as much memory as the parent being a copy, but actually thanks to the copy-on-write semantic implemented by most modern operating systems the parent and child process will <i>share</i> the common memory pages. A page will be duplicated only when it changes in the child or in the parent. Since in theory all the pages may change while the child process is saving, Linux can't tell in advance how much memory the child will take, so if the <code name="code" class="python">overcommit_memory</code> setting is set to zero fork will fail unless there is as much free RAM as required to really duplicate all the parent memory pages, with the result that if you have a Redis dataset of 3 GB and just 2 GB of free memory it will fail.<br/><br/>Setting <code name="code" class="python">overcommit_memory</code> to 1 says Linux to relax and perform the fork in a more optimistic allocation fashion, and this is indeed what you want for Redis.<br/><br/>A good source to understand how Linux Virtual Memory work and other alternatives for <code name="code" class="python">overcommit_memory</code> and <code name="code" class="python">overcommit_ratio</code> is this classic from Red Hat Magaize, &quot;Understanding Virtual Memory&quot;: <a href="http://www.redhat.com/magazine/001nov04/features/vm/" target="_blank">http://www.redhat.com/magazine/001nov04/features/vm/</a> <h1><a name="Are Redis on disk snapshots atomic?">Are Redis on disk snapshots atomic?</a></h1>Yes, redis background saving process is always fork(2)ed when the server is outside of the execution of a command, so every command reported to be atomic in RAM is also atomic from the point of view of the disk snapshot.<h1><a name="Redis is single threaded, how can I exploit multiple CPU / cores?">Redis is single threaded, how can I exploit multiple CPU / cores?</a></h1>Simply start multiple instances of Redis in different ports in the same box and threat them as different servers! Given that Redis is a distributed database anyway in order to scale you need to think in terms of multiple computational units. At some point a single box may not be enough anyway.<br/><br/>In general key-value databases are very scalable because of the property that different keys can stay on different servers independently.<br/><br/>In Redis there are client libraries such Redis-rb (the Ruby client) that are able to handle multiple servers automatically using <i>consistent hashing</i>. We are going to implement consistent hashing in all the other major client libraries. If you use a different language you can implement it yourself otherwise just hash the key before to SET / GET it from a given server. For example imagine to have N Redis servers, server-0, server-1, ..., server-N. You want to store the key &quot;foo&quot;, what's the right server where to put &quot;foo&quot; in order to distribute keys evenly among different servers? Just perform the <i>crc</i> = CRC32(&quot;foo&quot;), then <i>servernum</i> = <i>crc</i> % N (the rest of the division for N). This will give a number between 0 and N-1 for every key. Connect to this server and store the key. The same for gets.<br/><br/>This is a basic way of performing key partitioning, consistent hashing is much better and this is why after Redis 1.0 will be released we'll try to implement this in every widely used client library starting from Python and PHP (Ruby already implements this support).<h1><a name="I'm using some form of key hashing for partitioning, but what about SORT BY?">I'm using some form of key hashing for partitioning, but what about SORT BY?</a></h1>With <a href="SortCommand.html">SORT</a> BY you need that all the <i>weight keys</i> are in the same Redis instance of the list/set you are trying to sort. In order to make this possible we developed a concept called <i>key tags</i>. A key tag is a special pattern inside a key that, if preset, is the only part of the key hashed in order to select the server for this key. For example in order to hash the key &quot;foo&quot; I simply perform the CRC32 checksum of the whole string, but if this key has a pattern in the form of the characters {...} I only hash this substring. So for example for the key &quot;foo{bared}&quot; the key hashing code will simply perform the CRC32 of &quot;bared&quot;. This way using key tags you can ensure that related keys will be stored on the same Redis instance just using the same key tag for all this keys. Redis-rb already implements key tags.<h1><a name="What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a List, Set, Ordered Set?">What is the maximum number of keys a single Redis instance can hold? and what the max number of elements in a List, Set, Ordered Set?</a></h1>In theory Redis can handle up to 2<sup>32 keys, and was tested in practice to handle at least 150 million of keys per instance. We are working in order to experiment with larger values.<br/><br/>Every list, set, and ordered set, can hold 2</sup>32 elements.<br/><br/>Actually Redis internals are ready to allow up to 2<sup>64 elements but the current disk dump format don't support this, and there is a lot time to fix this issues in the future as currently even with 128 GB of RAM it's impossible to reach 2</sup>32 elements.<h1><a name="What Redis means actually?">What Redis means actually?</a></h1>Redis means two things:
62
+ <ul><li> it's a joke on the word Redistribute (instead to use just a Relational DB redistribute your workload among Redis servers)</li><li> it means REmote DIctionary Server</li></ul>
63
+ <h1><a name="Why did you started the Redis project?">Why did you started the Redis project?</a></h1>In order to scale <a href="http://lloogg.com" target="_blank">LLOOGG</a>. But after I got the basic server working I liked the idea to share the work with other guys, and Redis was turned into an open source project.
64
+ </div>
65
+
66
+ </div>
67
+ </div>
68
+ </body>
69
+ </html>
70
+
@@ -0,0 +1,38 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>Features: Contents</b><br>&nbsp;&nbsp;<a href="#Features (DRAFT)">Features (DRAFT)</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Speed">Speed</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Persistence">Persistence</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Support for Data Structures">Support for Data Structures</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Atomic Operations">Atomic Operations</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Variety of Supported Languages">Variety of Supported Languages</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Master/Slave Replication">Master/Slave Replication</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Sharding">Sharding</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Hot Backups">Hot Backups</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Simple to Install, Setup and Manage">Simple to Install, Setup and Manage</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Portable">Portable</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Liberal Licensing">Liberal Licensing</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#What's next?">What's next?</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">Features</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;#sidebar <a href="SideBar.html">SideBar</a>
30
+ <h1><a name="Features (DRAFT)">Features (DRAFT)</a></h1>Checking Redis for the first time? Here your will find the most important features, and pointers to a lot more information.<h2><a name="Speed">Speed</a></h2>Redis is written in ANSI C, and loads the whole dataset in memory, so it is wicked <i><b>fast</b>!</i> Up to 110,000 <a href="SETs.html">SETs</a>/second, 81,000 GETs/second can be achieved in an entry level Linux box. Read more about Redis <a href="Speed.html">Speed</a>.<br/><br/>Also Redis supports <a href="Pipelining.html">Pipelining</a> of commands and <a href="MultiBulkCommands.html">getting and setting m&Atilde;&ordm;ltiple values in a single command</a> to speed up communication with the client libraries.<h2><a name="Persistence">Persistence</a></h2>While all the data lives in memory, changes are <i>asynchronously</i> saved on disk using flexible policies based on elapsed time and/or number of updates since last save. <br/><br/>If you can't afford losing some data, starting on version 1.1 (currently in beta but you can download it from the Git repository) Redis supports an append-only file persistence mode. Check more on <a href="Persistence.html">Persistence</a>, or read the <a href="AppendOnlyFileHowto.html">AppendOnlyFileHowto</a> for more information.<h2><a name="Support for Data Structures">Support for Data Structures</a></h2>Values in Redis can be <a href="Strings.html">Strings</a> as in a conventional key-value store, but also <a href="Lists.html">Lists</a>, <a href="Sets.html">Sets</a>, and <a href="SortedSets.html">SortedSets</a> (to be support in <a href="RoadMap.html">version 1.1</a>). This data types allow pushing/poping elements, or adding/removing them, also perform server side union, intersection, difference between sets, and so forth depending on the types. Redis supports different kind of sorting abilities for <a href="Sets.html">Sets</a> and <a href="Lists.html">Lists</a>.<br/><br/>You can think in Redis as a <b>Data Structures Server</b>, that allows you to model non trivial problems. Read <a href="DataTypes.html">Data Types</a> to learn more about the way Redis handle <a href="Strings.html">Strings</a>, and the <a href="Commands.html">Commands</a> supported by <a href="Lists.html">Lists</a>, <a href="Sets.html">Sets</a> and <a href="SortedSets.html">SortedSets</a><h2><a name="Atomic Operations">Atomic Operations</a></h2>Redis operations working on the different Data Types are <b>atomic</b>, so setting or increasing a key, adding and removing elements from a set, increasing a counter will all be accomplished safely.<h2><a name="Variety of Supported Languages">Variety of Supported Languages</a></h2>Ruby, Python, Twisted Python, PHP, Erlang, Tcl, Perl, Lua, Java, Scala, Clojure, choose your poison. Check the list of <a href="SupportedLanguages.html">Supported Languages</a> for all the details.<br/><br/>If your favorite language is not supported yet, you can write your own client library, as the <a href="ProtocolSpecification.html">Protocol</a> is pretty simple.<h2><a name="Master/Slave Replication">Master/Slave Replication</a></h2>Redis supports a very simple and fast Master/Slave replication. Is so simple it takes only one line in the <a href="Configuration.html">configuration file</a> to set it up, and 21 seconds for a Slave to complete the initial sync of 10 MM key set in a Amazon EC2 instance.<br/><br/>Read more about Master/Slave <a href="Replication.html">Replication</a>. <h2><a name="Sharding">Sharding</a></h2>Distributing the dataset across multiple Redis instances is easy in Redis, as in any other key-value store. And this depends basically on the <a href="Supported.html">Languages</a> client libraries being able to do so. <br/><br/>Read more about <a href="Sharding.html">Sharding</a> if you want to know more abour distributing data and workload in Redis.<h2><a name="Hot Backups">Hot Backups</a></h2>TODO<h2><a name="Simple to Install, Setup and Manage">Simple to Install, Setup and Manage</a></h2>Installing Redis requires little more than downloading it, uncompressing it and running make. Management is near zero, so you can start using Redis in a matter of minutes.<br/><br/>Go on and read about Redis <a href="Installation.html">installation</a>, its <a href="Setup.html">Setup</a> and <a href="Management.html">Management</a>.<h2><a name="Portable">Portable</a></h2>Redis is written in ANSI C and works in most POSIX systems like Linux, BSD, Mac OS X, Solaris, and so on. Redis is reported to compile and work under WIN32 if compiled with Cygwin, but there is no official support for Windows currently.<h2><a name="Liberal Licensing">Liberal Licensing</a></h2>Redis is free software released under the very liberal BSD license.<h2><a name="What's next?">What's next?</a></h2>Want to get started with Redis? Try the <a href="QuickStart.html">Quick Start</a> you will be up and running in just a matter of minutes. <br/><br/>Check the <a href="CodeSamples.html">Code Samples</a> and find how you can use Redis with your favorite programming language.<br/><br/><a href="Comparisons.html">Compare</a> Redis with other key-value stores, like Tokyo Cabinet or Memcached.
31
+
32
+ </div>
33
+
34
+ </div>
35
+ </div>
36
+ </body>
37
+ </html>
38
+
@@ -0,0 +1,39 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>FlushallCommand: Contents</b><br>&nbsp;&nbsp;<a href="#FLUSHALL">FLUSHALL</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">FlushallCommand</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;#sidebar <a href="GenericCommandsSidebar.html">GenericCommandsSidebar</a><h1><a name="FLUSHALL">FLUSHALL</a></h1>
30
+ <blockquote>Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.</blockquote>
31
+ <h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a>
32
+
33
+ </div>
34
+
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
39
+
@@ -0,0 +1,39 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>FlushdbCommand: Contents</b><br>&nbsp;&nbsp;<a href="#FLUSHDB">FLUSHDB</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">FlushdbCommand</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;#sidebar <a href="GenericCommandsSidebar.html">GenericCommandsSidebar</a><h1><a name="FLUSHDB">FLUSHDB</a></h1>
30
+ <blockquote>Delete all the keys of the currently selected DB. This command never fails.</blockquote>
31
+ <h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a>
32
+
33
+ </div>
34
+
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
39
+
@@ -0,0 +1,37 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>FromSqlToDataStructures: Contents</b><br>&nbsp;&nbsp;<a href="#Introduction (IDEA MORE THAN A DRAFT)">Introduction (IDEA MORE THAN A DRAFT)</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Data Structures">Data Structures</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Dude where is my SELECT statement?">Dude where is my SELECT statement?</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#LISTs">LISTs</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#SETs">SETs</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#SORT to the rescue">SORT to the rescue</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#SORT BY">SORT BY</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#HASHEs">HASHEs</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">FromSqlToDataStructures</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+
30
+ <h1><a name="Introduction (IDEA MORE THAN A DRAFT)">Introduction (IDEA MORE THAN A DRAFT)</a></h1><b>&Acirc;&iquest;Coming from SQLand?</b> <i>&Acirc;&iquest;Who doesn't?</i> Redis is simple, <i>primitive</i> when comapred to the world you are used to in the world of Relational Database Managers (RDBMS) and Structure Query Language (SQL), here you will find insight to build bridges between both worlds to model real life problems.<h2><a name="Data Structures">Data Structures</a></h2>When I was young, happy and single ;) I studied <b>Data Structures</b> at the university, actually I learnt Data Structures and Algorithms <i>before</i> learning anything about Databases, and particularly RDBMS and SQL. This is natural because you need to know about Data Structures and Algorithms to understand a Database.<br/><br/>Redis can be seen as a <b>Data Structures Server</b>, a very simple interface to a extremly fast and efficient <h2><a name="Dude where is my SELECT statement?">Dude where is my SELECT statement?</a></h2><h2><a name="LISTs">LISTs</a></h2>In SQL there is no such thing as a &quot;natural&quot; order, a SELECT statement without a ORDER BY clause will return data in a undefined order. In Redis <a href="LISTs.html">LISTs</a> address the problem of natural ordering, ...<h2><a name="SETs">SETs</a></h2>So you have a bunch of unordered data, <h2><a name="SORT to the rescue">SORT to the rescue</a></h2>But sometimes we <i>need</i> to actually sort a LIST in a order different from its natural or take a SET and have it ordered, there is where the <i>fast</i> SORT commands comes handy... <h3><a name="SORT BY">SORT BY</a></h3>Just SORTing keys would be kind of boring, sometimes useless right? Well, you can SORT...<h2><a name="HASHEs">HASHEs</a></h2>Umm, sorry you will have to wait for a <a href="RoadMap.html">upcoming version of Redis</a> to have Hashes, but here are Idioms you should house to manage Dictionary like data...
31
+ </div>
32
+
33
+ </div>
34
+ </div>
35
+ </body>
36
+ </html>
37
+
@@ -0,0 +1,36 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>GenericCommandsSidebar: Contents</b>
20
+ </div>
21
+
22
+ <h1 class="wikiname">GenericCommandsSidebar</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;== Generic Commands ==<br/><br/><ul><li> <a href="ExistsCommand.html">EXISTS</a></li><li> <a href="DelCommand.html">DEL</a></li><li> <a href="TypeCommand.html">TYPE</a></li><li> <a href="KeysCommand.html">KEYS</a></li><li> <a href="RandomkeyCommand.html">RANDOMKEY</a></li><li> <a href="RenameCommand.html">RENAME</a></li><li> <a href="RenamenxCommand.html">RENAMENX</a></li><li> <a href="DbsizeCommand.html">DBSIZE</a></li><li> <a href="ExpireCommand.html">EXPIRE</a></li><li> <a href="ExpireCommand.html">PERSIST</a></li><li> <a href="TtlCommand.html">TTL</a></li><li> <a href="SelectCommand.html">SELECT</a></li><li> <a href="MoveCommand.html">MOVE</a></li><li> <a href="FlushdbCommand.html">FLUSHDB</a></li><li> <a href="FlushallCommand.html">FLUSHALL</a></li><li> <a href="MultiExecCommand.html">Redis Transactions</a></li></ul>
30
+ </div>
31
+
32
+ </div>
33
+ </div>
34
+ </body>
35
+ </html>
36
+
@@ -0,0 +1,39 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>GetCommand: Contents</b><br>&nbsp;&nbsp;<a href="#GET _key_">GET _key_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">GetCommand</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;#sidebar <a href="StringCommandsSidebar.html">StringCommandsSidebar</a><h1><a name="GET _key_">GET _key_</a></h1>
30
+ <i>Time complexity: O(1)</i><blockquote>Get the value of the specified key. If the keydoes not exist the special value 'nil' is returned.If the value stored at <i>key</i> is not a string an erroris returned because GET can only handle string values.</blockquote>
31
+ <h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a>
32
+
33
+ </div>
34
+
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
39
+
@@ -0,0 +1,39 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>GetbitCommand: Contents</b><br>&nbsp;&nbsp;<a href="#GETBIT _key_ _offset_ (Redis &gt;">GETBIT _key_ _offset_ (Redis &gt;</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">GetbitCommand</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+
30
+ <h1><a name="GETBIT _key_ _offset_ (Redis &gt;">GETBIT _key_ _offset_ (Redis &gt;</a></h1> 2.1.8) =
31
+ <i>Time complexity: O(1)</i><blockquote>Returns the bit value at <i>offset</i> in the string value stored at <i>key</i>.</blockquote>
32
+ When <i>offset</i> is beyond the string length, the string is assumed to be a contiguous space with 0 bits. When <i>key</i> does not exist it is assumed to be an empty string, so <i>offset</i> is always out of range and the value is also assumed to be a contiguous space with 0 bits.<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically: the bit value stored at <i>offset</i>.
33
+ </div>
34
+
35
+ </div>
36
+ </div>
37
+ </body>
38
+ </html>
39
+
@@ -0,0 +1,38 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
3
+ <html>
4
+ <head>
5
+ <link type="text/css" rel="stylesheet" href="style.css" />
6
+ </head>
7
+ <body>
8
+ <div id="page">
9
+
10
+ <div id='header'>
11
+ <a href="index.html">
12
+ <img style="border:none" alt="Redis Documentation" src="redis.png">
13
+ </a>
14
+ </div>
15
+
16
+ <div id="pagecontent">
17
+ <div class="index">
18
+ <!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
19
+ <b>GetsetCommand: Contents</b><br>&nbsp;&nbsp;<a href="#GETSET _key_ _value_">GETSET _key_ _value_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Design patterns">Design patterns</a>
20
+ </div>
21
+
22
+ <h1 class="wikiname">GetsetCommand</h1>
23
+
24
+ <div class="summary">
25
+
26
+ </div>
27
+
28
+ <div class="narrow">
29
+ &iuml;&raquo;&iquest;#sidebar <a href="StringCommandsSidebar.html">StringCommandsSidebar</a><h1><a name="GETSET _key_ _value_">GETSET _key_ _value_</a></h1>
30
+ <i>Time complexity: O(1)</i><blockquote>GETSET is an atomic <i>set this value and return the old value</i> command.Set <i>key</i> to the string <i>value</i> and return the old value stored at <i>key</i>.The string can't be longer than 1073741824 bytes (1 GB).</blockquote>
31
+ <h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a><h2><a name="Design patterns">Design patterns</a></h2><blockquote>GETSET can be used together with INCR for counting with atomic reset whena given condition arises. For example a process may call INCR against thekey <i>mycounter</i> every time some event occurred, but from time totime we need to get the value of the counter and reset it to zero atomicallyusing <code name="code" class="python">GETSET mycounter 0</code>.</blockquote>
32
+ </div>
33
+
34
+ </div>
35
+ </div>
36
+ </body>
37
+ </html>
38
+