From 503541afd59826774a88e4554937df19139bafa5 Mon Sep 17 00:00:00 2001 From: brad Date: Mon, 6 Aug 2001 00:35:05 +0000 Subject: [PATCH] add http_load port -- http_load runs multiple HTTP fetches in parallel, to test the throughput of a web server. However unlike most such test clients, it runs in a single process, so it doesn't bog down the client machine. It can be configured to do HTTPS fetches as well. --- www/http_load/files/Makefile.bsd | 13 +++++++++ www/http_load/patches/patch-http_load_1 | 22 +++++++++++++++ www/http_load/patches/patch-http_load_c | 37 +++++++++++++++++++++++++ www/http_load/pkg/DESCR | 24 ++++------------ www/http_load/pkg/PLIST | 4 +-- 5 files changed, 79 insertions(+), 21 deletions(-) create mode 100644 www/http_load/files/Makefile.bsd create mode 100644 www/http_load/patches/patch-http_load_1 create mode 100644 www/http_load/patches/patch-http_load_c diff --git a/www/http_load/files/Makefile.bsd b/www/http_load/files/Makefile.bsd new file mode 100644 index 00000000000..82dbd124535 --- /dev/null +++ b/www/http_load/files/Makefile.bsd @@ -0,0 +1,13 @@ +# $OpenBSD: Makefile.bsd,v 1.1.1.1 2001/08/06 00:35:05 brad Exp $ + +PROG = http_load +SRCS = http_load.c timers.c + +CPPFLAGS+= -DUSE_SSL +LDADD += -lssl -lcrypto + +BINDIR = ${PREFIX}/bin +MANDIR = ${PREFIX}/man/cat + +.include + diff --git a/www/http_load/patches/patch-http_load_1 b/www/http_load/patches/patch-http_load_1 new file mode 100644 index 00000000000..0cadff30f42 --- /dev/null +++ b/www/http_load/patches/patch-http_load_1 @@ -0,0 +1,22 @@ +$OpenBSD: patch-http_load_1,v 1.1.1.1 2001/08/06 00:35:05 brad Exp $ +--- http_load.1.orig Fri Mar 30 22:42:13 2001 ++++ http_load.1 Sun Aug 5 18:45:02 2001 +@@ -8,6 +8,8 @@ http_load - multiprocessing http test cl + .RB [ -proxy + .IR host:port ] + .RB [ -verbose ] ++.RB [ -timeout ++.IR seconds ] + .RI ( + .BI -parallel + .IR N +@@ -46,6 +48,9 @@ to throttle its consumption of data to 3 + by modem users. + .PP + The -proxy flag lets you run http_load through a web proxy. ++.PP ++The -timeout flag specifies the amount of seconds to wait for request. ++Default is a compile-time define. (Usually -- 60 seconds). + .PP + The -verbose flag tells + .I http_load diff --git a/www/http_load/patches/patch-http_load_c b/www/http_load/patches/patch-http_load_c new file mode 100644 index 00000000000..426bd8e4b00 --- /dev/null +++ b/www/http_load/patches/patch-http_load_c @@ -0,0 +1,37 @@ +$OpenBSD: patch-http_load_c,v 1.1.1.1 2001/08/06 00:35:05 brad Exp $ +--- http_load.c.orig Thu Apr 5 21:07:27 2001 ++++ http_load.c Sun Aug 5 18:45:02 2001 +@@ -137,6 +137,7 @@ static int max_connections, num_connecti + + static char* argv0; + static int do_checksum, do_throttle, do_verbose, do_jitter, do_proxy; ++static int idle_secs = IDLE_SECS; + static float throttle; + static char* proxy_host; + static int proxy_port; +@@ -309,6 +310,16 @@ main( int argc, char** argv ) + *colon = '\0'; + } + } ++ else if ( strncmp( argv[argn], "-timeout", sizeof("-timeout") ) == 0 && argn + 1 < argc ) ++ { ++ idle_secs = atoi( argv[++argn] ); ++ if ( idle_secs < 1 ) ++ { ++ (void) fprintf( ++ stderr, "%s: timeout seconds must be at least 1\n", argv0 ); ++ exit( 1 ); ++ } ++ } + else + usage(); + ++argn; +@@ -456,6 +467,8 @@ usage( void ) + "usage: %s [-checksum] [-throttle] [-proxy host:port] [-verbose]\n", argv0 ); + (void) fprintf( stderr, + " -parallel N | -rate N [-jitter]\n" ); ++ (void) fprintf( stderr, ++ " -timeout N\n" ); + (void) fprintf( stderr, + " -fetches N | -seconds N\n" ); + (void) fprintf( stderr, diff --git a/www/http_load/pkg/DESCR b/www/http_load/pkg/DESCR index fb110748ad0..9a077dc2176 100644 --- a/www/http_load/pkg/DESCR +++ b/www/http_load/pkg/DESCR @@ -1,22 +1,8 @@ -http_load runs multiple http/https fetches in parallel, to test the -throughput of a web server. However unlike most such test clients, -it runs in a single process, so it doesn't bog down the client -machine. +http_load runs multiple HTTP fetches in parallel, to test the throughput +of a web server. -You give it a file containing a list of URLs that may be fetched, -a flag specifying how to start connections (either by rate or by -number of simulated users), and a flag specifying when to quit -(either after a given number of fetches or a given elapsed time). -There are also optional flags for checksums, throttling, and progress -reports. - -Sample run: - -% http_load -rate 2 -seconds 300 urls -591 fetches, 8 max parallel, 5.33606e+06 bytes, in 300 seconds -9028.87 mean bytes/connection -1.97 fetches/sec, 17786.9 bytes/sec -236.082 mean msecs/connect -256.73 mean msecs/first-response +However unlike most such test clients, it runs in a single process, so it +doesn't bog down the client machine. It can be configured to do HTTPS +fetches as well. WWW: ${HOMEPAGE} diff --git a/www/http_load/pkg/PLIST b/www/http_load/pkg/PLIST index 665c84d6a71..97273853f23 100644 --- a/www/http_load/pkg/PLIST +++ b/www/http_load/pkg/PLIST @@ -1,3 +1,3 @@ -@comment $OpenBSD: PLIST,v 1.1.1.1 2000/09/12 18:08:58 avsm Exp $ +@comment $OpenBSD: PLIST,v 1.1.1.2 2001/08/06 00:35:05 brad Exp $ bin/http_load -man/man1/http_load.1 +man/cat1/http_load.0