Windows platform to build Redis distributed cache cluster (a) server building and performance testing

Source: Internet
Author: User
Tags keep alive redis server

Baidu definition: Redis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set), Zset (sorted set-ordered set), and hash (hash type), in order to ensure efficiency, The data is cached in memory.

The difference is that Redis periodically writes the updated data to disk or writes the modified operation to the appended record file, and Master-slave (Master-Slave) synchronization is implemented on this basis.

Previously the company has been using Ehcache cache, but with the increase in business and the increase in user access to the system more and more can not meet the actual demand, the reflection is also more and more slow, the cache of its processing access speed is read disk thousands of times, the use of the cache can solve the problem of slow system response. Therefore, the intention is to build a high-performance Redis cache server, let the cache from the application server to separate the cache server, if the system relies on the cache server and then need to consider the emergence of server downtime, need to get a cache cluster to avoid this situation.

See there is a classic words to describe the occurrence of the outage and not let the user feel, equivalent to "flying aircraft for an engine" but also to let users feel no aircraft shaking, that is, no matter how the background changes in the situation, the user interface for the front-end user experience is better.

In the system optimization scheme, we should consider the cache first, and then the other bottleneck, which is also the system optimization experience.

Let's take a look at the Redis server set up on two Windows platform computers.

Redis Linux and Window integration latest version: Http://pan.baidu.com/s/1dD1WmEd

The structure diagram is as follows


1. download Unzip, there is nothing to say, in the extracted bin directory under the following these files:

2. This server mainly includes the above files, start the server first, To start the server, you need to load the redis.windows.conf server configuration file, you can enter the following command at the command line (need to add the directory to the environment variable in order to function), I wrote it in a bat script, directly click to start the service:

3. Execute, see the following interface indicates the success has been started.

At this point, the Redis server on this computer has been installed, the IP address is: 192.168.24.82; default port: 6379;

Repeat the steps, and then set up a server on another computer master-slave relationship Master-slave:ip address: 192.168.24.39; Port: 6379

4. in order to secure the server yoke first, the default configuration does not set the password any one user can access the server, modify the redis.windows.conf configuration file password: Find the following line:

Find # Requirepass foobared Remove the previous comment # and replace the foobared with your own password: lls

Now let's try the login server with local IP 82, invoke the client program from the native login input command and enter the password:

5. The parameters are IP, port, password, if you do not enter the password will prompt do not have permission to log on the system. From the remote login principle just like the input IP address is different, in the local to the cache after the storage value and then from another computer can obtain this value.

This allows access to the cache server from any computer and client, and the two servers also need to set up master-slave relationships to complete the synchronous backup.

Scalability Considerations:

In the cache server cluster, you need to consider the server scalability that one day the cache server can not meet the demand, dynamically add one or reduce the impact of a server on the existing cluster, the smaller the impact of the better, not only the cache and application server cluster, database server cluster, etc. need to consider this problem.

       

Performance testing

with the tool benchmark.exe, enter the command: benchmark-h 192.168.24.82-p 6379-c 1000-n 100000. Indicates that 100,000 requests are sent to the server, and the number of concurrent requests per request is 1000, resulting in the following:

====== Ping_inline ======
100000 requests completed in 154.46 seconds
Parallel clients
3 bytes Payload
Keep Alive:1

647.43 Requests per second

====== ping_inline ======


Indicates that the average processing of 647.43 concurrent requests per second, equivalent to 600,000 user requests per second, this computer Configuration 4G CD Core Cup, performance is still possible.

Ps:

When testing a large amount of output information displayed in the CMD console, will overwrite the previous information, in fact, we can output the results to TXT file after the command with a symbol, take our familiar command example: ipconfig all > D: Text.txt, so you can output the results to a file.

The next blog will show you how to build a master-slave server and interact with the server through a Java client.


Windows platform to build Redis distributed cache cluster (a) server building and performance testing

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.