Tens massive test data operation, Redis VS couchbase performance Disclosure!

Source: Internet
Author: User
Tags couchbase redis cluster

In the previous article we introduced the differences between Redis and Couchbase and show their respective strengths (please poke the blue bold font: Couchbase vs Redis, which one is better. )。 This article will provide developers with the most real and powerful data support, so that technology selection more objective, so that the cluster expansion is no longer blind, in the predictable business scale, so that each machine to do their material.

¡ø Testers: 杨挺, Song Jiayang

▲ Test time: 2017.5.8-2017.5.19;2017.6.28---2017.6.30

▲ test Environment

▲ Testing Tools

▲ System Deployment

1. Cluster deployment:
Because Redis uses a single-threaded model, that is, an instance can only use one core, so in order to give full play to the machine performance, in the 3 4 core cluster machines have deployed a total of 24 redis instances, of which 12 main instance 12 backup instances, to all data to enable a backup, That is, each server deploys eight Redis instances, four main four from. Couchbase can take full advantage of multi-core CPUs, so each machine deploys only one instance, and a data backup is enabled.


2. Pressure test Client deployment:
The OPS testing client deploys a multithreaded OPS test program that is used to test and statistic ops; The ResponseTime client deploys a single-threaded responsetime test program to test and calculate the response time for cluster services under different pressures.


