.net Redis cache optimization improves loading speed and server performance (1)

It has been a while since the last time the server escaped the image to the oss server for submission and loading speed

For the results before and after the picture is transferred to the oss server optimization, you can view the article I wrote before click to view

Now with the increase in the number of merchants and the increase in data, the performance of the server has once again reached its peak, and because the order is due to the ordering system, the number of orderers at 12 noon has undergone a crazy test on the server architecture. The order table is divided into today's order and historical order table. The database and CPU have been initially relieved, but the excessive data and large concurrent queries at noon still cause the CPU and memory to remain high. Eventually, I decided to store the Redis cache of infrequently updated information storage values ​​such as commonly used menus, menu lists, and merchant information at noon to see if it can relieve the server

View the performance chart before and after according to the convention

First we do stress test on our test 1 core 2G server

The first is to go to the database

We can see that when the concurrency is around 20, there has been a large area abnormality, the response is slow, and the interface returns data has been quite slow

Finally, we can see that if the database data is relatively large, it will cause high concurrency queries to be slow, and cause the interface response to be particularly slow. Under the 100 concurrent gradual increase test, the higher the number of concurrency, the more the response Slow, just like when ordering at noon, a large number of people scan the QR code at the same time, but because the response is slow, the data can not get the page rotation, which is very affecting the experience

The following is the performance test of the interface using Redis

It can be seen that after the Redis cache is used, the interface response data is read every time the database interface is read, and the success rate is increased from 1.59% to 99.55%.

 

Finally, a Redis diagram of the server

The next issue focuses on explaining how to add Redis cache for .net MVC project

 

 

 

Published 29 original articles · Like 11 · Visits 10,000+

Guess you like

Origin blog.csdn.net/u010840685/article/details/103274273