Redis is a key-value storage system. Similar to Memcached, Memcached supports more storage value types, including string, list, set, and zset) and hashs (hash type), I will share with you the installation and testing of redis and common methods.
Redis is a high-performance key-value database. The emergence of redis largely compensates for the shortage of key/value storage such as memcached, and can play a good complementary role in relational databases in some cases. It provides Python, Ruby, Erlang, and PHP clients for ease of use.
Performance test results:
The SET operation is performed 110000 times per second, and the GET operation is performed 81000 times per second. The server configuration is as follows:
| The Code is as follows: |
Copy code |
$ Wget http://redis.googlecode.com/files/redis-2.6.7.tar.gz $ Tar xzf redis-2.6.7.tar.gz $ Redis-2.6.7 cd $ Make |
If the following error is reported, make cannot be found because linux of the server version is the minimum installation, and many tools are not installed.
| The Code is as follows: |
Copy code |
-Bash: make: command not found |
Centos execution
| The Code is as follows: |
Copy code |
Yum install make |
If you cannot connect to wget
| The Code is as follows: |
Copy code |
-Bash: wget: command not found
|
Centos execution
| The Code is as follows: |
Copy code |
Yum install wget |
Start the server
| The Code is as follows: |
Copy code |
$ Src/redis-server |
Start display:
Client usage
| The Code is as follows: |
Copy code |
$ Src/redis-cli Redis> set foo bar OK Redis> get foo "Bar" |