英文:
Multiple Simultaneous API calls in C#
问题
我正在尝试对使用Dapper调用存储过程并进行大量验证的端点进行压力测试。我的想法是了解它如何处理同时发送的大约1000个API调用。
请注意,这是一个Get端点。
有什么建议吗?
我尝试使用线程池,但它不能同时运行1000个线程,我也考虑过任务(Task),但效果也一样,而对于循环来说,不适合任务或其他任何方法,因为仍然会存在每个方法运行之间的时间差异。
英文:
I am trying to stress test my Endpoint which works with dapper that calls procedure and has a lot of validation. Idea is to know how it can handle like 1000 API calls that was sent at the same time.
Note that it is Get Endpoint
Any idea?
I tried using thread pool, but it would not run 1000 of them at the same time, also I thought about Task but it was same here, also for loop is not option with tasks or anything else, because there still will be the time difference between each method run.
答案1
得分: 1
我建议使用专用的负载测试工具,如K6或Bombardier。
您可以在本地或云中运行所有基础架构,包括要测试的服务/系统,然后使用负载测试工具来测试您的服务。
PS:如果只需要快速进行HTTPGET端点调用,使用Bombardier可能更容易。
英文:
I would suggest using dedicated load testing tools like K6 or Bombardier.
You run all your infrastructure including the service/system you are tryng to test locally or in cloud and then run the load testing tools against your service.
PS: Bombardier might be easier if you just have to make quick HTTPGET endpoint calls
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论