Golang Test Redis Message Queuing

Source: Internet
Author: User

Using the Redis list data structure as a lightweight message queue, the small system is really small and beautiful, controllable ability.

Of course, compared with Kafka and RABBITMQ it has many shortcomings, in the service production and consumption, but also need to add some logic to deal with.

Write yourself a bit of Golang code and stress test the performance of the Redis list.

Machine configuration: Dual Core, 4G

Test data: 100w

Stress test Source (GitHub)

producers , producing up to 13,817 data per second, averaging data.

Begin time:2018-07-29 14:03:55.606

End time:2018-07-29 14:05:07.976

Produce message:1000000

avg:13817.860879118389

Load
Code Snippets

consumers , consumption of data, the average can read 9,433 data per second about.

Begin time:2018-07-29 14:46:11.166

End time:2018-07-29 14:47:58.038

Custom message:1000000

avg:9433

Load code Fragment

Summarize:

The above production and consumption testing are independent testing, production data and consumption data, can reach about 1w concurrency, if the producers and consumers at the same time, the concurrency of their respective capacity will be reduced by about 20%.

True, the general small business system, the real core business data (non-water, behavioral records and other log-type data), write concurrency can reach 1 W is already very strong, some financial companies, millions of registered users (not active enough), peak write concurrency is only thousands of. The general system should be read more than write operation, of course, the specific situation should be specific analysis ^_^.

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.