如何使用cURL执行多个同时请求? [英] How do I use cURL to perform multiple simultaneous requests?

查看:1814
本文介绍了如何使用cURL执行多个同时请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 cURL 在我的服务器上测试洪水处理。现在我在Windows命令行上使用这个:

I'd like to use cURL to test flood handling on my server. Right now I'm using this on a Windows command line:

curl www.example.com

这将 GET 页面一次。我现在想做同样的事情,除了而不是一个请求,我想同时生成至少10个请求。

which will GET the page once. I'd like to now do the same thing, except instead of one request, I want to generate at least 10 requests at once. How would I do this?

推荐答案

虽然curl是一个非常有用和灵活的工具,但不适用于这种类型的使用。还有其他工具可以让您对同一个URL发出多个并发请求。

While curl is a very useful and flexible tool, isn't intended for this type of use. There are other tools available which will let you make multiple concurrent requests to the same URL.

ab 是一个非常简单但有效的这种类型的工具,它适用于任何Web服务器(尽管引入关注Apache服务器)。

ab is a very simple yet effective tool of this type, which works for any web server (despite the introduction focusing on Apache server).

Grinder 是一个更复杂的工具,可以让您指定许多不同的网址以在加载测试中使用。这样,您就可以针对便宜又昂贵的网页混合请求,这些网页可能更接近您网站的标准负载。

Grinder is a more sophisticated tool, which can let you specify many different URLs to use in a load test. This lets you mix requests for cheap and expensive pages, which may more closely resemble standard load for your website.

这篇关于如何使用cURL执行多个同时请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