用例:
- 从一台服务器读取数据
- 在我的服务器上操作
- 将数据发布到其他服务器
但需要每分钟100万的吞吐量。
更多解释:-
假设有 10000 个客户,对于一个客户,我需要调用 5 个 API 并操作数据作为响应,操作后它将创建大约 30 个 API。我想将数据发布到其他服务器。
(假设:为 API 调用获取数据的服务器需要 250 毫秒,而我在其上发布数据的服务器需要 350 毫秒来发布 API 调用的数据。)
伪代码:
In every minute For each customers( there are 10000 customers):
Fetch data from first_server_for_first_service
Fetch data from first_server_for_second_service
Fetch data from first_server_for_third_service
Fetch data from first_server_for_fourth_service
Fetch data from first_server_for_fifth_service
Manipulate data of first_service
Manipulate data of second_service
Manipulate data of third_service
Manipulate data of fourth_service
Manipulate data of fifth_service
post data to second_server_for_first_service_1_type
post data to second_server_for_first_service_2_type
post data to second_server_for_first_service_3_type
post data to second_server_for_first_service_4_type
post data to second_server_for_first_service_5_type
post data to second_server_for_first_service_6_type
post data to second_server_for_second_service_1_type
post data to second_server_for_second_service_2_type
post data to second_server_for_second_service_3_type
post data to second_server_for_second_service_4_type
post data to second_server_for_second_service_5_type
post data to second_server_for_second_service_6_type
post data to second_server_for_third_service_1_type
post data to second_server_for_third_service_2_type
post data to second_server_for_third_service_3_type
post data to second_server_for_third_service_4_type
post data to second_server_for_third_service_5_type
post data to second_server_for_third_service_6_type
post data to second_server_for_fourth_service_1_type
post data to second_server_for_fourth_service_2_type
post data to second_server_for_fourth_service_3_type
post data to second_server_for_fourth_service_4_type
post data to second_server_for_fourth_service_5_type
post data to second_server_for_fourth_service_6_type
post data to second_server_for_fifth_service_1_type
post data to second_server_for_fifth_service_2_type
post data to second_server_for_fifth_service_3_type
post data to second_server_for_fifth_service_4_type
post data to second_server_for_fifth_service_5_type
post data to second_server_for_fifth_service_6_type
我们如何通过 Eventlet 编写代码,以便它可以并行执行这么多任务。还是 eventlet 能够执行这么多任务?
请回复。