卷曲超过 100K 请求

发布于 2024-12-23 07:46:22 字数 356 浏览 2 评论 0原文

我正在使用curl_multi_exec 处理超过100K 的请求。我一次执行 100 个请求,因为curl_multi_exec 一次只能处理 10 个请求,最终达到 100K 请求。我们向该系统添加了多个服务器来分散负载[我们正在使用负载平衡]。让curl 处理100K 请求并利用这些额外服务器的最佳方法是什么?在一台服务器上处理这么多请求有什么缺点(除了时间之外)?如何使用额外的服务器来帮助处理这些请求?

详细来说,基本上,我们使用curl 向第三方服务器发送超过100K 的请求。仅使用 1 台服务器的问题是 1 台服务器可以处理的请求数量存在内存限制。所以我们决定添加额外的服务器,但我们不确定如何设计这个系统以使用curl来处理这么多请求..

谢谢!

I am using curl_multi_exec to process over 100K requests. I do 100 requests at a time because curl_multi_exec can only handle 10- requests at a time to eventually get to 100K requests. We've added multiple servers to this system to spread the load [we are using load balancing]. What is the best way to have curl handle 100K requests and make use of these additional servers? What's the downside (other than time) of handling that many requests on one server? How can I use the additional servers to help handle those requests?

To elaborate- basically, we are using curl to send out over 100K requests to third party servers. The problem with only using 1 server is that there is a memory limit in the number of requests 1 server can handle. So we decided to add additional servers, but we are not sure how to design this system to use curl to handle that many requests..

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌上芳菲 2024-12-30 07:46:22

不要沉迷于 CURL。它只是一个工具。您关注的是错误的设计级别。

您需要考虑的是如何将此工作负载分散到多个服务器之间。一个简单的设计应该有一个中央数据库,列出您的所有网址,以及一种供客户端“签出”一个网址(或一组网址)以继续使用的方法。

一旦你完成了这项工作,卷曲部分将是其中最简单的部分。

Don't obsess about CURL. It's simply a tool. You're focusing on the wrong level of design.

What you need to consider is how to spread this workload amongst multiple servers. A simple design would have one central database listing all your urls, and a method for clients to "check out" a url (or set of urls) to chug away on.

Once you've got that working, the curl portion will be the easiest part of it all.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文