update readme
This commit is contained in:
@@ -1,114 +0,0 @@
|
||||
Where to find complete Redis documentation?
|
||||
-------------------------------------------
|
||||
|
||||
This README is just a fast "quick start" document. You can find more detailed
|
||||
documentation at http://redis.io
|
||||
|
||||
Building Redis
|
||||
--------------
|
||||
|
||||
It is as simple as:
|
||||
|
||||
% make
|
||||
|
||||
You can run a 32 bit Redis binary using:
|
||||
|
||||
% make 32bit
|
||||
|
||||
After building Redis is a good idea to test it, using:
|
||||
|
||||
% make test
|
||||
|
||||
NOTE: if after building Redis with a 32 bit target you need to rebuild it
|
||||
with a 64 bit target you need to perform a "make clean" in the root
|
||||
directory of the Redis distribution.
|
||||
|
||||
Allocator
|
||||
---------
|
||||
|
||||
By default Redis compiles and links against jemalloc under Linux, since
|
||||
glibc malloc() has memory fragmentation problems.
|
||||
|
||||
To force a libc malloc() build use:
|
||||
|
||||
% make FORCE_LIBC_MALLOC=yes
|
||||
|
||||
In all the other non Linux systems the libc malloc() is used by default.
|
||||
|
||||
On Mac OS X you can force a jemalloc based build using the following:
|
||||
|
||||
% make USE_JEMALLOC=yes
|
||||
|
||||
Verbose build
|
||||
-------------
|
||||
|
||||
Redis will build with a user friendly colorized output by default.
|
||||
If you want to see a more verbose output use the following:
|
||||
|
||||
% make V=1
|
||||
|
||||
Running Redis
|
||||
-------------
|
||||
|
||||
To run Redis with the default configuration just type:
|
||||
|
||||
% cd src
|
||||
% ./redis-server
|
||||
|
||||
If you want to provide your redis.conf, you have to run it using an additional
|
||||
parameter (the path of the configuration file):
|
||||
|
||||
% cd src
|
||||
% ./redis-server /path/to/redis.conf
|
||||
|
||||
Playing with Redis
|
||||
------------------
|
||||
|
||||
You can use redis-cli to play with Redis. Start a redis-server instance,
|
||||
then in another terminal try the following:
|
||||
|
||||
% cd src
|
||||
% ./redis-cli
|
||||
redis> ping
|
||||
PONG
|
||||
redis> set foo bar
|
||||
OK
|
||||
redis> get foo
|
||||
"bar"
|
||||
redis> incr mycounter
|
||||
(integer) 1
|
||||
redis> incr mycounter
|
||||
(integer) 2
|
||||
redis>
|
||||
|
||||
You can find the list of all the available commands here:
|
||||
|
||||
http://redis.io/commands
|
||||
|
||||
Installing Redis
|
||||
-----------------
|
||||
|
||||
In order to install Redis binaries into /usr/local/bin just use:
|
||||
|
||||
% make install
|
||||
|
||||
You can use "make PREFIX=/some/other/directory install" if you wish to use a
|
||||
different destination.
|
||||
|
||||
Make install will just install binaries in your system, but will not configure
|
||||
init scripts and configuration files in the appropriate place. This is not
|
||||
needed if you want just to play a bit with Redis, but if you are installing
|
||||
it the proper way for a production system, we have a script doing this
|
||||
for Ubuntu and Debian systems:
|
||||
|
||||
% cd utils
|
||||
% ./install_server
|
||||
|
||||
The script will ask you a few questions and will setup everything you need
|
||||
to run Redis properly as a background daemon that will start again on
|
||||
system reboots.
|
||||
|
||||
You'll be able to stop and start Redis using the script named
|
||||
/etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379.
|
||||
|
||||
Enjoy!
|
||||
@@ -0,0 +1,75 @@
|
||||
Redis on Windows prototype
|
||||
===
|
||||
## What's new in this release
|
||||
|
||||
- The project is now a fork of https://github.com/antirez/redis
|
||||
- libuv dependency was removed in favor of calling Win32 APIs directly. This was done in order to make integrations with upstream repo more manageable.
|
||||
- Improvement to the snapshotting (save on disk) algorithm. The code now serializes to buffer on a background thread then writes to disk. The main thread is blocked only on writes while the background thread is writing to buffer. This is an improvement to a full block where the snapshot was written to disk on the main thread.
|
||||
- Improved unit tests pass rate
|
||||
|
||||
===
|
||||
Special thanks to Dušan Majkic (https://github.com/dmajkic, https://github.com/dmajkic/redis/) for his project on GitHub that gave us the opportunity to quickly learn some on the intricacies of Redis code. His project also helped us to build our prototype quickly.
|
||||
|
||||
|
||||
## How to build Redis
|
||||
|
||||
|
||||
### Build pthreads library using Visual Studio
|
||||
|
||||
You can use the free Express Edition available at http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express.
|
||||
|
||||
Redis uses pthreads. The build assumes it is linked as a static library.
|
||||
You need to get Windows pthreads sources and build as a static library.
|
||||
|
||||
1. You can download the code from ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.exe.
|
||||
|
||||
2. Extract the files to a folder on your local drive.
|
||||
|
||||
3. From your local folder, copy all the files from Pre-built.2/include to your redis folder under
|
||||
deps/pthreads-win32/include (the directory needs to be created).
|
||||
|
||||
4. From Visual Studio, do Open Project, and navigate to the installed folder, and then pthreads.2.
|
||||
|
||||
5. Open the pthread project file (pthread.dsp).
|
||||
|
||||
6. VS will ask to convert to the current version format. Select Yes.
|
||||
|
||||
7. Open project properties and change the following:
|
||||
|
||||
- Change configuration type from Dynamic Library (.dll) to Static Library (.lib)
|
||||
- Change Target Extension for .dll to .lib
|
||||
- Under C-C++/Code Generation, change Runtime Library choice to Multi-threaded (/MT)
|
||||
|
||||
8. Build the project. This will create a pthread.lib under pthreads.2 directory.
|
||||
|
||||
9. Copy pthread.lib to your redis folder under deps/pthreads-win32/lib/release|debug (you have to create the directories).
|
||||
|
||||
### Build Redis using Visual Studio
|
||||
|
||||
- Open the solution file msvs\redisserver.sln in Visual Studio 10, and build.
|
||||
|
||||
This should create the following executables in the msvs\$(Configuration) folder:
|
||||
|
||||
- redis-server.exe
|
||||
- redis-benchmark.exe
|
||||
- redis-cli.exe
|
||||
- redis-check-dump.exe
|
||||
- redis-check-aof.exe
|
||||
|
||||
If there is an error in finding the pthreads.lib file, check that you have selected the same configuration as used for building the pthreads.lib file, and that you copied it to the expected location.
|
||||
|
||||
### Release Notes
|
||||
|
||||
This is a pre-release version of the software and is not fully tested.
|
||||
This is intended to be a 32bit release only. No work has been done in order to produce a 64bit version of Redis on Windows.
|
||||
To run the test suite requires some manual work:
|
||||
|
||||
- The tests assume that the binaries are in the src folder, so you need to copy the binaries from the msvs folder to src.
|
||||
- The tests make use of TCL. This must be installed separately.
|
||||
- To run the tests in a command window: `tclsh8.5.exe tests/test_helper.tcl`.
|
||||
|
||||
### Plan for the next release
|
||||
|
||||
- Update code base to Redis 2.4.7
|
||||
- We plan to improve further the snapshotting process. We are working on some ideas on how to we can simulate the Copy-On-Write feature at the application level.
|
||||
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
/******************************************************************************/
|
||||
#ifdef JEMALLOC_H_TYPES
|
||||
|
||||
/*
|
||||
* Simple linear congruential pseudo-random number generator:
|
||||
*
|
||||
* prn(y) = (a*x + c) % m
|
||||
*
|
||||
* where the following constants ensure maximal period:
|
||||
*
|
||||
* a == Odd number (relatively prime to 2^n), and (a-1) is a multiple of 4.
|
||||
* c == Odd number (relatively prime to 2^n).
|
||||
* m == 2^32
|
||||
*
|
||||
* See Knuth's TAOCP 3rd Ed., Vol. 2, pg. 17 for details on these constraints.
|
||||
*
|
||||
* This choice of m has the disadvantage that the quality of the bits is
|
||||
* proportional to bit position. For example. the lowest bit has a cycle of 2,
|
||||
* the next has a cycle of 4, etc. For this reason, we prefer to use the upper
|
||||
* bits.
|
||||
*
|
||||
* Macro parameters:
|
||||
* uint32_t r : Result.
|
||||
* unsigned lg_range : (0..32], number of least significant bits to return.
|
||||
* uint32_t state : Seed value.
|
||||
* const uint32_t a, c : See above discussion.
|
||||
*/
|
||||
#define prn32(r, lg_range, state, a, c) do { \
|
||||
assert(lg_range > 0); \
|
||||
assert(lg_range <= 32); \
|
||||
\
|
||||
r = (state * (a)) + (c); \
|
||||
state = r; \
|
||||
r >>= (32 - lg_range); \
|
||||
} while (false)
|
||||
|
||||
/* Same as prn32(), but 64 bits of pseudo-randomness, using uint64_t. */
|
||||
#define prn64(r, lg_range, state, a, c) do { \
|
||||
assert(lg_range > 0); \
|
||||
assert(lg_range <= 64); \
|
||||
\
|
||||
r = (state * (a)) + (c); \
|
||||
state = r; \
|
||||
r >>= (64 - lg_range); \
|
||||
} while (false)
|
||||
|
||||
#endif /* JEMALLOC_H_TYPES */
|
||||
/******************************************************************************/
|
||||
#ifdef JEMALLOC_H_STRUCTS
|
||||
|
||||
#endif /* JEMALLOC_H_STRUCTS */
|
||||
/******************************************************************************/
|
||||
#ifdef JEMALLOC_H_EXTERNS
|
||||
|
||||
#endif /* JEMALLOC_H_EXTERNS */
|
||||
/******************************************************************************/
|
||||
#ifdef JEMALLOC_H_INLINES
|
||||
|
||||
#endif /* JEMALLOC_H_INLINES */
|
||||
/******************************************************************************/
|
||||
Reference in New Issue
Block a user