Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the concept of task flow introduced by C++ server engine?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the concept of task flow introduced by C++ server engine", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the concept of task flow introduced by C++ server engine?"

Sogou open source its C++ server engine Sogou C++ Workflow, which not only achieves high performance and lightweight landing, but also introduces the concept of task flow to achieve unified and cooperative scheduling of computing and communication tasks.

According to reports, at present, the engine supports almost all Sogou's back-end C++ online services, including all search services, cloud input methods and online advertising, and processes tens of billions of requests every day.

Sogou C++ Workflow was designed with two core concepts of high performance and lightweight. For a long time, the optimization of server performance in the industry has mainly focused on how to run all cpu, how to make network requests respond quickly and so on. Sogou Workflow, which launched this time, is more focused on how to make all kinds of network resources managed by specific schedulers so that they can be dispatched as much as possible.

On the other hand, the solution of integrating multiple communication computing resources further improves the performance of the Workflow engine. In the past, when developers were faced with choosing a high throughput network framework, they needed to divide thread pools of different sizes in the face of different proportions of computing resources. However, the proportion of specific resource requirements for each calculation is dynamic, the importance is not the same, and the back-end response time is also dynamic. Sogou C++ Workflow enables C++ server engine to achieve asynchronous scheduling of network resources, and further open up computing and disk resources, just like Go language.

The biggest highlight of this project may be the innovative introduction of the concept of task flow. Sogou C++ Workflow highly encapsulates resources so that users no longer have access to connection pool and thread pool, including file fd and various asynchronous notification mechanisms when they want to do aio. This means that in the development phase, developers only need to understand business relationships without paying attention to internal details to help developers implement their own complex business logic.

Developers can use various tasks encapsulated by Sogou C++ Workflow to build their own business logic dynamically or statically. As shown in the following figure, different types of tasks can be put together serially and in parallel:

According to the information, in addition to various innovative designs, Sogou C++ Workflow also has a friendly user experience. Sogou C++ Workflow natively implements support for http, redis, mysql and kafka protocols, which can be directly used as clients of these protocols. And on the basis of it, a set of more easy-to-use Sogou RPC is developed, which interoperates with brpc and thrift, and can be realized across languages through http+json or IDL.

The development team revealed that the Sogou RPC project will also be open source in the near future.

Http Server performance measurement: Sogou C++ Workflow VS nginx, brpc

Sogou's team also provided http server performance comparisons between Sogou C++ Workflow and two mainstream systems, nginx and brpc.

Test environment:

The most basic test scenario is selected: wrk or wrk2 cross-machine client, single server, persistent connection, CPU:40 core E5-2630 v4 @ 2.20GHz, memory: 192GB, network card: 25000Mb/s. Nginx is configured with the number of processes in auto (consistent with the number of cores), and brpc is configured with 40 nthreads,workflow and 16 poller threads and 20 handler threads.

Test 1: the impact of different concurrency numbers on QPS (the higher the better)

Conclusion: with the increase of the number of concurrency of pressure test, the QPS of server will increase. You can see that in the case of Workflow with low concurrency or high concurrency, QPS is still higher than nginx and brpc, especially when the concurrency is more than 128. Workfow can basically guarantee 50w QPS for packets, indicating that a lot of internal optimizations have been made for high concurrency scheduling of network resources.

Test 2: the impact of different data sizes on QPS (the higher the better)

Conclusion: the size of the return packet here is the body size of the http request. As the return packet increases, the QPS will decrease. We hope that the QPS will remain as stable as possible and not drop too fast. The performance of Workflow under the same concurrency is still better than that of the other two systems, indicating that the scheduling between network transceivers and other calls is better.

Test 3: delay distribution CDF diagram under fixed QPS (the more left, the better, the straighter, the better)

At this point, I believe you have a deeper understanding of "what is the concept of task flow introduced into C++ server engine". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report