Skip to content

Commit

Permalink
Typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
djanowski committed Jun 6, 2011
1 parent cb90dc1 commit d94afe3
Show file tree
Hide file tree
Showing 29 changed files with 173 additions and 108 deletions.
9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -49,7 +49,7 @@ backticks. For example: <code>`INCR`</code>.
example: `@multi-bulk-reply`. These keywords will get expanded and
auto-linked to relevant parts of the documentation.

There should be at least three pre-defined sections: time complexity,
There should be at least three predefined sections: time complexity,
description and return value. These sections are marked using magic
keywords, too:

Expand Down Expand Up @@ -83,3 +83,10 @@ files compile properly. You can do this by running Rake inside your
working directory.

$ rake

Additionally, if you have [Aspell](http://aspell.net/) installed, you
can spell check the documentation:

$ rake spellcheck

Exceptions can be added to `./wordlist`.
28 changes: 27 additions & 1 deletion Rakefile
@@ -1,4 +1,4 @@
task :default => :parse
task :default => [:parse, :spellcheck]

task :parse do
require "json"
Expand All @@ -13,3 +13,29 @@ task :parse do
end
end
end

task :spellcheck do
require "json"

`mkdir -p tmp`

IO.popen("aspell --lang=en create master ./tmp/dict", "w") do |io|
io.puts(JSON.parse(File.read("commands.json")).keys.map(&:split).flatten.join("\n"))
io.puts(File.read("wordlist"))
end

Dir["**/*.md"].each do |file|
command = %q{
ruby -pe 'gsub /^ .*$/, ""' |
ruby -pe 'gsub /`[^`]+`/, ""' |
ruby -e 'puts $stdin.read.gsub /\[([^\]]+)\]\(([^\)]+)\)/m, "\\1"' |
aspell -H -a --extra-dicts=./tmp/dict 2>/dev/null
}

words = `cat '#{file}' | #{command}`.lines.map do |line|
line[/^& ([^ ]+)/, 1]
end.compact

puts "#{file}: #{words.uniq.sort.join(" ")}" if words.any?
end
end
2 changes: 1 addition & 1 deletion commands/auth.md
Expand Up @@ -2,7 +2,7 @@

Request for authentication in a password protected Redis server.
Redis can be instructed to require a password before allowing clients
to execute commands. This is done using the _requirepass_ directive in the
to execute commands. This is done using the `requirepass` directive in the
configuration file.

If `password` matches the password in the configuration file, the server replies with
Expand Down
4 changes: 2 additions & 2 deletions commands/config get.md
Expand Up @@ -4,7 +4,7 @@ Not applicable.

@description

The CONFIG GET ommand is used to read the configuration parameters of a running
The `CONFIG GET` command is used to read the configuration parameters of a running
Redis server. Not all the configuration parameters are supported.
The symmetric command used to alter the configuration at run time is
`CONFIG SET`.
Expand All @@ -22,7 +22,7 @@ list of key-value pairs. Example:
6) "512"

You can obtain a list of all the supported configuration parameters typing
`CONFIG GET *` in an open redis-cli prompt.
`CONFIG GET *` in an open `redis-cli` prompt.

