Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enable kqueue/kevent only for Mac OS X 10.6.x as it seems that 10.5.x…

… has a broken implementation of this syscalls.
  • Loading branch information...
commit 37be27653817f0c4c18d695ceea082e0bb7bf462 1 parent 03a3788
@antirez authored
Showing with 1 addition and 3,169 deletions.
  1. +1 −1  config.h
  2. +0 −39 doc/AuthCommand.html
  3. +0 −129 doc/Benchmarks.html
  4. +0 −39 doc/BgsaveCommand.html
  5. +0 −44 doc/CommandReference.html
  6. +0 −38 doc/Credits.html
  7. +0 −38 doc/DbsizeCommand.html
  8. +0 −42 doc/DelCommand.html
  9. +0 −37 doc/DesignPatterns.html
  10. +0 −42 doc/ExistsCommand.html
  11. +0 −58 doc/ExpireCommand.html
  12. +0 −46 doc/FAQ.html
  13. +0 −39 doc/FlushallCommand.html
  14. +0 −39 doc/FlushdbCommand.html
  15. +0 −39 doc/GetCommand.html
  16. +0 −40 doc/GetsetCommand.html
  17. +0 −43 doc/IncrCommand.html
  18. +0 −50 doc/InfoCommand.html
  19. +0 −42 doc/KeysCommand.html
  20. +0 −39 doc/LastsaveCommand.html
  21. +0 −41 doc/LindexCommand.html
  22. +0 −41 doc/LlenCommand.html
  23. +0 −41 doc/LpopCommand.html
  24. +0 −42 doc/LrangeCommand.html
  25. +0 −41 doc/LremCommand.html
  26. +0 −39 doc/LsetCommand.html
  27. +0 −47 doc/LtrimCommand.html
  28. +0 −52 doc/MgetCommand.html
  29. +0 −63 doc/MonitorCommand.html
  30. +0 −42 doc/MoveCommand.html
  31. +0 −119 doc/ProtocolSpecification.html
  32. +0 −51 doc/QuickStart.html
  33. +0 −38 doc/QuitCommand.html
  34. +0 −110 doc/README.html
  35. +0 −39 doc/RandomkeyCommand.html
  36. +0 −39 doc/RenameCommand.html
  37. +0 −42 doc/RenamenxCommand.html
  38. +0 −41 doc/ReplicationHowto.html
  39. +0 −42 doc/ReplyTypes.html
  40. +0 −40 doc/RpushCommand.html
  41. +0 −42 doc/SaddCommand.html
  42. +0 −39 doc/SaveCommand.html
  43. +0 −41 doc/ScardCommand.html
  44. +0 −45 doc/SdiffCommand.html
  45. +0 −39 doc/SdiffstoreCommand.html
  46. +0 −39 doc/SelectCommand.html
  47. +0 −39 doc/SetCommand.html
  48. +0 −42 doc/SetnxCommand.html
  49. +0 −39 doc/ShutdownCommand.html
  50. +0 −40 doc/SinterCommand.html
  51. +0 −39 doc/SinterstoreCommand.html
  52. +0 −42 doc/SismemberCommand.html
  53. +0 −41 doc/SlaveofCommand.html
  54. +0 −39 doc/SmembersCommand.html
  55. +0 −44 doc/SmoveCommand.html
  56. +0 −60 doc/SortCommand.html
  57. +0 −39 doc/SpopCommand.html
  58. +0 −42 doc/SremCommand.html
  59. +0 −40 doc/SunionCommand.html
  60. +0 −39 doc/SunionstoreCommand.html
  61. +0 −38 doc/TemplateCommand.html
  62. +0 −38 doc/TtlCommand.html
  63. +0 −250 doc/TwitterAlikeExample.html
  64. +0 −44 doc/TypeCommand.html
  65. +0 −39 doc/UnstableSource.html
  66. +0 −36 doc/index.html
View
2  config.h
@@ -31,7 +31,7 @@
#define HAVE_EPOLL 1
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
+#if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
#define HAVE_KQUEUE 1
#endif
View
39 doc/AuthCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>AuthCommand: Contents</b><br>&nbsp;&nbsp;<a href="#AUTH _password_">AUTH _password_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
- </div>
-
- <h1 class="wikiname">AuthCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="AUTH _password_">AUTH _password_</a></h1><blockquote>Request for authentication in a password protected Redis server.A Redis server can be instructed to require a password before to allow clientsto issue commands. This is done using the <i>requirepass</i> directive in theRedis configuration file.</blockquote>
-<blockquote>If the password given by the client is correct the server replies withan OK status code reply and starts accepting commands from the client.Otherwise an error is returned and the clients needs to try a new password.Note that for the high performance nature of Redis it is possible to trya lot of passwords in parallel in very short time, so make sure to generatea strong and very long password so that this attack is infeasible.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a>
-
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
129 doc/Benchmarks.html
@@ -1,129 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>Benchmarks: Contents</b><br>&nbsp;&nbsp;<a href="#How Fast is Redis?">How Fast is Redis?</a><br>&nbsp;&nbsp;<a href="#Latency percentiles">Latency percentiles</a>
- </div>
-
- <h1 class="wikiname">Benchmarks</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="How Fast is Redis?">How Fast is Redis?</a></h1>Redis includes the <code name="code" class="python">redis-benchmark</code> utility that simulates SETs/GETs done by N clients at the same time sending M total queries (it is similar to the Apache's <code name="code" class="python">ab</code> utility). Below you'll find the full output of the benchmark executed against a Linux box.<br/><br/><ul><li> The test was done with 50 simultaneous clients performing 100000 requests.</li><li> The value SET and GET is a 256 bytes string.</li><li> The Linux box is running <b>Linux 2.6</b>, it's <b>Xeon X3320 2.5Ghz</b>.</li><li> Text executed using the loopback interface (127.0.0.1).</li></ul>
-Results: <b>about 110000 SETs per second, about 81000 GETs per second.</b><h1><a name="Latency percentiles">Latency percentiles</a></h1><pre class="codeblock python" name="code">
-./redis-benchmark -n 100000
-
-====== SET ======
- 100007 requests completed in 0.88 seconds
- 50 parallel clients
- 3 bytes payload
- keep alive: 1
-
-58.50% &lt;= 0 milliseconds
-99.17% &lt;= 1 milliseconds
-99.58% &lt;= 2 milliseconds
-99.85% &lt;= 3 milliseconds
-99.90% &lt;= 6 milliseconds
-100.00% &lt;= 9 milliseconds
-114293.71 requests per second
-
-====== GET ======
- 100000 requests completed in 1.23 seconds
- 50 parallel clients
- 3 bytes payload
- keep alive: 1
-
-43.12% &lt;= 0 milliseconds
-96.82% &lt;= 1 milliseconds
-98.62% &lt;= 2 milliseconds
-100.00% &lt;= 3 milliseconds
-81234.77 requests per second
-
-====== INCR ======
- 100018 requests completed in 1.46 seconds
- 50 parallel clients
- 3 bytes payload
- keep alive: 1
-
-32.32% &lt;= 0 milliseconds
-96.67% &lt;= 1 milliseconds
-99.14% &lt;= 2 milliseconds
-99.83% &lt;= 3 milliseconds
-99.88% &lt;= 4 milliseconds
-99.89% &lt;= 5 milliseconds
-99.96% &lt;= 9 milliseconds
-100.00% &lt;= 18 milliseconds
-68458.59 requests per second
-
-====== LPUSH ======
- 100004 requests completed in 1.14 seconds
- 50 parallel clients
- 3 bytes payload
- keep alive: 1
-
-62.27% &lt;= 0 milliseconds
-99.74% &lt;= 1 milliseconds
-99.85% &lt;= 2 milliseconds
-99.86% &lt;= 3 milliseconds
-99.89% &lt;= 5 milliseconds
-99.93% &lt;= 7 milliseconds
-99.96% &lt;= 9 milliseconds
-100.00% &lt;= 22 milliseconds
-100.00% &lt;= 208 milliseconds
-88109.25 requests per second
-
-====== LPOP ======
- 100001 requests completed in 1.39 seconds
- 50 parallel clients
- 3 bytes payload
- keep alive: 1
-
-54.83% &lt;= 0 milliseconds
-97.34% &lt;= 1 milliseconds
-99.95% &lt;= 2 milliseconds
-99.96% &lt;= 3 milliseconds
-99.96% &lt;= 4 milliseconds
-100.00% &lt;= 9 milliseconds
-100.00% &lt;= 208 milliseconds
-71994.96 requests per second
-</pre>Notes: changing the payload from 256 to 1024 or 4096 bytes does not change the numbers significantly (but reply packets are glued together up to 1024 bytes so GETs may be slower with big payloads). The same for the number of clients, from 50 to 256 clients I got the same numbers. With only 10 clients it starts to get a bit slower.<br/><br/>You can expect different results from different boxes. For example a low profile box like <b>Intel core duo T5500 clocked at 1.66Ghz running Linux 2.6</b> will output the following:
-<pre class="codeblock python python" name="code">
- ./redis-benchmark -q -n 100000
-SET: 53684.38 requests per second
-GET: 45497.73 requests per second
-INCR: 39370.47 requests per second
-LPUSH: 34803.41 requests per second
-LPOP: 37367.20 requests per second
-</pre>Another one using a 64 bit box, a Xeon L5420 clocked at 2.5 Ghz:<br/><br/><pre class="codeblock python python python" name="code">
- ./redis-benchmark -q -n 100000
-PING: 111731.84 requests per second
-SET: 108114.59 requests per second
-GET: 98717.67 requests per second
-INCR: 95241.91 requests per second
-LPUSH: 104712.05 requests per second
-LPOP: 93722.59 requests per second
-</pre>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/BgsaveCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>BgsaveCommand: Contents</b><br>&nbsp;&nbsp;<a href="#BGSAVE">BGSAVE</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">BgsaveCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="BGSAVE">BGSAVE</a></h1>
-<blockquote>Save the DB in background. The OK code is immediately returned.Redis forks, the parent continues to server the clients, the childsaves the DB on disk then exit. A client my be able to check if theoperation succeeded using the <a href="LastsaveCommand.html">LASTSAVE</a> command.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="SaveCommand.html">SAVE</a></li><li> <a href="ShutdownCommand.html">SHUTDOWN</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
44 doc/CommandReference.html
@@ -1,44 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>CommandReference: Contents</b><br>&nbsp;&nbsp;<a href="#Redis Command Reference">Redis Command Reference</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Connection handling">Connection handling</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Commands operating on string values">Commands operating on string values</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Commands operating on the key space">Commands operating on the key space</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Commands operating on lists">Commands operating on lists</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Commands operating on sets">Commands operating on sets</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Multiple databases handling commands">Multiple databases handling commands</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Sorting">Sorting</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Persistence control commands">Persistence control commands</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Remote server control commands">Remote server control commands</a>
- </div>
-
- <h1 class="wikiname">CommandReference</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Redis Command Reference">Redis Command Reference</a></h1>Every command name links to a specific wiki page describing the behavior of the command.<h2><a name="Connection handling">Connection handling</a></h2><ul><li> <a href="QuitCommand.html">QUIT</a> <code name="code" class="python">close the connection</code></li><li> <a href="AuthCommand.html">AUTH</a> <code name="code" class="python">simple password authentication if enabled</code></li></ul>
-<h2><a name="Commands operating on string values">Commands operating on string values</a></h2><ul><li> <a href="SetCommand.html">SET</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string value</code></li><li> <a href="GetCommand.html">GET</a> <i>key</i> <code name="code" class="python">return the string value of the key</code></li><li> <a href="GetsetCommand.html">GETSET</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string returning the old value of the key</code></li><li> <a href="MgetCommand.html">MGET</a> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">multi-get, return the strings values of the keys</code></li><li> <a href="SetnxCommand.html">SETNX</a> <i>key</i> <i>value</i> <code name="code" class="python">set a key to a string value if the key does not exist</code></li><li> <a href="IncrCommand.html">INCR</a> <i>key</i> <code name="code" class="python">increment the integer value of key</code></li><li> <a href="IncrCommand.html">INCRBY</a> <i>key</i> <i>integer</i><code name="code" class="python"> increment the integer value of key by integer</code></li><li> <a href="IncrCommand.html">DECR</a> <i>key</i> <code name="code" class="python">decrement the integer value of key</code></li><li> <a href="IncrCommand.html">DECRBY</a> <i>key</i> <i>integer</i> <code name="code" class="python">decrement the integer value of key by integer</code></li><li> <a href="ExistsCommand.html">EXISTS</a> <i>key</i> <code name="code" class="python">test if a key exists</code></li><li> <a href="DelCommand.html">DEL</a> <i>key</i> <code name="code" class="python">delete a key</code></li><li> <a href="TypeCommand.html">TYPE</a> <i>key</i> <code name="code" class="python">return the type of the value stored at key</code></li></ul>
-<h2><a name="Commands operating on the key space">Commands operating on the key space</a></h2><ul><li> <a href="KeysCommand.html">KEYS</a> <i>pattern</i> <code name="code" class="python">return all the keys matching a given pattern</code></li><li> <a href="RandomkeyCommand.html">RANDOMKEY</a> <code name="code" class="python">return a random key from the key space</code></li><li> <a href="RenameCommand.html">RENAME</a> <i>oldname</i> <i>newname</i> <code name="code" class="python">rename the old key in the new one, destroing the newname key if it already exists</code></li><li> <a href="RenamenxCommand.html">RENAMENX</a> <i>oldname</i> <i>newname</i> <code name="code" class="python">rename the old key in the new one, if the newname key does not already exist</code></li><li> <a href="DbsizeCommand.html">DBSIZE</a> <code name="code" class="python">return the number of keys in the current db</code></li><li> <a href="ExpireCommand.html">EXPIRE</a> <code name="code" class="python">set a time to live in seconds on a key</code></li><li> <a href="TtlCommand.html">TTL</a> <code name="code" class="python">get the time to live in seconds of a key</code></li></ul>
-<h2><a name="Commands operating on lists">Commands operating on lists</a></h2><ul><li> <a href="RpushCommand.html">RPUSH</a> <i>key</i> <i>value</i> <code name="code" class="python">Append an element to the tail of the List value at key</code></li><li> <a href="RpushCommand.html">LPUSH</a> <i>key</i> <i>value</i> <code name="code" class="python">Append an element to the head of the List value at key</code></li><li> <a href="LlenCommand.html">LLEN</a> <i>key</i> <code name="code" class="python">Return the length of the List value at key</code></li><li> <a href="LrangeCommand.html">LRANGE</a> <i>key</i> <i>start</i> <i>end</i> <code name="code" class="python">Return a range of elements from the List at key</code></li><li> <a href="LtrimCommand.html">LTRIM</a> <i>key</i> <i>start</i> <i>end</i> <code name="code" class="python">Trim the list at key to the specified range of elements</code></li><li> <a href="LindexCommand.html">LINDEX</a> <i>key</i> <i>index</i> <code name="code" class="python">Return the element at index position from the List at key</code></li><li> <a href="LsetCommand.html">LSET</a> <i>key</i> <i>index</i> <i>value</i> <code name="code" class="python">Set a new value as the element at index position of the List at key</code></li><li> <a href="LremCommand.html">LREM</a> <i>key</i> <i>count</i> <i>value</i> <code name="code" class="python">Remove the first-N, last-N, or all the elements matching value from the List at key</code></li><li> <a href="LpopCommand.html">LPOP</a> <i>key</i> <code name="code" class="python">Return and remove (atomically) the first element of the List at key</code></li><li> <a href="LpopCommand.html">RPOP</a> <i>key</i> <code name="code" class="python">Return and remove (atomically) the last element of the List at key</code></li></ul>
-<h2><a name="Commands operating on sets">Commands operating on sets</a></h2><ul><li> <a href="SaddCommand.html">SADD</a> <i>key</i> <i>member</i> <code name="code" class="python">Add the specified member to the Set value at key</code></li><li> <a href="SremCommand.html">SREM</a> <i>key</i> <i>member</i> <code name="code" class="python">Remove the specified member from the Set value at key</code></li><li> <a href="SpopCommand.html">SPOP</a> <i>key</i> <code name="code" class="python">Remove and return (pop) a random element from the Set value at key</code></li><li> <a href="SmoveCommand.html">SMOVE</a> <i>srckey</i> <i>dstkey</i> <i>member</i> <code name="code" class="python">Move the specified member from one Set to another atomically</code></li><li> <a href="ScardCommand.html">SCARD</a> <i>key</i> <code name="code" class="python">Return the number of elements (the cardinality) of the Set at key</code></li><li> <a href="SismemberCommand.html">SISMEMBER</a> <i>key</i> <i>member</i> <code name="code" class="python">Test if the specified value is a member of the Set at key</code></li><li> <a href="SinterCommand.html">SINTER</a> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Return the intersection between the Sets stored at key1, key2, ..., keyN</code></li><li> <a href="SinterstoreCommand.html">SINTERSTORE</a> <i>dstkey</i> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Compute the intersection between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey</code></li><li> <a href="SunionCommand.html">SUNION</a> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Return the union between the Sets stored at key1, key2, ..., keyN</code></li><li> <a href="SunionstoreCommand.html">SUNIONSTORE</a> <i>dstkey</i> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Compute the union between the Sets stored at key1, key2, ..., keyN, and store the resulting Set at dstkey</code></li><li> <a href="SdiffCommand.html">SDIFF</a> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Return the difference between the Set stored at key1 and all the Sets key2, ..., keyN</code></li><li> <a href="SdiffstoreCommand.html">SDIFFSTORE</a> <i>dstkey</i> <i>key1</i> <i>key2</i> ... <i>keyN</i> <code name="code" class="python">Compute the difference between the Set key1 and all the Sets key2, ..., keyN, and store the resulting Set at dstkey</code></li><li> <a href="SmembersCommand.html">SMEMBERS</a> <i>key</i> <code name="code" class="python">Return all the members of the Set value at key</code></li></ul>
-<h2><a name="Multiple databases handling commands">Multiple databases handling commands</a></h2><ul><li> <a href="SelectCommand.html">SELECT</a> <i>index</i> <code name="code" class="python">Select the DB having the specified index</code></li><li> <a href="MoveCommand.html">MOVE</a> <i>key</i> <i>dbindex</i> <code name="code" class="python">Move the key from the currently selected DB to the DB having as index dbindex</code></li><li> <a href="FlushdbCommand.html">FLUSHDB</a> <code name="code" class="python">Remove all the keys of the currently selected DB</code></li><li> <a href="FlushallCommand.html">FLUSHALL</a> <code name="code" class="python">Remove all the keys from all the databases</code></li></ul>
-<h2><a name="Sorting">Sorting</a></h2><ul><li> <a href="SortCommand.html">SORT</a> <i>key</i> BY <i>pattern</i> LIMIT <i>start</i> <i>end</i> GET <i>pattern</i> ASC|DESC ALPHA <code name="code" class="python">Sort a Set or a List accordingly to the specified parameters</code></li></ul>
-<h2><a name="Persistence control commands">Persistence control commands</a></h2><ul><li> <a href="SaveCommand.html">SAVE</a> <code name="code" class="python">Synchronously save the DB on disk</code></li><li> <a href="BgsaveCommand.html">BGSAVE</a> <code name="code" class="python">Asynchronously save the DB on disk</code></li><li> <a href="LastsaveCommand.html">LASTSAVE</a> <code name="code" class="python">Return the UNIX time stamp of the last successfully saving of the dataset on disk</code></li><li> <a href="ShutdownCommand.html">SHUTDOWN</a> <code name="code" class="python">Synchronously save the DB on disk, then shutdown the server</code></li></ul>
-<h2><a name="Remote server control commands">Remote server control commands</a></h2><ul><li> <a href="InfoCommand.html">INFO</a> <code name="code" class="python">Provide information and statistics about the server</code></li><li> <a href="MonitorCommand.html">MONITOR</a> <code name="code" class="python">Dump all the received requests in real time</code></li><li> <a href="SlaveofCommand.html">SLAVEOF</a> <code name="code" class="python">Change the replication settings</code></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
38 doc/Credits.html
@@ -1,38 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>Credits: Contents</b><br>&nbsp;&nbsp;<a href="#Credits">Credits</a>
- </div>
-
- <h1 class="wikiname">Credits</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Credits">Credits</a></h1><ul><li> The Redis server was designed and written by <a href="http://invece.org" target="_blank">Salvatore Sanfilippo (aka antirez)</a></li><li> <a href="http://brainspl.at/" target="_blank">Ezra Zygmuntowicz (aka ezmobius)</a> - Ruby client lib initial version and hacking</li><li> <a href="http://qix.it" target="_blank">Ludovico Magnocavallo (aka ludo)</a> - Python clinet lib</li><li> <a href="http://www.adroll.com/" target="_blank">Valentino Volonghi of Adroll</a> - Erlang client lib</li><li> <b>brettbender</b> - found and fixed a bug in sds.c that caused the server to crash at least on 64 bit systems, and anyway to be buggy since we used the same vararg thing against vsprintf without to call va_start and va_end every time.</li><li> <a href="http://www.rot13.org/~dpavlin" target="_blank">Dobrica Pavlinusic</a> - Perl client lib</li><li> Brian Hammond - AUTH command implementation, C++ client lib</li><li> <a href="http://www.clorophilla.net/" target="_blank">Daniele Alessandri</a> - Lua client lib</li><li> Corey Stup - C99 cleanups</li><li> Taylor Weibley - Ruby client improvements</li><li> Bob Potter - Rearrange redisObject struct to reduce memory usage in 64bit environments</li><li> Luca Guidi and Brian McKinney - Ruby client improvements</li><li> Aman Gupta - SDIFF / SDIFFSTORE, other Set operations improvements, ability to disable clients timeout.</li><li> Diego Rosario Brogna - Code and ideas about dumping backtrace on sigsegv and similar error conditions.</li></ul>
-p.s. sorry to take this file in sync is hard in this early days. Please drop me an email if I forgot to add your name here!
-
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
38 doc/DbsizeCommand.html
@@ -1,38 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>DbsizeCommand: Contents</b><br>&nbsp;&nbsp;<a href="#DBSIZE">DBSIZE</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">DbsizeCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="DBSIZE">DBSIZE</a></h1><blockquote>Return the number of keys in the currently selected database.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="SelectCommand.html">SELECT</a></li><li> <a href="InfoCommand.html">INFO</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
42 doc/DelCommand.html
@@ -1,42 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>DelCommand: Contents</b><br>&nbsp;&nbsp;<a href="#DEL _key_">DEL _key_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">DelCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="DEL _key_">DEL _key_</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Remove the specified key. If the key does not existno operation is performed. The command always returns success.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
-1 if the key was removed
-0 if the key does not exist
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="SetCommand.html">SET</a></li><li> <a href="GetCommand.html">GET</a></li><li> <a href="ExistsCommand.html">EXISTS</a></li><li> <a href="LdelCommand.html">LDEL</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
37 doc/DesignPatterns.html
@@ -1,37 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>DesignPatterns: Contents</b>
- </div>
-
- <h1 class="wikiname">DesignPatterns</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- Use random keys instead of incremental keys in order to avoid a single-key that gets incremented by many servers. This can can't be distributed among servers.
-
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
42 doc/ExistsCommand.html
@@ -1,42 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>ExistsCommand: Contents</b><br>&nbsp;&nbsp;<a href="#EXISTS _key_">EXISTS _key_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">ExistsCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="EXISTS _key_">EXISTS _key_</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Test if the specified key exists. The command returns&quot;0&quot; if the key exists, otherwise &quot;1&quot; is returned.Note that even keys set with an empty string as value willreturn &quot;1&quot;.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
-1 if the key exists.
-0 if the key does not exist.
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="SetnxCommand.html">SETNX</a> is a <code name="code" class="python">SET if not EXISTS</code> atomic operation.</li><li> <a href="SismemberCommand.html">SISMEMBER</a> test if an element is a member of a Set.</li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
58 doc/ExpireCommand.html
@@ -1,58 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>ExpireCommand: Contents</b><br>&nbsp;&nbsp;<a href="#Expire _key_ _seconds_">Expire _key_ _seconds_</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="#Setting the timeout again on already volatile keys">Setting the timeout again on already volatile keys</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">ExpireCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Expire _key_ _seconds_">Expire _key_ _seconds_</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Set a timeout on the specified key. After the timeout the key will beautomatically delete by the server. A key with an associated timeout issaid to be <i>volatile</i> in Redis terminology.</blockquote>
-<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 containingthe dataset and stopping the server does not stop the flow of time as Redisregisters on disk when the key will no longer be available as Unix time, andnot the remaining seconds.</blockquote>
-<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, the INCR commandor any other command that modify the value stored at key the timeout isremoved from the key and the key becomes non volatile.</blockquote>
-<h2><a name="Restrictions with write operations against volatile keys">Restrictions with write operations against volatile keys</a></h2><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>
-<pre class="codeblock python" name="code">
-% ./redis-cli lpush mylist foobar /Users/antirez/hack/redis
-OK
-% ./redis-cli lpush mylist hello /Users/antirez/hack/redis
-OK
-% ./redis-cli expire mylist 10000 /Users/antirez/hack/redis
-1
-% ./redis-cli lpush mylist newelement
-OK
-% ./redis-cli lrange mylist 0 -1 /Users/antirez/hack/redis
-1. newelement
-</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 timeof the commands to. This is not a desirable property in a distributed databasethat supports replication.</blockquote>
-<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>
-<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">
-1: the timeout was set.
-0: the timeout was not set since the key already has an associated timeout, or the key does not exist.
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="InfoCommand.html">EXPIRE</a></li><li> <a href="TypeCommand.html">TYPE</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
46 doc/FAQ.html
@@ -1,46 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>FAQ: Contents</b><br>&nbsp;&nbsp;<a href="#Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?">Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?</a><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="#Ok but I absolutely need to have a DB larger than memory, still I need the Redis features">Ok but I absolutely need to have a DB larger than memory, still I need the Redis features</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="#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="#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?">What is the maximum number of keys a single Redis instance can hold?</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>
- </div>
-
- <h1 class="wikiname">FAQ</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?">Why I need Redis if there is already memcachedb, Tokyo Cabinet, ...?</a></h1>Memcachedb is basically memcached done persistent. Redis is a different evolution
-path in the key-value DBs, the idea is that the main advantages of key-value DBs
-are retained even without a so severe loss of comfort of plain key-value DBs.
-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>
-<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>
-<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>
-<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>
-<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>
-<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>The whole key-value hype started for a reason: performances. 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.<h1><a name="Ok but I absolutely need to have a DB larger than memory, still I need the Redis features">Ok but I absolutely need to have a DB larger than memory, still I need the Redis features</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.<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/>However it is planned to add a configuration directive to tell Redis to stop accepting queries but instead to SAVE the latest data and quit if it is using more than a given amount of memory. Also the new 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/>Update: redis SVN is able to know how much memory it is using and report it via the <a href="InfoCommand.html">INFO</a> command.<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.<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?">What is the maximum number of keys a single Redis instance can hold?</a></h1>The latest versions of Redis in the Git repository are able to handle at least 150 million of keys per instance. We are working in order to experiment with larger values.<h1><a name="What Redis means actually?">What Redis means actually?</a></h1>Redis means two things:
-<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>
-<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.
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/FlushallCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>FlushallCommand: Contents</b><br>&nbsp;&nbsp;<a href="#FLUSHALL">FLUSHALL</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">FlushallCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="FLUSHALL">FLUSHALL</a></h1>
-<blockquote>Delete all the keys of all the existing databases, not just the currently selected one. This command never fails.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="FlushdbCommand.html">FLUSHDB</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/FlushdbCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>FlushdbCommand: Contents</b><br>&nbsp;&nbsp;<a href="#FLUSHDB">FLUSHDB</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">FlushdbCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="FLUSHDB">FLUSHDB</a></h1>
-<blockquote>Delete all the keys of the currently selected DB. This command never fails.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="FlushallCommand.html">FLUSHALL</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/GetCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<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><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">GetCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="GET _key_">GET _key_</a></h1>
-<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>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="SetCommand.html">SET</a></li><li> <a href="SetnxCommand.html">SETNX</a></li><li> <a href="IncrCommand.html">INCR</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
40 doc/GetsetCommand.html
@@ -1,40 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<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><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">GetsetCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="GETSET _key_ _value_">GETSET _key_ _value_</a></h1>
-<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>
-<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>
-<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="GetCommand.html">GET</a></li><li> <a href="SetCommand.html">SET</a></li><li> <a href="SetnxCommand.html">SETNX</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
43 doc/IncrCommand.html
@@ -1,43 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>IncrCommand: Contents</b><br>&nbsp;&nbsp;<a href="#INCR _key_">INCR _key_</a><br>&nbsp;&nbsp;<a href="#INCRBY _key_ _integer_">INCRBY _key_ _integer_</a><br>&nbsp;&nbsp;<a href="#DECR _key_ _integer_">DECR _key_ _integer_</a><br>&nbsp;&nbsp;<a href="#DECRBY _key_ _integer_">DECRBY _key_ _integer_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">IncrCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="INCR _key_">INCR _key_</a></h1>
-<h1><a name="INCRBY _key_ _integer_">INCRBY _key_ _integer_</a></h1>
-<h1><a name="DECR _key_ _integer_">DECR _key_ _integer_</a></h1>
-<h1><a name="DECRBY _key_ _integer_">DECRBY _key_ _integer_</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Increment or decrement the number stored at <i>key</i> by one. If the key doesnot exist or contains a value of a wrong type, set the key to thevalue of &quot;0&quot; before to perform the increment or decrement operation.</blockquote>
-<blockquote>INCRBY and DECRBY work just like INCR and DECR but instead toincrement/decrement by 1 the increment/decrement is <i>integer</i>.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, this commands will reply with the new value of <i>key</i> after the increment or decrement.<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="GetCommand.html">GET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
50 doc/InfoCommand.html
@@ -1,50 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>InfoCommand: Contents</b><br>&nbsp;&nbsp;<a href="#INFO">INFO</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Notes">Notes</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">InfoCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="INFO">INFO</a></h1><blockquote>The info command returns different information and statistics about the server in an format that's simple to parse by computers and easy to red by huamns.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a>, specifically in the following format:<br/><br/><pre class="codeblock python" name="code">
-edis_version:0.07
-connected_clients:1
-connected_slaves:0
-used_memory:3187
-changes_since_last_save:0
-last_save_time:1237655729
-total_connections_received:1
-total_commands_processed:1
-uptime_in_seconds:25
-uptime_in_days:0
-</pre>All the fields are in the form <code name="code" class="python">field:value</code><h2><a name="Notes">Notes</a></h2><ul><li> <code name="code" class="python">used_memory</code> is returned in bytes, and is the total number of bytes allocated by the program using <code name="code" class="python">malloc</code>.</li><li> <code name="code" class="python">uptime_in_days</code> is redundant since the uptime in seconds contains already the full uptime information, this field is only mainly present for humans.</li><li> <code name="code" class="python">changes_since_last_save</code> does not refer to the number of key changes, but to the number of operations that produced some kind of change in the dataset.</li></ul>
-<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LastsaveCommand.html">LASTSAVE</a></li><li> <a href="DbsizeCommand.html">DBSIZE</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
42 doc/KeysCommand.html
@@ -1,42 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>KeysCommand: Contents</b><br>&nbsp;&nbsp;<a href="#KEYS _pattern_">KEYS _pattern_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">KeysCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="KEYS _pattern_">KEYS _pattern_</a></h1>
-<i>Time complexity: O(n) (with n being the number of keys in the DB, and assuming keys and pattern of limited length)</i><blockquote>Returns all the keys matching the glob-style <i>pattern</i> asspace separated strings. For example if you have in thedatabase the keys &quot;foo&quot; and &quot;foobar&quot; the command &quot;KEYS foo<code name="code" class="python">*</code>&quot;will return &quot;foo foobar&quot;.</blockquote>
-<blockquote>Note that while the time complexity for this operation is O(n)the constant times are pretty low. For example Redis runningon an entry level laptop can scan a 1 million keys databasein 40 milliseconds. Still it's better to consider this one ofthe slow commands that may ruin the DB performance if not usedwith care.</blockquote>
-Glob style patterns examples:
-<ul><li> h?llo will match hello hallo hhllo</li><li> h<b>llo will match hllo heeeello
-<blockquote>* h<a href="ae.html">ae</a>llo will match hello and hallo, but not hillo</blockquote>Use \ to escape special chars if you want to match them verbatim.<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a>, specifically a string in the form of space separated list of keys. Note that most client libraries will return an Array of keys and not a single string with space separated keys (that is, split by &quot; &quot; is performed in the client library usually).<h2><a name="See also">See also</a></h2>
-<blockquote>* <a href="RandomkeyCommand.html">RANDOMKEY</a> to get the name of a randomly selected key in O(1).</blockquote></b></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/LastsaveCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LastsaveCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LASTSAVE">LASTSAVE</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LastsaveCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LASTSAVE">LASTSAVE</a></h1>
-<blockquote>Return the UNIX TIME of the last DB save executed with success.A client may check if a <a href="BgsaveCommand.html">BGSAVE</a> command succeeded reading the LASTSAVEvalue, then issuing a <a href="BgsaveCommand.html">BGSAVE</a> command and checking at regular intervalsevery N seconds if LASTSAVE changed.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically an UNIX time stamp.<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="BgsaveCommand.html">BGSAVE</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
41 doc/LindexCommand.html
@@ -1,41 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LindexCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LINDEX _key_ _index_">LINDEX _key_ _index_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LindexCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LINDEX _key_ _index_">LINDEX _key_ _index_</a></h1>
-<i>Time complexity: O(n) (with n being the length of the list)</i><blockquote>Return the specified element of the list stored at the specifiedkey. 0 is the first element, 1 the second and so on. Negative indexesare supported, for example -1 is the last element, -2 the penultimateand so on.</blockquote>
-<blockquote>If the value stored at key is not of list type an error is returned.If the index is out of range an empty string is returned.</blockquote>
-<blockquote>Note that even if the average time complexity is O(n) asking forthe first or the last element of the list is O(1).</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a>, specifically the requested element.<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
41 doc/LlenCommand.html
@@ -1,41 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LlenCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LLEN _key_">LLEN _key_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LlenCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LLEN _key_">LLEN _key_</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Return the length of the list stored at the specified key. If thekey does not exist zero is returned (the same behaviour as forempty lists). If the value stored at <i>key</i> is not a list an error is returned.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
-The length of the list.
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
41 doc/LpopCommand.html
@@ -1,41 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LpopCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LPOP _key_">LPOP _key_</a><br>&nbsp;&nbsp;<a href="#RPOP _key_">RPOP _key_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LpopCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LPOP _key_">LPOP _key_</a></h1>
-<h1><a name="RPOP _key_">RPOP _key_</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Atomically return and remove the first (LPOP) or last (RPOP) elementof the list. For example if the list contains the elements &quot;a&quot;,&quot;b&quot;,&quot;c&quot; LPOPwill return &quot;a&quot; and the list will become &quot;b&quot;,&quot;c&quot;.</blockquote>
-<blockquote>If the <i>key</i> does not exist or the list is already empty the specialvalue 'nil' is returned.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Bulk reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
42 doc/LrangeCommand.html
@@ -1,42 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LrangeCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LRANGE _key_ _start_ _end_">LRANGE _key_ _start_ _end_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LrangeCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LRANGE _key_ _start_ _end_">LRANGE _key_ _start_ _end_</a></h1>
-<i>Time complexity: O(n) (with n being the length of the range)</i><blockquote>Return the specified elements of the list stored at the specifiedkey. Start and end are zero-based indexes. 0 is the first elementof the list (the list head), 1 the next element and so on.</blockquote>
-<blockquote>For example LRANGE foobar 0 2 will return the first three elementsof the list.</blockquote>
-<blockquote>_start_ and <i>end</i> can also be negative numbers indicating offsetsfrom the end of the list. For example -1 is the last element ofthe list, -2 the penultimate element and so on.</blockquote>
-<blockquote>Indexes out of range will not produce an error: if start is overthe end of the list, or start <code name="code" class="python">&gt;</code> end, an empty list is returned.If end is over the end of the list Redis will threat it just likethe last element of the list.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Multi bulk reply</a>, specifically a list of elements in the specified range.<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
41 doc/LremCommand.html
@@ -1,41 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LremCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LREM _key_ _count_ _value_">LREM _key_ _count_ _value_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LremCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LREM _key_ _count_ _value_">LREM _key_ _count_ _value_</a></h1>
-<i>Time complexity: O(N) (with N being the length of the list)</i><blockquote>Remove the first <i>count</i> occurrences of the <i>value</i> element from the list.If <i>count</i> is zero all the elements are removed. If <i>count</i> is negativeelements are removed from tail to head, instead to go from head to tailthat is the normal behaviour. So for example LREM with count -2 and_hello_ as value to remove against the list (a,b,c,hello,x,hello,hello) willlave the list (a,b,c,hello,x). The number of removed elements is returnedas an integer, see below for more information about the returned value.Note that non existing keys are considered like empty lists by LREM, so LREMagainst non existing keys will always return 0.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer Reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
-The number of removed elements if the operation succeeded
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/LsetCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LsetCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LSET _key_ _index_ _value_">LSET _key_ _index_ _value_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LsetCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LSET _key_ _index_ _value_">LSET _key_ _index_ _value_</a></h1>
-<i>Time complexity: O(N) (with N being the length of the list)</i><blockquote>Set the list element at <i>index</i> (see LINDEX for information about the_index_ argument) with the new <i>value</i>. Out of range indexes willgenerate an error. Note that setting the first or last elements ofthe list is O(1).</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
47 doc/LtrimCommand.html
@@ -1,47 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>LtrimCommand: Contents</b><br>&nbsp;&nbsp;<a href="#LTRIM _key_ _start_ _end_">LTRIM _key_ _start_ _end_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">LtrimCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="LTRIM _key_ _start_ _end_">LTRIM _key_ _start_ _end_</a></h1>
-<i>Time complexity: O(n) (with n being len of list - len of range)</i><blockquote>Trim an existing list so that it will contain only the specifiedrange of elements specified. Start and end are zero-based indexes.0 is the first element of the list (the list head), 1 the next elementand so on.</blockquote>
-<blockquote>For example LTRIM foobar 0 2 will modify the list stored at foobarkey so that only the first three elements of the list will remain.</blockquote>
-<blockquote>_start_ and <i>end</i> can also be negative numbers indicating offsetsfrom the end of the list. For example -1 is the last element ofthe list, -2 the penultimate element and so on.</blockquote>
-<blockquote>Indexes out of range will not produce an error: if start is overthe end of the list, or start &gt; end, an empty list is left as value.If end over the end of the list Redis will threat it just likethe last element of the list.</blockquote>
-<blockquote>Hint: the obvious use of LTRIM is together with LPUSH/RPUSH. For example:</blockquote>
-<pre class="codeblock python" name="code">
- LPUSH mylist &lt;someelement&gt;
- LTRIM mylist 0 99
-</pre><blockquote>The above two commands will push elements in the list taking care thatthe list will not grow without limits. This is very useful when usingRedis to store logs for example. It is important to note that when usedin this way LTRIM is an O(1) operation because in the average casejust one element is removed from the tail of the list.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Status code reply</a><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="LlenCommand.html">LLEN</a></li><li> <a href="LrangeCommand.html">LRANGE</a></li><li> <a href="LtrimCommand.html">LTRIM</a></li><li> <a href="LdelCommand.html">LDEL</a></li><li> <a href="LindexCommand.html">LINDEX</a></li><li> <a href="LsetCommand.html">LSET</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
52 doc/MgetCommand.html
@@ -1,52 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>MgetCommand: Contents</b><br>&nbsp;&nbsp;<a href="#MGET _key1_ _key2_ ... _keyN_">MGET _key1_ _key2_ ... _keyN_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Example">Example</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">MgetCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="MGET _key1_ _key2_ ... _keyN_">MGET _key1_ _key2_ ... _keyN_</a></h1>
-<i>Time complexity: O(1) for every key</i><blockquote>Get the values of all the specified keys. If one or more keys dont existor is not of type String, a 'nil' value is returned instead of the valueof the specified key, but the operation never fails.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Multi bulk reply</a><h2><a name="Example">Example</a></h2><pre class="codeblock python" name="code">
-$ ./redis-cli set foo 1000
-+OK
-$ ./redis-cli set bar 2000
-+OK
-$ ./redis-cli mget foo bar
-1. 1000
-2. 2000
-$ ./redis-cli mget foo bar nokey
-1. 1000
-2. 2000
-3. (nil)
-$
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="GetCommand.html">GET</a></li><li> <a href="SetCommand.html">SET</a></li><li> <a href="SetnxCommand.html">SETNX</a></li><li> <a href="IncrCommand.html">INCR</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
63 doc/MonitorCommand.html
@@ -1,63 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>MonitorCommand: Contents</b><br>&nbsp;&nbsp;<a href="#MONITOR">MONITOR</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">MonitorCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="MONITOR">MONITOR</a></h1><blockquote>MONITOR is a debugging command that outputs the whole sequence of commandsreceived by the Redis server. is very handy in order to understandwhat is happening into the database. This command is used directlyvia telnet.</blockquote>
-<pre class="codeblock python" name="code">
-% telnet 127.0.0.1 6379
-Trying 127.0.0.1...
-Connected to segnalo-local.com.
-Escape character is '^]'.
-MONITOR
-+OK
-monitor
-keys *
-dbsize
-set x 6
-foobar
-get x
-del x
-get x
-set key_x 5
-hello
-set key_y 5
-hello
-set key_z 5
-hello
-set foo_a 5
-hello
-</pre><blockquote>The ability to see all the requests processed by the server is useful in orderto spot bugs in the application both when using Redis as a database and asa distributed caching system.</blockquote>
-<blockquote>In order to end a monitoring session just issue a QUIT command by hand.</blockquote>
-<h2><a name="Return value">Return value</a></h2><b>Non standard return value</b>, just dumps the received commands in an infinite flow.<h2><a name="See also">See also</a></h2>
-<ul><li> <a href="InfoCommand.html">INFO</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
42 doc/MoveCommand.html
@@ -1,42 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>MoveCommand: Contents</b><br>&nbsp;&nbsp;<a href="#MOVE _key_ _dbindex_">MOVE _key_ _dbindex_</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">MoveCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="MOVE _key_ _dbindex_">MOVE _key_ _dbindex_</a></h1>
-<blockquote>Move the specified key from the currently selected DB to the specifieddestination DB. Note that this command returns 1 only if the key wassuccessfully moved, and 0 if the target key was already there or if thesource key was not found at all, so it is possible to use MOVE as a lockingprimitive.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href="ReplyTypes.html">Integer reply</a>, specifically:<br/><br/><pre class="codeblock python" name="code">
-1 if the key was moved
-0 if the key was not moved because already present on the target DB or was not found in the current DB.
-</pre><h2><a name="See also">See also</a></h2>
-<ul><li> <a href="SelectCommand.html">SELECT</a></li><li> <a href="RenameCommand.html">RENAME</a></li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
119 doc/ProtocolSpecification.html
@@ -1,119 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>ProtocolSpecification: Contents</b><br>&nbsp;&nbsp;<a href="#Protocol Specification">Protocol Specification</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Networking layer">Networking layer</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Simple INLINE commands">Simple INLINE commands</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Bulk commands">Bulk commands</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Bulk replies">Bulk replies</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Multi-Bulk replies">Multi-Bulk replies</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Nil elements in Multi-Bulk replies">Nil elements in Multi-Bulk replies</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Single line reply">Single line reply</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Integer reply">Integer reply</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Multiple commands and pipelining">Multiple commands and pipelining</a>
- </div>
-
- <h1 class="wikiname">ProtocolSpecification</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Protocol Specification">Protocol Specification</a></h1>The Redis protocol is a compromise between being easy to parse by a computer
-and being easy to parse by an human. Before reading this section you are
-strongly encouraged to read the &quot;REDIS TUTORIAL&quot; section of this README in order
-to get a first feeling of the protocol playing with it by TELNET.<h2><a name="Networking layer">Networking layer</a></h2>A client connects to a Redis server creating a TCP connection to the port 6379.
-Every redis command or data transmitted by the client and the server is
-terminated by &quot;\r\n&quot; (CRLF).<h2><a name="Simple INLINE commands">Simple INLINE commands</a></h2>The simplest commands are the inline commands. This is an example of a
-server/client chat (the server chat starts with S:, the client chat with C:)<br/><br/><pre class="codeblock python" name="code">
-C: PING
-S: +PONG
-</pre>An inline command is a CRLF-terminated string sent to the client. The server can reply to commands in different ways:
-<ul><li> With an error message (the first byte of the reply will be &quot;-&quot;)</li><li> With a single line reply (the first byte of the reply will be &quot;+)</li><li> With bulk data (the first byte of the reply will be &quot;$&quot;)</li><li> With multi-bulk data, a list of values (the first byte of the reply will be &quot;<code name="code" class="python">*</code>&quot;)</li><li> With an integer number (the first byte of the reply will be &quot;:&quot;)</li></ul>
-The following is another example of an INLINE command returning an integer:<br/><br/><pre class="codeblock python python" name="code">
-C: EXISTS somekey
-S: :0
-</pre>Since 'somekey' does not exist the server returned ':0'.<br/><br/>Note that the EXISTS command takes one argument. Arguments are separated
-simply by spaces.<h2><a name="Bulk commands">Bulk commands</a></h2>A bulk command is exactly like an inline command, but the last argument
-of the command must be a stream of bytes in order to send data to the server.
-the &quot;SET&quot; command is a bulk command, see the following example:<br/><br/><pre class="codeblock python python python" name="code">
-C: SET mykey 6
-C: foobar
-S: +OK
-</pre>The last argument of the commnad is '6'. This specify the number of DATA
-bytes that will follow (note that even this bytes are terminated by two
-additional bytes of CRLF).<br/><br/>All the bulk commands are in this exact form: instead of the last argument
-the number of bytes that will follow is specified, followed by the bytes,
-and CRLF. In order to be more clear for the programmer this is the string
-sent by the client in the above sample:<br/><br/><blockquote>&quot;SET mykey 6\r\nfoobar\r\n&quot;</blockquote>
-<h2><a name="Bulk replies">Bulk replies</a></h2>The server may reply to an inline or bulk command with a bulk reply. See
-the following example:<br/><br/><pre class="codeblock python python python python" name="code">
-C: GET mykey
-S: $6
-S: foobar
-</pre>A bulk reply is very similar to the last argument of a bulk command. The
-server sends as the first line a &quot;$&quot; byte followed by the number of bytes
-of the actual reply followed by CRLF, then the bytes are sent followed by
-additional two bytes for the final CRLF. The exact sequence sent by the
-server is:<br/><br/><blockquote>&quot;$6\r\nfoobar\r\n&quot;</blockquote>
-If the requested value does not exist the bulk reply will use the special
-value -1 as data length, example:<br/><br/><pre class="codeblock python python python python python" name="code">
-C: GET nonexistingkey
-S: $-1
-</pre>The client library API should not return an empty string, but a nil object, when the requested object does not exist.
-For example a Ruby library should return 'nil' while a C library should return
-NULL, and so forth.<h2><a name="Multi-Bulk replies">Multi-Bulk replies</a></h2>Commands similar to LRANGE needs to return multiple values (every element
-of the list is a value, and LRANGE needs to return more than a single element). This is accomplished using multiple bulk writes,
-prefixed by an initial line indicating how many bulk writes will follow.
-The first byte of a multi bulk reply is always <code name="code" class="python">*</code>. Example:<br/><br/><pre class="codeblock python python python python python python" name="code">
-C: LRANGE mylist 0 3
-S: *4
-S: $3
-S: foo
-S: $3
-S: bar
-S: $5
-S: Hello
-S: $5
-S: World
-</pre>The first line the server sent is &quot;<b>4\r\n&quot; in order to specify that four bulk
-write will follow. Then every bulk write is transmitted.<br/><br/>If the specified key does not exist instead of the number of elements in the
-list, the special value -1 is sent as count. Example:<br/><br/><pre class="codeblock python python python python python python python" name="code">
-C: LRANGE nokey 0 1
-S: *-1
-</pre>A client library API SHOULD return a nil object and not an empty list when this
-happens. This makes possible to distinguish between empty list and non existing ones.<h2><a name="Nil elements in Multi-Bulk replies">Nil elements in Multi-Bulk replies</a></h2>Single elements of a multi bulk reply may have -1 length, in order to signal that this elements are missing and not empty strings. This can happen with the SORT command when used with the GET <i>pattern</i> option when the specified key is missing. Example of a multi bulk reply containing an empty element:<br/><br/><pre class="codeblock python python python python python python python python" name="code">
-S: *3
-S: $3
-S: foo
-S: $-1
-S: $3
-S: bar
-</pre>The second element is nul. The client library should return something like this:<br/><br/><pre class="codeblock python python python python python python python python python" name="code">
-[&quot;foo&quot;,nil,&quot;bar&quot;]
-</pre><h2><a name="Single line reply">Single line reply</a></h2>As already seen a single line reply is in the form of a single line string
-starting with &quot;+&quot; terminated by &quot;\r\n&quot;. For example:<br/><br/><pre class="codeblock python python python python python python python python python python" name="code">
-+OK
-</pre>The client library should return everything after the &quot;+&quot;, that is, the string &quot;OK&quot; in the example.<br/><br/>The following commands reply with a status code reply:
-PING, SET, SELECT, SAVE, BGSAVE, SHUTDOWN, RENAME, LPUSH, RPUSH, LSET, LTRIM<h2><a name="Integer reply">Integer reply</a></h2>This type of reply is just a CRLF terminated string representing an integer, prefixed by a &quot;:&quot; byte. For example &quot;:0\r\n&quot;, or &quot;:1000\r\n&quot; are integer replies.<br/><br/>With commands like INCR or LASTSAVE using the integer reply to actually return a value there is no special meaning for the returned integer. It is just an incremental number for INCR, a UNIX time for LASTSAVE and so on.<br/><br/>Some commands like EXISTS will return 1 for true and 0 for false.<br/><br/>Other commands like SADD, SREM and SETNX will return 1 if the operation was actually done, 0 otherwise.<br/><br/>The following commands will reply with an integer reply: SETNX, DEL, EXISTS, INCR, INCRBY, DECR, DECRBY, DBSIZE, LASTSAVE, RENAMENX, MOVE, LLEN, SADD, SREM, SISMEMBER, SCARD<h2><a name="Multiple commands and pipelining">Multiple commands and pipelining</a></h2>A client can use the same connection in order to issue multiple commands.
-Pipelining is supported so multiple commands can be sent with a single
-write operation by the client, it is not needed to read the server reply
-in order to issue the next command. All the replies can be read at the end.<br/><br/>Usually Redis server and client will have a very fast link so this is not
-very important to support this feature in a client implementation, still
-if an application needs to issue a very large number of commands in short
-time to use pipelining can be much faster.
-</b>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
51 doc/QuickStart.html
@@ -1,51 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>QuickStart: Contents</b><br>&nbsp;&nbsp;<a href="#Quick Start">Quick Start</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Obtaining the latest version of Redis">Obtaining the latest version of Redis</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Compiling Redis">Compiling Redis</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Running Redis">Running Redis</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Testing Redis">Testing Redis</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Further reading">Further reading</a>
- </div>
-
- <h1 class="wikiname">QuickStart</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Quick Start">Quick Start</a></h1>This quickstart is a five minutes howto on how to get started with Redis. For more information on Redis check <a href="http://code.google.com/p/redis/wiki/index" target="_blank">Redis Documentation Index</a>.<h2><a name="Obtaining the latest version of Redis">Obtaining the latest version of Redis</a></h2>The latest stable source distribution of Redis can be obtained <a href="http://code.google.com/p/redis/downloads/list" target="_blank">at this location as a tarball</a>. The unstable source code, with more features but not ready for production, can be downloaded using git:<br/><br/><pre class="codeblock python" name="code">
-git clone git://github.com/antirez/redis.git
-</pre><h2><a name="Compiling Redis">Compiling Redis</a></h2>Redis can be compiled in most POSIX systems, but the development targets mainly Linux, Mac OS X, FreeBSD and OpenBSD. Solaris is currently not supported and there are no short-term plans to support it.<br/><br/>To compile Redis just untar the tar.gz, enter the directly and type 'make'.<br/><br/><pre class="codeblock python python" name="code">
-tar xvzf redis-1.0.0.tar.gz
-cd redis-1.0.0
-make
-</pre>In order to test if the Redis server is working well in your computer make sure to run <code name="code" class="python">make test</code>and check that all the tests are passed.<h2><a name="Running Redis">Running Redis</a></h2>Redis can run just fine without a configuration file (when executed without a config file a standard configuration is used). To run Redis just type the following command:<br/><br/><pre class="codeblock python python python" name="code">
-./redis-server
-</pre>With the default configuration Redis will log to the standard output so you can check what happens. Later, when you'll ready to install Redis in production, you may want to use a configuration file. The <code name="code" class="python">redis.conf</code> file included in the source code distribution is a starting point, you should be able to modify it in order do adapt it to your needs without troubles reading the comments inside the file. In order to start Redis using a configuration file just pass the file name as the sole argument when starting the server:<br/><br/><pre class="codeblock python python python python" name="code">
-./redis-server redis.conf
-</pre><h2><a name="Testing Redis">Testing Redis</a></h2>To check if the server is working correctly you can use the <code name="code" class="python">redis-cli</code> utility included in the source distribution (and automatically compiled when you compile Redis). For instance to set a key and read back the value use the following:<br/><br/><pre class="codeblock python python python python python" name="code">
-./redis-cli set mykey somevalue
-OK
-./redis-cli get mykey
-somevalue
-</pre><h2><a name="Further reading">Further reading</a></h2><ul><li> To know more about Redis check the <a href="README.html">Readme</a> file.</li><li> Read the full list of available commands in the <a href="CommandReference.html">Command Reference</a>.</li><li> To get started with the Redis replication read the <a href="ReplicationHowto.html">Replication Howto</a>.</li></ul>
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
38 doc/QuitCommand.html
@@ -1,38 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>QuitCommand: Contents</b><br>&nbsp;&nbsp;<a href="#Quit">Quit</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a>
- </div>
-
- <h1 class="wikiname">QuitCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Quit">Quit</a></h1><blockquote>Ask the server to silently close the connection.</blockquote>
-<h2><a name="Return value">Return value</a></h2>None. The connection is closed as soon as the QUIT command is received.
-
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
110 doc/README.html
@@ -1,110 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>README: Contents</b><br>&nbsp;&nbsp;<a href="#Introduction">Introduction</a><br>&nbsp;&nbsp;<a href="#Beyond key-value databases">Beyond key-value databases</a><br>&nbsp;&nbsp;<a href="#What are the differences between Redis and Memcached?">What are the differences between Redis and Memcached?</a><br>&nbsp;&nbsp;<a href="#What are the differences between Redis and Tokyo Cabinet / Tyrant?">What are the differences between Redis and Tokyo Cabinet / Tyrant?</a><br>&nbsp;&nbsp;<a href="#Does Redis support locking?">Does Redis support locking?</a><br>&nbsp;&nbsp;<a href="#Multiple databases support">Multiple databases support</a><br>&nbsp;&nbsp;<a href="#Redis Data Types">Redis Data Types</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Implementation Details">Implementation Details</a><br>&nbsp;&nbsp;<a href="#Redis Tutorial">Redis Tutorial</a><br>&nbsp;&nbsp;<a href="#License">License</a><br>&nbsp;&nbsp;<a href="#Credits">Credits</a>
- </div>
-
- <h1 class="wikiname">README</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="Introduction">Introduction</a></h1>Redis is a database. To be more specific redis is a very simple database
-implementing a dictionary where keys are associated with values. For example
-I can set the key &quot;surname_1992&quot; to the string &quot;Smith&quot;. The interesting thing about Redis is that values associated to keys are not limited to simple strings, they can also be lists and sets, with a <a href="CommandReference.html">number of server-side atomic operations</a> associated to this data types.<br/><br/>Redis takes the whole dataset in memory, but the dataset is persistent
-since from time to time Redis writes a dump of the dataset on disk asynchronously. The dump is loaded every time the server is restarted.<br/><br/>Redis can be configured to save the dataset after a given number of seconds elapzed and changes to the data set. For example you can tell Redis to save after 1000 changes and at least 60 seconds sinde the same save. You can specify a number of this combinatins.<br/><br/>Because data is written asynchronously, If a system crash occurs the last few queries can get lost (that is acceptable in many applications). Redis supports master-slave replication from the early days in order to make this a non issue if your application is of the kind where even few lost records are not acceptable.<h1><a name="Beyond key-value databases">Beyond key-value databases</a></h1>In most key-value databases keys and values are simple strings. In Redis keys are just strings too, but the associated values can be Strings, Lists and Sets, and there are commands to perform complex atomic operations against this data types, so you can think at Redis as a data structures server.<br/><br/>For example you can append elements to a list stored at the key &quot;mylist&quot; using the LPUSH or RPUSH operation in O(1). Later you'll be able to get a range of elements with LRANGE or trim the list with LTRIM. Sets are very flexible too, it is possible to add and remove elements from Sets (unsorted collections of strings), and then ask for server-side intersection, union, difference of Sets.<br/><br/>All this features, the support for sorting Lists and Sets, allow to use Redis as the sole DB for your scalable application without the need of any relational database. <a href="TwitterAlikeExample.html">We wrote a simple Twitter clone in PHP + Redis</a> to show a real world example, the link points to an article explaining the design and internals in very simple words.<h1><a name="What are the differences between Redis and Memcached?">What are the differences between Redis and Memcached?</a></h1>In the following ways:<br/><br/><ul><li> Memcached is not persistent, it just holds everything in memory without saving since its main goal is to be used as a cache. Redis instead can be used as the main DB for the application. We <a href="TwitterAlikeExample.html">wrote a simple Twitter clone</a> using only Redis as database.</li></ul>
-<ul><li> Like memcached Redis uses a key-value model, but while keys can just be strings, values in Redis can be lists and sets, and complex operations like intersections, set/get n-th element of lists, pop/push of elements, can be performed against sets and lists. It is possible to use lists as message queues.</li></ul>
-<h1><a name="What are the differences between Redis and Tokyo Cabinet / Tyrant?">What are the differences between Redis and Tokyo Cabinet / Tyrant?</a></h1>Redis and Tokyo Cabinet can be used for the same applications, but actually they are <b>very</b> different beasts. If you read twitter messages of people involved in scalable things both products are reported to work well, but surely there are times where one or the other can be the best choice. Some differences are the followings (I may be biased, make sure to check yourself both the products).<br/><br/><ul><li> Tokyo Cabinet writes synchronously on disk, Redis takes the whole dataset on memory and writes on disk asynchronously. Tokyo Cabinet is safer and probably a better idea if your dataset is going to be bigger than RAM, but Redis is faster (note that Redis supports master-slave replication that is trivial to setup, so you are safe anyway if you want a setup where data can't be lost even after a disaster).</li></ul>
-<ul><li> Redis supports higher level operations and data structures. Tokyo Cabinet supports a kind of database that is able to organize data into rows with named fields (in a way very similar to Berkeley DB) but can't do things like server side List and Set operations Redis is able to do: pushing or popping from Lists in an atomic way, in O(1) time complexity, server side Set intersections, <a href="SORT.html">SortCommand</a> ing of schema free data in complex ways (Btw TC supports sorting in the table-based database format). Redis on the other hand does not support the abstraction of tables with fields, the idea is that you can build this stuff in software easily if you really need a table-alike approach.</li></ul>
-<ul><li> Tokyo Cabinet does not implement a networking layer. You have to use a networking layer called Tokyo Tyrant that interfaces to Tokyo Cabinet so you can talk to Tokyo Cabinet in a client-server fashion. In Redis the networking support is built-in inside the server, and is basically the only interface between the external world and the dataset.</li></ul>
-<ul><li> Redis is reported to be much faster, especially if you plan to access Tokyo Cabinet via Tokyo Tyrant. Here I can only say that with Redis you can expect 100,000 operations/seconds with a normal Linux box and 50 concurrent clients. You should test Redis, Tokyo, and the other alternatives with your specific work load to get a feeling about performances for your application.</li></ul>
-<ul><li> Redis is (IMHO) generally an higher level and simpler to use beast in the operations supported, and to get started. <a href="Check.html">the command reference CommandReference</a> to get a feeling. You can even start playing with Redis by telnet after reading the five minutes tutorial at the end of this README file. To implement new client libraries is trivial. <a href="Check.html">the protocol specification ProtocolSpecification</a> for more information.</li></ul><blockquote></blockquote><ul><li> Redis is not an on-disk DB engine like Tokyo: the latter can be used as a fast DB engine in your C project without the networking overhead just linking to the library. Still in many scalable applications you need multiple servers talking with multiple clients, so the client-server model is almost always needed, this is why in Redis this is built-in.</li></ul>
-<h1><a name="Does Redis support locking?">Does Redis support locking?</a></h1>No, the idea is to provide atomic primitives in order to make the programmer
-able to use redis with locking free algorithms. For example imagine you have
-10 computers and one Redis server. You want to count words in a very large text.
-This large text is split among the 10 computers, every computer will process
-its part and use Redis's INCR command to atomically increment a counter
-for every occurrence of the word found.<br/><br/>INCR/DECR are not the only atomic primitives, there are others like PUSH/POP
-on lists, POP RANDOM KEY operations, UPDATE and so on. For example you can
-use Redis like a Tuple Space (<a href="http://en.wikipedia.org/wiki/Tuple_space" target="_blank">http://en.wikipedia.org/wiki/Tuple_space</a>) in
-order to implement distributed algorithms.<br/><br/>(News: locking with key-granularity is now planned)<h1><a name="Multiple databases support">Multiple databases support</a></h1>Another synchronization primitive is the support for multiple DBs. By default DB 0 is selected for every new connection, but using the SELECT command it is possible to select a different database. The MOVE operation can move an item from one DB to another atomically. This can be used as a base for locking free algorithms together with the 'RANDOMKEY' commands.<h1><a name="Redis Data Types">Redis Data Types</a></h1>Redis supports the following three data types as values:<br/><br/><ul><li> Strings: just any sequence of bytes. Redis strings are binary safe so they can not just hold text, but images, compressed data and everything else.</li><li> Lists: lists of strings, with support for operations like append a new string on head, on tail, list length, obtain a range of elements, truncate the list to a given length, sort the list, and so on.</li><li> Sets: an unsorted set of strings. It is possible to add or delete elements from a set, to perform set intersection, union, subtraction, and so on.</li></ul>
-Values can be Strings, Lists or Sets. Keys can be a subset of strings not containing newlines (&quot;\n&quot;) and spaces (&quot; &quot;).<br/><br/>Note that sometimes strings may hold numeric vaules that must be parsed by
-Redis. An example is the INCR command that atomically increments the number
-stored at the specified key. In this case Redis is able to handle integers
-that can be stored inside a 'long long' type, that is a 64-bit signed integer.<h2><a name="Implementation Details">Implementation Details</a></h2>Strings are implemented as dynamically allocated strings of characters.
-Lists are implemented as doubly linked lists with cached length.
-Sets are implemented using hash tables that use chaining to resolve collisions.<h1><a name="Redis Tutorial">Redis Tutorial</a></h1>(note, you can skip this section if you are only interested in &quot;formal&quot; doc.)<br/><br/>Later in this document you can find detailed information about Redis commands,
-the protocol specification, and so on. This kind of documentation is useful
-but... if you are new to Redis it is also BORING! The Redis protocol is designed
-so that is both pretty efficient to be parsed by computers, but simple enough
-to be used by humans just poking around with the 'telnet' command, so this
-section will show to the reader how to play a bit with Redis to get an initial
-feeling about it, and how it works.<br/><br/>To start just compile redis with 'make' and start it with './redis-server'.
-The server will start and log stuff on the standard output, if you want
-it to log more edit redis.conf, set the loglevel to debug, and restart it.<br/><br/>You can specify a configuration file as unique parameter:<br/><br/><blockquote>./redis-server /etc/redis.conf</blockquote>
-This is NOT required. The server will start even without a configuration file
-using a default built-in configuration.<br/><br/>Now let's try to set a key to a given value:<br/><br/><pre class="codeblock python" name="code">
-$ telnet localhost 6379
-Trying 127.0.0.1...
-Connected to localhost.
-Escape character is '^]'.
-SET foo 3
-bar
-+OK
-</pre>The first line we sent to the server is &quot;set foo 3&quot;. This means &quot;set the key
-foo with the following three bytes I'll send you&quot;. The following line is
-the &quot;bar&quot; string, that is, the three bytes. So the effect is to set the
-key &quot;foo&quot; to the value &quot;bar&quot;. Very simple!<br/><br/>(note that you can send commands in lowercase and it will work anyway,
-commands are not case sensitive)<br/><br/>Note that after the first and the second line we sent to the server there
-is a newline at the end. The server expects commands terminated by &quot;\r\n&quot;
-and sequence of bytes terminated by &quot;\r\n&quot;. This is a minimal overhead from
-the point of view of both the server and client but allows us to play with
-Redis with the telnet command easily.<br/><br/>The last line of the chat between server and client is &quot;+OK&quot;. This means
-our key was added without problems. Actually SET can never fail but
-the &quot;+OK&quot; sent lets us know that the server received everything and
-the command was actually executed.<br/><br/>Let's try to get the key content now:<br/><br/><pre class="codeblock python python" name="code">
-GET foo
-$3
-bar
-</pre>Ok that's very similar to 'set', just the other way around. We sent &quot;get foo&quot;,
-the server replied with a first line that is just the $ character follwed by
-the number of bytes the value stored at key contained, followed by the actual
-bytes. Again &quot;\r\n&quot; are appended both to the bytes count and the actual data. In Redis slang this is called a bulk reply.<br/><br/>What about requesting a non existing key?<br/><br/><pre class="codeblock python python python" name="code">
-GET blabla
-$-1
-</pre>When the key does not exist instead of the length, just the &quot;$-1&quot; string is sent. Since a -1 length of a bulk reply has no meaning it is used in order to specifiy a 'nil' value and distinguish it from a zero length value. Another way to check if a given key exists or not is indeed the EXISTS command:<br/><br/><pre class="codeblock python python python python" name="code">
-EXISTS nokey
-:0
-EXISTS foo
-:1
-</pre>As you can see the server replied ':0' the first time since 'nokey' does not
-exist, and ':1' for 'foo', a key that actually exists. Replies starting with the colon character are integer reply.<br/><br/>Ok... now you know the basics, read the <a href="CommandReference.html">REDIS COMMAND REFERENCE</a> section to
-learn all the commands supported by Redis and the <a href="ProtocolSpecification.html">PROTOCOL SPECIFICATION</a>
-section for more details about the protocol used if you plan to implement one
-for a language missing a decent client implementation.<h1><a name="License">License</a></h1>Redis is released under the BSD license. See the COPYING file for more information.<h1><a name="Credits">Credits</a></h1>Redis is written and maintained by Salvatore Sanfilippo, Aka 'antirez'.<br/><br/>Enjoy,
-antirez
-
- </div>
-
- </div>
- </div>
- </body>
-</html>
-
View
39 doc/RandomkeyCommand.html
@@ -1,39 +0,0 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
-<html>
- <head>
- <link type="text/css" rel="stylesheet" href="style.css" />
- </head>
- <body>
- <div id="page">
-
- <div id='header'>
- <a href="index.html">
- <img style="border:none" alt="Redis Documentation" src="redis.png">
- </a>
- </div>
-
- <div id="pagecontent">
- <div class="index">
-<!-- This is a (PRE) block. Make sure it's left aligned or your toc title will be off. -->
-<b>RandomkeyCommand: Contents</b><br>&nbsp;&nbsp;<a href="#RANDOMKEY">RANDOMKEY</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#Return value">Return value</a><br>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#See also">See also</a>
- </div>
-
- <h1 class="wikiname">RandomkeyCommand</h1>
-
- <div class="summary">
-
- </div>
-
- <div class="narrow">
- <h1><a name="RANDOMKEY">RANDOMKEY</a></h1>
-<i>Time complexity: O(1)</i><blockquote>Return a randomly selected key from the currently selected DB.</blockquote>
-<h2><a name="Return value">Return value</a></h2><a href=