▲ Test Plan
Each OPS client uses 500/1000/2000 (synchronous read and write operations block threads until the number of raised threads is not significantly changed) a concurrent thread sends read/write requests to the cluster to ensure that the Redis/couchbase cluster is able to perform its maximum output. At the same time, the Rsponsetime test client adopts single thread (OPS and Rsponsetime test sub-client execution is to avoid the interference of the client network, client CPU scheduling, etc. Rsponsetime the client side uses a single thread to reduce the effect of CPU time fragmentation on response time, send read/write requests and record response times for each request, with a nanosecond-level statistical accuracy that accurately reflects the processing speed that the cluster can still perform under the maximum ops pressure. (OPS and Response time statistics work, completed by test code)


▲ Test Cases
In the following tests, HashMap is used as the test data type, accessed directly in the HashMap format in the Redis, and HashMap is converted to JSON format for access in Couchbase.


Small block data write test four OPS clients send 100W 100 byte data write requests to the cluster, and statistics OPS; Rsponsetime the client sends a 1W 100 byte data write request to the cluster and counts the response time.


First, couchbase write test
Four OPS pressure clients start with 500 concurrent threads and 4 bucket connections (both increase and decrease the performance of this value slightly) Insert 100W data into the Couchbase cluster respectively, That is, 2000 concurrent threads initiate the insert request for document of 400W 100 byte size, and a rsponsetime test client tests and counts the service processing speed of the Couchbase cluster respectively in the OPS before and during the OPS pressure measurement.

Rsponsetime statistics of couchbase cluster before pressure measurement:

10.20.135.66

Before the pressure test, the Rsponsetime test client uses a single thread to initiate 10,000 write requests to the cluster, with an average response time of 0.35ms.


Couchbase Control station monitoring situation is as follows:


The resource consumption of the Couchbase cluster is as follows:
10.20.135.71

(Memcached is responsible for data manipulation of memory and hard disks; BEAM.SMP is responsible for monitoring and managing other potential processes, such as cross-cluster backup, indexing, and cluster operations).
10.20.135.72

10.20.135.73


The resource consumption of the OPS pressure client is as follows:

10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


The OPS pressure test client statistics are as follows:

10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


Rsponsetime pressure test Client statistics are as follows:
10.20.135.66

Test Results Analysis:
Couchbase cluster resource consumption almost reached the bottleneck, and then increased pressure OPS did not improve, Rsponsetime is obviously elevated. Therefore, the three 4 nuclear 8G couchbase cluster, The average response time of 0.35ms (with one important reason for the couchbase insert operation to return full document) is normally available, providing a stable supply of 15W OPS with 2000 concurrent threads initiating 400W 100-byte size document write pressure, with an average response time of only 1 .95MS (a stable time selected after multiple tests).

Second, Redis write test



Four OPS pressure clients start 500 concurrent threads and 300 concurrent connections (and then increase the performance slightly), inserting 100W data into the Redis cluster, where 2000 concurrent threads initiate 400W 100-byte size data write requests. A rsponsetime pressure-measuring client is tested and counted the service processing speed of the Redis cluster in the OPS before and during the OPS pressure measurement, and the test results are as follows:
Rsponsetime statistics of Redis cluster before pressure measurement:

Before the pressure test, the Rsponsetime test client uses a single thread to initiate 10,000 write requests to the cluster, with an average response time of 0.21ms.


The resource consumption of the Redis cluster is as follows:
10.20.135.71

(4 Redis primary nodes provide read/write service and 4 backup services from nodes; Therefore, only 4 Redis processes consume resources in the query test)
10.20.135.72

10.20.135.73


The OPS pressure test client statistics are as follows:

10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


Rsponsetime pressure test Client statistics are as follows:

10.20.135.66


Test Results Analysis:
Although the resource consumption of the OPS pressure test client and the Redis cluster is not nearly full load, but the increase of the pressure in the case of OPS does not rise and fall, the rsponsetime is significantly increased. As a result, the Redis cluster of the three four core eight G can provide a 0.21ms average response time under normal usage, providing a stable 20W ops with a data block write request of 100 byte size of million, and the average response time is only 2.09ms.

Iii. Summary of testing
In normal use, both Redis and couchbase can provide a millisecond-level processing speed, but the Redis cluster response speed (0.21MS) is almost one times faster than the Couchbase cluster (0.35MS). With 2000 concurrent threads initiating 400W 100-byte size data write pressure, the Redis cluster can stabilize the 20W ops,couchbase cluster to provide stable 15W ops, and the average response time is comparable. Continue to increase the pressure, the Redis rsponsetime growth rate is greater than couchbase, that is, redis under the greater pressure of processing speed down faster.


"Small chunks of data write tests for large amounts of data"

Each OPS client sends a 500W 100-byte data write request to the cluster and counts ops; Rsponsetime the client sends a 1W 100 byte data write request to the cluster and counts the response time.


First, couchbase write test
Four OPS pressure clients start 500 concurrent threads and 4 bucket connections to insert 500W data into the Couchbase cluster, where 2000 concurrent threads initiate a write request for 2000W 100-byte-size document. A rsponsetime pressure measuring client in the OPS pressure test process, testing and Statistics couchbase Cluster service processing speed, the test results are as follows:
Couchbase Control station monitoring situation is as follows:


The resource consumption of the Couchbase cluster is as follows:
10.20.135.71

10.20.135.72

10.20.135.73

The resource consumption of the OPS pressure client is as follows:
10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


The OPS pressure test client statistics are as follows:
10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


Rsponsetime pressure test Client statistics are as follows:
10.20.135.66

Test Results Analysis:
Couchbase cluster resource consumption almost reached the bottleneck, and then increased pressure OPS did not improve, Rsponsetime is obviously elevated. Therefore, the three 4 nuclear 8G couchbase cluster, Normally, the average response time of 0.35ms can be provided, under the pressure of 2000 concurrent threads to initiate 2000W 100-byte size document writing request, to stabilize the 14W ops, with an average response time of 3.81ms.


Second, Redis write test
Four OPS pressure clients start 500 concurrent threads and 300 concurrent connections (and then increase the performance slightly), inserting 500W data into the Redis cluster, where 2000 concurrent threads initiate 2000W 100-byte size data insertion requests. A rsponsetime pressure measuring client in the OPS pressure test process, testing and Statistics Redis Cluster service processing speed, the test results are as follows:


The resource consumption of the Redis cluster is as follows:
10.20.135.71

10.20.135.72

10.20.135.73


The OPS pressure client resource consumption is as follows:
10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


The OPS pressure test client statistics are as follows:
10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70

Rsponsetime pressure test Client statistics are as follows:
10.20.135.66


Test Results Analysis:
The resource consumption of the Redis cluster and the OPS test client did not reach the bottleneck, but the increase in pressure ops did not increase, and the rsponsetime obviously increased. Therefore, the three 4 nuclear 8G redis cluster, The average response time of 0.21ms can normally be provided, under the pressure of 2000 concurrent threads to initiate 2000W 100-byte size document writing request, which provides a stable supply of 16W ops, but the average response time reaches 6.43ms.


Iii. Summary of testing
Under pressure from 2000 concurrent threads to initiate a write request of 2000W 100 byte size document, the Redis cluster can stabilize the 16W ops,couchbase cluster to provide stable 14W ops, The average response time aspect of the Redis cluster (6.43MS) is significantly longer than the Couchbase cluster (3.81ms), that is, the two provided an OPS equivalent, but the Couchbase cluster request processing speed has been significantly surpassed Redis cluster.


Large chunks of data small data writes test each OPS client sends a 50W 10KB size data write request to the cluster and counts ops; Rsponsetime the client sends a 1W 100 byte data write request to the cluster and counts the response time.


First, couchbase write test
Six OPS pressure clients start 1000 concurrent threads and 4 bucket connections to insert 50W data into the Couchbase cluster, that is, 6,000 concurrent threads initiate the insert request for the 300W 10KB size document. A rsponsetime pressure measuring client in the OPS pressure test process, testing and Statistics couchbase Cluster service processing speed, the test results are as follows:
Couchbase Control station monitoring situation is as follows:


The resource consumption of the Couchbase cluster is as follows:
10.20.135.71

10.20.135.72

10.20.135.73

The resource consumption of the OPS pressure client is as follows:
10.20.135.57

10.20.135.58

10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


The OPS pressure test client statistics are as follows:
10.20.135.57

10.20.135.58

10.20.135.67

10.20.135.68

10.20.135.69

10.20.135.70


Rsponsetime pressure test Client statistics are as follows:
10.20.135.66


Test Results Analysis:
Couchbase Cluster resource consumption has not reached the machine bottleneck, but the OPS pressure client has reached full load, because no additional machine to complete the limit test, the test results can only indicate that a single 8 core 8G OPS pressure client can only launch about 1000 OPS 10K block write request. Therefore, the three 4 nuclear 8G couchbase cluster, Normally, the average response time of 0.35ms can be provided, and under the pressure of 6,000 concurrent threads to initiate 300W 10KB size document write request, the OPS can be stably supplied with 6K above, the average response time is only 1.16ms, and the visible pressure is mainly concentrated on the client.


Second, Redis write test
Six OPS pressure clients start 1000 concurrent threads and 300 concurrent connections respectively insert 50W data into the Redis cluster, that is, 6,000 concurrent threads initiate 300W 10KB size data insertion requests, and a rsponsetime pressure client in the OPS pressure test process , test and statistic the service processing speed of Redis cluster, test results are as follows:
The resource consumption of the Redis cluster is as follows:
10.20.135.71

10.20.135.72

10.20.135.73


The OPS pressure client resource consumption is as follows:
10.20.135.57

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.