1

n 番目のフィボナッチ数を出力する単純なサーバーに対して包囲をテストしています。curl を使用すると、サーバーはうまく機能します。

[mto@localhost ~]$ curl http://localhost:8000?q=8
21

攻城戦で同じことをすると、次の結果が得られます。

[mto@localhost ~]$ siege 'http://localhost:8000?q=8' -r 4 -c 1
** SIEGE 3.0.9
** Preparing 1 concurrent users for battle.
The server is now under siege...
HTTP/1.1 400   0.00 secs:      73 bytes ==> GET  /
HTTP/1.1 400   0.00 secs:      73 bytes ==> GET  /
HTTP/1.1 400   0.00 secs:      73 bytes ==> GET  /
HTTP/1.1 400   0.00 secs:      73 bytes ==> GET  /
done.

Transactions:                  4 hits
Availability:             100.00 %
Elapsed time:               1.01 secs
Data transferred:           0.00 MB
Response time:              0.00 secs
Transaction rate:           3.96 trans/sec
Throughput:             0.00 MB/sec
Concurrency:                0.00
Successful transactions:           0
Failed transactions:               0
Longest transaction:            0.00
Shortest transaction:           0.00

FILE: /home/mto/siege.log
You can disable this annoying message by editing
the .siegerc file in your home directory; change
the directive 'show-logfile' to false.

ご覧のとおり、サーバーは 400 を返しています。tornado で記述された私の Web サーバーは、次のように出力します。

[W 150311 16:58:20 web:1404] 400 GET / (127.0.0.1): Missing argument q
[W 150311 16:58:20 web:1811] 400 GET / (127.0.0.1) 0.85ms             
[W 150311 16:58:20 web:1404] 400 GET / (127.0.0.1): Missing argument q
[W 150311 16:58:20 web:1811] 400 GET / (127.0.0.1) 0.71ms             
[W 150311 16:58:20 web:1404] 400 GET / (127.0.0.1): Missing argument q
[W 150311 16:58:20 web:1811] 400 GET / (127.0.0.1) 0.72ms             
[W 150311 16:58:20 web:1404] 400 GET / (127.0.0.1): Missing argument q
[W 150311 16:58:20 web:1811] 400 GET / (127.0.0.1) 0.79ms             

クエリ パラメータを siege に渡すにはどうすればよいですか? Siege の man ページには次のように書かれています。

   ...
   You can pass parameters using GET much like you would in a web browser:

   www.haha.com/form.jsp?first=homer&last=simpson

   If you invoke the URL as a command line argument, you should probably place it in
   quotes.
   ...

URLを一重引用符、二重引用符、および引用符なしで配置しようとしました。また、ファイルに URL を書き込んで を使​​用して siege に渡しました-fが、うまくいきませんでした。私は使っている:

私の環境:

SIEGE 3.0.9
GNOME Terminal 3.10.2
Fedora release 20 (Heisenbug)

何か案は?

4

2 に答える 2