post 4.7 review

Download
by rbytes.net on

post is a highly configurable Web traffic generator and Web server benchmarking tool

License: GPL (GNU General Public License)
File size: 14K
Developer: Dan Goldwater
0 stars award from rbytes.net

post is a highly configurable Web traffic generator and Web server benchmarking tool. It has lots of features, and a command line interface.

This program sends requests to a web server. It is made for benchmarking a web server or web application.

To specify a URL to request, use any of these formats:
a) service://host:port/path
b) host:port/path
c) host
d) host:port
e) host/path
f) service://host/path
g) /path

You can specify a single url on the command line with '-u ', or put many of them in a file and use '-l '. in a file, put one url per line. comment lines start with '#'. currently, post data will be identical for all the url's. if service is specified, it is looked up in /etc/services.

The program can send any HTTP Method (GET, POST, HEAD, DELETE, etc).
When using POST, content data can be specified in one of three ways:
a) With '-d ' post data is on the command line
b) With '-f ' post data is read from
c) With neither flag, post data is read from STDIN

The program can repeatedly send the same request. ie, it sends the request and when the response is completed it repeats the procedure. using the '-r' option, you specify the number of times to send the request. with the '-i' option, you specify the amount of time (in seconds) to repeat for. with '-i', the request which is in-process when the timeout is reached is allowed to complete, and the program stops after that.

The '-k' option causes the 'Host:' header to be included in the request. specify the hostname to send, or specify '.' and the hostname used will be the one from the url specified with '-u'.

The '-j' option allows specifying arbitrary HTTP headers to include in the request. the '-j' option can be used multiple times to add multiple HTTP headers. Put the argument in quotes if the header has spaces in it. For example: -j 'Max-Forwards: 0' -j 'Pragma: no-cache'

The '-s' option limits data transfer rates to simulate real web clients with slow connections. Typical transfer rates:
modem: 3000
isdn: 10000

The '-t' option sets the timeout which defines a connect/read/write error. default is 15 seconds.

The '-e' option defines the behavior when the timeout is exceeded. by default, the current request is terminated and the next request is started, but using -e causes the program to exit after the first timeout/failure.

The '-y' option causes causes the program to randomly close the connection before
the request is completed. specify a number between 0.0 and 1.0 which is proportional to how often the client will randomly hangup. hangups may occur during send or receive, and occur proportional to the number of data packets sent. thus you may need to play around with the -c parameter a bit to find a reasonable hangup frequency.

The '-w' option causes the program to resolve the hostname before every post. normally, the hostname is resolved into ip-address once at the program start.

Signal Mode Operation
The program responds to the usr1 and usr2 signals allowing stopwatch-style operation of the statistics reporting.
1) run post with '-i' option. set to a large runtime
2) use 'kill -USR1' to reset the statistics
3) use 'kill -USR2' to print statistics
4) use 'kill -TSTP' to stop/start posting. (toggle switch)
5) use 'kill -TERM' to end program
steps 2,3,4 can be repeated during a single program run. if posting is stopped, statistics are reset when posting is started again.

* Benchmarking Client Mode Operation *
This mode is used when the post program will be managed by a benchmarking server. The port specified with '-c' is connected to, and the post program sends data on this port during operation. When in client mode operation, the signal mode operation is altered:
SIGUSR1 causes posting to start
SIGUSR2 causes posting to stop
other signals operate as before. the program will begin in the stopped state. at the completion of every request, the program sends a message to the benchmarking server. currently these are 1-byte bessages:
0x00 nothing
0x10 request successful
0x11 connect error
0x12 send error
0x13 receive error
0x14 server error
0x15 disconnect error
0x16 send hangup
0x17 receive hangup

post 4.7 keywords