ApacheBench resulta em um arquivo

1

Eu gostaria de salvar a ferramenta ApacheBench (ab) no linux em um arquivo. Quando eu corro com -v 2 ele exibe alguns resultados na minha janela ssh. Como mover esses dados para um arquivo e ter certeza de que eles não serão exibidos no ssh? Eu tentei > file.txt 2 > & 1 mas ele não funciona e ainda exibe dados na minha janela ssh.

Eu uso:

ab -n 10000 -c 200 http://mywebsite.com > file.txt 2>&1
    
por Tomasz Smykowski 13.02.2010 / 09:24

1 resposta

4

Desculpe, nada aqui, mas poo de gato.

Eu noto que o ab não funciona para mim a menos que o URL tenha um nome de arquivo ou um / no final.

Os erros ainda vão para o arquivo.

É isso que você está fazendo? (em algo diferente de localhost, é claro)

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

Veja, nada.

Está tudo no cocô de gato.

Com -v2 você recebe muitos desses em poo de gato

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

Caso contrário, sem -v2, parece com isso

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:~$ 
    
por 13.02.2010 / 13:46