ApacheBench产生一个文件

我想将Apache上的ApacheBench(ab)工具保存到一个文件中。 当我用-v 2运行它时,它会在我的ssh窗口中显示一些结果。 如何将这些数据移动到一个文件,并确保它不会显示在SSH上? 我试过> file.txt 2>&1,但它不工作,仍然显示在我的SSH窗口中的数据。

我用:

ab -n 10000 -c 200 http://mywebsite.com > file.txt 2>&1 

对不起,没有什么,只是猫便便。

我注意到,ab不工作,除非我的url有一个文件名或/在最后。

尽pipe如此,错误仍然存​​在于文件中。

这是你在做什么? (当然,除了localhost以外)

 pjb@pjb-desktop:~$ ssh localhost -l pjb pjb@localhost's password: Linux pjb-desktop 2.6.31-19-server #56-Ubuntu SMP Thu Jan 28 03:40:48 UTC 2010 x86_64 To access official Ubuntu documentation, please visit: http://help.ubuntu.com/ Last login: Sat Feb 13 04:37:53 2010 from localhost pjb@pjb-desktop:~$ ab -v 2 -n 10000 -c 200 http://localhost/ > poo 2>&1 

什么也看不见。

这一切都在猫的便便。

用-v2你在猫便便中得到了很多

 This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient) INFO: POST header == --- GET / HTTP/1.0 Host: localhost User-Agent: ApacheBench/2.3 Accept: */* --- LOG: header received: HTTP/1.1 200 OK Date: Sat, 13 Feb 2010 12:56:45 GMT Server: Apache/2.2.12 (Ubuntu) Last-Modified: Tue, 17 Feb 2009 09:18:13 GMT ETag: "120175-2d-46319c8521f40" Accept-Ranges: bytes Content-Length: 45 Connection: close 

否则没有-v2它看起来像这样

 pjb@pjb-desktop:~$ cat poo This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking localhost (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests Server Software: Apache/2.2.12 Server Hostname: localhost Server Port: 80 Document Path: / Document Length: 45 bytes Concurrency Level: 200 Time taken for tests: 1.477 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 2980894 bytes HTML transferred: 450135 bytes Requests per second: 6772.68 [#/sec] (mean) Time per request: 29.530 [ms] (mean) Time per request: 0.148 [ms] (mean, across all concurrent requests) Transfer rate: 1971.55 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.6 0 6 Processing: 4 17 107.8 9 1467 Waiting: 4 17 107.9 9 1467 Total: 6 18 108.1 9 1471 Percentage of the requests served within a certain time (ms) 50% 9 66% 9 75% 9 80% 9 90% 10 95% 11 98% 13 99% 15 100% 1471 (longest request) pjb@pjb-desktop:~$