Redis read and write performance test

1. Basic test : 

     Redis reading and writing performance test The redis official website test can read and write about 100,000, which is very attractive. I tested redis in the R&D environment and found that the speed of redis is indeed very fast. This test is to provide R&D reference for future application optimization. Due to the limitation of the network environment, this machine is a 100M network card with a maximum transmission speed of 10M/s, so when the test reads 45,000 records per second, the upload or download speed of the test machine and the test server has reached 10M/s, basically When the network bottleneck is reached, it cannot be improved any more. This should be the reason for the network throughput, but the CPU utilization rate is about 20%. If the network transmission speed is faster, it should be improved. In addition, when data is not obtained in batches, that is, one key is sent each time to obtain a value, the basic processing capacity is only about 1100, which is estimated to be restricted. due to network speed.

   Second,  the additional test:

    (1) Single processing:

    Through the test between two Xeon(R) E5520 servers on the same network segment, the network speed is also 10M/s. By sending a key to get a value, the speed details are higher than the speed of the development computer, that is The Linux environment is faster than the window environment, and can process about 4,000 pieces of data per second, which is 4 times higher than the previous 1,000 pieces. When testing on the server machine, the performance suddenly began to change. The stored data reached about 15,000, and the acquisition speed reached 2 About 10,000, which is 5 times higher than the network environment and 20 times higher than the windows environment;

    (2) Batch processing:

    For batch storage and batch acquisition, the direct processing speed of the Linux server is above 40,000, which is comparable to the speed in the Windows environment; however, in the local environment, the performance begins to change again, and the batch storage speed can reach more than 150,000 to 200,000. Batch acquisition It is more than 400,000, and the overall performance is 10 to 20 times higher than that of Linux servers.

 

    3. Personal experience:

    (1) Batch processing:

        When redis processes data, it is best to perform batch processing, and change one piece of data to multiple pieces at a time, and the performance can be doubled. The purpose of the test is to figure out the difference between batch processing and non-batch processing. From the test results, the performance difference is very large, so try to use batch processing during the development process, that is, send multiple pieces of data each time to offset the network speed. influence.

 

    (2) Network:

       Redis is greatly affected by the network during processing, so it is best to deploy it locally. If you deploy redis locally, you can get 10 to 20 times the performance. In the case of a cluster, the network hardware and network speed requirements must be high.

      

    (3) Memory:

       Since I encountered a redis read timeout in the test environment, the troubleshooting reason is located on the Linux interactive partition. If there is not enough memory, linux may put some data of reids into the swap partition, resulting in very slow read speed and timeout. So be sure to reserve enough memory for redis to use.

 

The specific test content is as follows:

   

test environment:

redis host:

    Red Hat Enterprise Linux Server release 5.4 (Standard)

    Intel(R) Xeon(R) CPU           E5520  @ 2.27GHz

    Memory 8G

    Hard disk 300G

Test host:

    window7 

    eclipse  Juno Service Release 2

    cpu i3 -2100

    Memory 4G

     Hard disk 500G

  Java connection redis client jedis-2.1.0.jar

 Test Data:

   512 character string

 Test Results:

 

 Bulk acquisition

 

 Number of non-batch submissions processed

 

 

Batch settings

 

 

non-batch settings

 

 

 

Intranet server direct data processing

 



 
 

Test on the server

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326455467&siteId=291194637