Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 并发curl POST请求_Bash_Shell_Unix_Concurrency - Fatal编程技术网

Bash 并发curl POST请求

Bash 并发curl POST请求,bash,shell,unix,concurrency,Bash,Shell,Unix,Concurrency,创建并发curl请求的最快方法是什么?我有一个应用程序,它接受POST请求,并想做一些负载测试 我希望同时运行以下cURL命令,而不是按顺序运行 curl -d "param1=value1&param2=value2" http://example.com/test 谢谢我不是很有信心,但会在后台产生多个进程吗 nohup curl -parameters & 对于负载测试,您可能需要多线程之类的工具,您可能还需要研究已有的工具。如何?您可能已经安装了它。我使用编写的一些

创建并发curl请求的最快方法是什么?我有一个应用程序,它接受POST请求,并想做一些负载测试

我希望同时运行以下cURL命令,而不是按顺序运行

 curl -d "param1=value1&param2=value2" http://example.com/test

谢谢

我不是很有信心,但会在后台产生多个进程吗

nohup curl -parameters &
对于负载测试,您可能需要多线程之类的工具,您可能还需要研究已有的工具。

如何?您可能已经安装了它。

我使用编写的一些小perl脚本来完成这类工作(生成并发POST请求):


我计划将其移植到python,但perl版本目前运行得很好。

+1。非常容易使用apache bench,只需下载apache源代码,编译它,进入bin并使用以下命令作为示例ab-n 100000-c 450-T'application/x-www-form-urlencoded'-p goodjson.txt http://yourwebsitetohit/Scripting语言可以很好地处理这些类型的事情——Ruby、Python、Perl。我可以用Ruby写几行这样的东西。。。