Little stress tests

This commit is contained in:
Jay McCarthy 2010-10-11 10:40:57 -06:00
parent 39541c51b5
commit e8ceade2a5
4 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1 @@
/static.txt

View File

@ -0,0 +1,16 @@
dyn-server: dynamic.rkt
ulimit -n 10000
racket -t dynamic.rkt
static.txt: dynamic.rkt
wget http://localhost:8000 -O static.txt
stat-server: static.txt static.rkt
ulimit -n 10000
racket -t static.rkt
dyn-httperf:
httperf --hog --server localhost --port=8000 --rate=6000 --num-conn=5 --num-calls=1000
stat-httperf:
httperf --hog --server localhost --port=8000 --rate=6000 --num-conn=5 --num-calls=1000

View File

@ -0,0 +1,14 @@
#lang racket/base
(require web-server/servlet-env)
(define (fac n a)
(if (zero? n) a
(fac (sub1 n) (* n a))))
(define (start req)
(number->string (fac 10 1)))
(serve/servlet start
#:servlet-regexp #rx""
#:port 8000
#:command-line? #t)

View File

@ -0,0 +1,13 @@
#lang racket/base
(require web-server/servlet-dispatch
racket/runtime-path
web-server/dispatchers/dispatch-files)
(define-runtime-path static-path "static.txt")
(serve/launch/wait
(λ (sema)
(make #:url->path (λ (url) (values static-path null))))
#:launch-path #f
#:banner? #f
#:port 8001)