Home  >  Article  >  Backend Development  >  Introduction to the installation and configuration of Redis_PHP tutorial

Introduction to the installation and configuration of Redis_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:43:15839browse

Redis logo

redis is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of keyvalue storage such as memcached, and can play a very good supplementary role to relational databases in some situations. It provides Python, Ruby, Erlang, and PHP clients, which are very convenient to use. The problem is that this project is still very new, may not be stable enough, and there are no actual examples of application in some large-scale systems. In addition, the lack of batch get in MC is also a relatively big problem. The network overhead of always getting in batches is different from getting multiple times.

Performance test results:

SET operations are 110,000 times per second, GET operations are 81,000 times per second, and the server configuration is as follows:

Linux 2.6, Xeon X3320 2.5Ghz.

The stackoverflow website uses Redis as a cache server.

Installation process:

Redis is an advanced key-value database. It is similar to memcached, but data can be persisted and supports a wide range of data types. There are strings, linked lists, sets and sorted sets. It supports calculating the union, intersection and complement (difference) of sets on the server side, and also supports a variety of sorting functions. So Redis can also be regarded as a data structure server.

All data in Redis is stored in memory and then asynchronously saved to disk from time to time (this is called "semi-persistent mode"); each data change can also be written to an append only inside file(aof) (this is called "full persistence mode").

1. Download the latest version

wget http://redis.googlecode.com/files/redis-2.0.0-rc4.tar.gz

2. Decompression

tar redis-2.0.0-rc4.tar.gz

3. Install C/C++ compilation components (optional)

apt-get install build-essential

4. Compilation

cd redis-2.0.0-rc4
make

After the make command is executed, this executable file will be generated in the current directory, which are redis-server, redis-cli, redis-benchmark, and redis-stat. Their functions are as follows:

  • redis-server: daemon startup program for Redis server
  • redis-cli: Redis command line operation tool. Of course, you can also use telnet to operate according to its plain text protocol
  • www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478842.htmlTechArticleredis is a high-performance key-value database. The emergence of redis has largely compensated for the shortcomings of keyvalue storage such as memcached. In some cases, it can play a very good role in relational databases...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn