Introduction to the Redis method of configuring installation in Linux

Source: Internet
Author: User
Tags install php redis

Redis installation is not required./configure, this is better, simple!

The code is as follows Copy Code

#下载
wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz
#解压
TAR-ZXVF redis-2.6.14.tar.gz
#拷贝到目标目录
Mkdir-p/usr/local/redis
Cp-r./redis-2.6.14/usr/local/redis
Cd/usr/local/redis
#安装
Make && make install


After you've installed it,

./conf configuration file

./src/redis-server Redis's server

./src/redis-client Redis Client

"Change Configuration"

This time Redis is ready to start.

The interface is more beautiful, but it is inconvenient to use, we need to change it to run in the background:

Open redis.conf Find Daemonize no change to daemonize Yes on OK, other configuration first with the default bar!

Then you can start up:


View Sourceprint?
1/usr/local/redis/src/redis-server/usr/local/redis/redis.conf

Then look at the Redis process:

Has started up, using the default 6379 port.

Then it is best to add a boot start, at the bottom of the/etc/rc.d/rc.local add a line just to start the command, so that there will not be forgotten to start the accident

"Install PHP extensions"

After other PHP extensions have been installed, it is too easy to find a PHP extension, with each extension, using only phpize &&/configure && make && make install, and finally changing the ph P.ini's OK.

The code is as follows Copy Code

1 wget https://github.com/owlient/phpredis/archive/master.zip

2 Unzip Master.zip

3/usr/local/php/bin/phpize

4./configure--with-php-config=/usr/local/php/bin/php-config

5 Make && make install

Then add a line to the php.ini:

The code is as follows Copy Code

[Redis]

Extension=redis.so

It's OK.

So PHP can use Redis-related classes.


Performance

Here is the official Bench-mark data:

The test completed 50 concurrent execution 100,000 requests.
The value set and gets is a 256-byte string.
Linux box is running Linux 2.6, which is X3320 Xeon 2.5 GHz.
Text execution uses the loopback interface (127.0.0.1).
Result: The speed of writing is 110,000 times/s, and the speed of reading is 81,000 times/s.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.