All the supported parameters have the same meaning of the equivalent
configuration parameter used in the [redis.conf](http://github.com/antirez/redis/raw/2.2/redis.conf) file, with the following important differences:
Expand Down
4 changes: 2 additions & 2 deletions commands/info.md
Expand Up @@ -23,8 +23,8 @@ All the fields are in the form of `field:value` terminated by `\r\n`.
## Notes

* `used_memory` is the total number of bytes allocated by Redis using its
allocator (either standard libc malloc, or an alternative allocator such as
[tcmalloc][1]
allocator (either standard `libc` `malloc`, or an alternative allocator such as
[`tcmalloc`][1]

* `used_memory_rss` is the number of bytes that Redis allocated as seen by the
operating system. Optimally, this number is close to `used_memory` and there
Expand Down
2 changes: 1 addition & 1 deletion commands/lrem.md
Expand Up @@ -10,7 +10,7 @@ following ways:
* `count < 0`: Remove elements equal to `value` moving from tail to head.
* `count = 0`: Remove all elements equal to `value`.

For example, `LREM list -2 "hello"` will remove the last two occurances of
For example, `LREM list -2 "hello"` will remove the last two occurrences of
`"hello"` in the list stored at `list`.

Note that non-existing keys are treated like empty lists, so when `key` does
Expand Down
2 changes: 1 addition & 1 deletion commands/move.md
Expand Up @@ -3,7 +3,7 @@
O(1)


Move `key` from the currently selected database (see `SELECT`) to the speficied
Move `key` from the currently selected database (see `SELECT`) to the specified
destination database. When `key` already exists in the destination database, or
it does not exist in the source database, it does nothing. It is possible to
use `MOVE` as a locking primitive because of this.
Expand Down
4 changes: 2 additions & 2 deletions commands/rpoplpush.md
Expand Up @@ -45,13 +45,13 @@ from the backup list using the `LREM` command when the message was correctly
processed.

Another process (that we call _Helper_), can monitor the backup list to check for
timed out entries to repush against the main queue.
timed out entries to re-push against the main queue.

## Design pattern: server-side O(N) list traversal

Using `RPOPLPUSH` with the same source and destination key, a process can
visit all the elements of an N-elements list in O(N) without transferring
the full list from the server to the client in a single `LRANGE` operation.
Note that a process can traverse the list even while other processes
are actively `RPUSH`-ing against the list, and still no element will be skipped.
are actively pushing to the list, and still no element will be skipped.

2 changes: 1 addition & 1 deletion commands/setbit.md
Expand Up @@ -15,7 +15,7 @@ bits are set to 0.
**Warning**: When setting the last possible bit (_offset_ equal to 2^32 -1) and
the string value stored at _key_ does not yet hold a string value, or holds a
small string value, Redis needs to allocate all intermediate memory which can
block the server for some time. On a 2010 Macbook Pro, setting bit number
block the server for some time. On a 2010 MacBook Pro, setting bit number
2^32 -1 (512MB allocation) takes ~300ms, setting bit number 2^30 -1 (128MB
allocation) takes ~80ms, setting bit number 2^28 -1 (32MB allocation) takes
~30ms and setting bit number 2^26 -1 (8MB allocation) takes ~8ms. Note that
Expand Down
4 changes: 2 additions & 2 deletions commands/setrange.md
@@ -1,7 +1,7 @@
@complexity

O(1), not counting the time taken to copy the new string in place. Usually,
this string is very small so the amortized complexity is O(1). Otheriwse,
this string is very small so the amortized complexity is O(1). Otherwise,
complexity is O(M) with M being the length of the _value_ argument.

Overwrites part of the string stored at _key_, starting at the specified
Expand All @@ -18,7 +18,7 @@ can use multiple keys.
**Warning**: When setting the last possible byte and the string value stored at
_key_ does not yet hold a string value, or holds a small string value, Redis
needs to allocate all intermediate memory which can block the server for some
time. On a 2010 Macbook Pro, setting byte number 536870911 (512MB allocation)
time. On a 2010 MacBook Pro, setting byte number 536870911 (512MB allocation)
takes ~300ms, setting byte number 134217728 (128MB allocation) takes ~80ms,
setting bit number 33554432 (32MB allocation) takes ~30ms and setting bit
number 8388608 (8MB allocation) takes ~8ms. Note that once this first
Expand Down
8 changes: 4 additions & 4 deletions commands/sort.md
Expand Up @@ -16,15 +16,15 @@ large to small, use the `!DESC` modifier:

SORT mylist DESC

When `mylist` contains string values and you want to sort them lexographically,
When `mylist` contains string values and you want to sort them lexicographically,
use the `!ALPHA` modifier:

SORT mylist ALPHA

Redis is UTF-8 aware, assuming you correctly set the `!LC_COLLATE` environment
variable.

The number of returned elementes can be limited using the `!LIMIT` modifier.
The number of returned elements can be limited using the `!LIMIT` modifier.
This modifier takes the `offset` argument, specifying the number of elements to
skip and the `count` argument, specifying the number of elements to return from
starting at `offset`. The following example will return 10 elements of the
Expand All @@ -33,7 +33,7 @@ sorted version of `mylist`, starting at element 0 (`offset` is zero-based):
SORT mylist LIMIT 0 10

Almost all modifiers can be used together. The following example will return
the first 5 elements, lexographically sorted in descending order:
the first 5 elements, lexicographically sorted in descending order:

SORT mylist LIMIT 0 5 ALPHA DESC

Expand All @@ -56,7 +56,7 @@ element in the list (`1`, `2` and `3` in this example).

## Skip sorting the elements

The `!BY` option can also take a nonexisting key, which causes `SORT` to skip
The `!BY` option can also take a non-existent key, which causes `SORT` to skip
the sorting operation. This is useful if you want to retrieve external keys
(see the `!GET` option below) without the overhead of sorting.

Expand Down
2 changes: 1 addition & 1 deletion commands/subscribe.md
Expand Up @@ -4,6 +4,6 @@ O(N) where N is the number of channels to subscribe to.

Subscribes the client to the specified channels.

Once the client enters the subscripted state it is not supposed to issue
Once the client enters the subscribed state it is not supposed to issue
any other commands, expect for additional `SUBSCRIBE`, `PSUBSCRIBE`,
`UNSUBSCRIBE` and `PUNSUBSCRIBE` commands.
2 changes: 1 addition & 1 deletion commands/zrevrangebyscore.md
Expand Up @@ -9,7 +9,7 @@ and `min` (including elements with score equal to `max` or `min`). In contrary
to the default ordering of sorted sets, for this command the elements are
considered to be ordered from high to low scores.

The elements having the same score are returned in reverse lexographical order.
The elements having the same score are returned in reverse lexicographical order.

Apart from the reversed ordering, `ZREVRANGEBYSCORE` is similar to
`ZRANGEBYSCORE`.
Expand Down
6 changes: 3 additions & 3 deletions topics/benchmarks.md
Expand Up @@ -7,7 +7,7 @@ against a Linux box.

* The test was done with 50 simultaneous clients performing 100000 requests.
* The value SET and GET is a 256 bytes string.
* The Linux box is running *Linux 2.6*, it's *Xeon X3320 2.5Ghz*.
* The Linux box is running *Linux 2.6*, it's *Xeon X3320 2.5 GHz*.
* Text executed using the loopback interface (127.0.0.1).

Results: *about 110000 SETs per second, about 81000 GETs per second.*
Expand Down Expand Up @@ -97,7 +97,7 @@ GETs may be slower with big payloads). The same for the number of clients, from
a bit slower.

You can expect different results from different boxes. For example a low
profile box like *Intel core duo T5500 clocked at 1.66Ghz running Linux 2.6*
profile box like *Intel core duo T5500 clocked at 1.66 GHz running Linux 2.6*
will output the following:

$ ./redis-benchmark -q -n 100000
Expand All @@ -107,7 +107,7 @@ will output the following:
LPUSH: 34803.41 requests per second
LPOP: 37367.20 requests per second

Another one using a 64 bit box, a Xeon L5420 clocked at 2.5 Ghz:
Another one using a 64 bit box, a Xeon L5420 clocked at 2.5 GHz:

$ ./redis-benchmark -q -n 100000
PING: 111731.84 requests per second
Expand Down
6 changes: 3 additions & 3 deletions topics/expire.md
@@ -1,6 +1,6 @@
# Expiring keys

Voltile keys are stored on disk like the other keys, the timeout is persistent
Volatile keys are stored on disk like the other keys, the timeout is persistent
too like all the other aspects of the dataset. Saving a dataset containing
expires and stopping the server does not stop the flow of time as Redis
stores on disk the time when the key will no longer be available as Unix
Expand Down Expand Up @@ -96,7 +96,7 @@ per second divided by 4.

## Example

Ok let's start with the problem:
OK, let's start with the problem:

SET a 100
OK
Expand Down Expand Up @@ -158,4 +158,4 @@ the master instance, and there is no longer a chance of consistency errors.
However while the slaves connected to a master will not expire keys
independently, they'll still take the full state of the expires existing in
the dataset, so when a slave is elected to a master it will be able to expire
the keys independently, fully acting as a master.
the keys independently, fully acting as a master.
8 changes: 4 additions & 4 deletions topics/faq.md
Expand Up @@ -58,15 +58,15 @@ the right data structures for the problem we are trying to solve.

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 _cp_ unix
server is working it is safe to save the database file just with the _cp_ 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.

## What's the Redis memory footprint?

Worst case scenario: 1 Million keys with the key being the natural numbers from
0 to 999999 and the string "Hello World" as value use 100MB on my Intel macbook
0 to 999999 and the string "Hello World" 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.
Expand Down Expand Up @@ -181,7 +181,7 @@ MMAP_THRESHOLD=4096`

## I have an empty Redis server but INFO and logs are reporting megabytes of memory in use!

This may happen and it's prefectly ok. Redis objects are small C structures
This may happen and it's perfectly okay. 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.
Expand Down Expand Up @@ -251,7 +251,7 @@ more optimistic allocation fashion, and this is indeed what you want for Redis.

A good source to understand how Linux Virtual Memory work and other
alternatives for `overcommit_memory` and `overcommit_ratio` is this classic
from Red Hat Magaize, ["Understanding Virtual Memory"][redhatvm].
from Red Hat Magazine, ["Understanding Virtual Memory"][redhatvm].

[redhatvm]: http://www.redhat.com/magazine/001nov04/features/vm/

Expand Down
2 changes: 1 addition & 1 deletion topics/internals-eventlib.md
Expand Up @@ -22,7 +22,7 @@ Q: How do Event Libraries do what they do?<br/>
A: They use the operating system's [polling](http://www.devshed.com/c/a/BrainDump/Linux-Files-and-the-Event-Poll-Interface/) facility along with timers.

Q: So are there any open source event libraries that do what you just described? <br/>
A: Yes. Libevent and Libev are two such event libraries that I can recall off the top of my head.
A: Yes. `libevent` and `libev` are two such event libraries that I can recall off the top of my head.

Q: Does Redis use such open source event libraries for handling socket I/O?<br/>
A: No. For various [reasons](http://groups.google.com/group/redis-db/browse_thread/thread/b52814e9ef15b8d0/) Redis uses its own event library.

0 comments on commit d94afe3

Please sign in to comment.