Hi Tim, I ran an experiment to test your servlet. The results are at this gist:
https://gist.github.com/jeapostrophe/f7fd1e48be19300b7b15 You'll see that I ran it with serve/servlet, benchmarked with % ab -n 50 -c 5 http://localhost:9000/test 2>&1 | tee ab.log and that I got the expected number of 5 concurrent requests serviced at a time. There is a bare possibility that it is working on OS X/my machine and not on yours, but I am more suspect of how you tested concurrency. Jay On Mon, Apr 27, 2015 at 12:50 PM, Tim Brown <tim.br...@cityc.co.uk> wrote: > Folks, I'm stuck! > > I have a servlet that wants to do the following: > > ;;----------------------------------------------------------- > (define (start req) > (define request-start/s (current-seconds)) > (printf "REQUEST @ ~a~%" request-start/s) > ;; long I/O, fetch from a web service or some such > (thread-wait (thread (λ () (sleep 10)))) > (define request-end/s (current-seconds)) > (begin0 > (response/full > 200 > #"Okay" > request-end/s > #"text/plain" > null > (list (string->bytes/utf-8 > (format "request/response interval ~a -> ~a" > request-start/s request-end/s)))) > (printf "RESPONSE @ ~a :: ~a~%" request-end/s #f))) > ;;----------------------------------------------------------- > > No matter what I do my clients are serviced sequentially. I have tried: > - using the plt-web-server > - #lang web-server and racket command line > - #lang web-server and drracket. > > REQUEST @ 1430151106 > RESPONSE @ 1430151116 :: #f > REQUEST @ 1430151116 > RESPONSE @ 1430151126 :: #f > > So, a pair of requests which could be serviced in 10s + a tiny bit are > taking 20s. > > How do I serve this servlet so that it handles requests in parallel. > > Thanks in advance, > > Tim > > -- > Tim Brown CEng MBCS <tim.br...@cityc.co.uk> > ======================================================================== > City Computing Limited · www.cityc.co.uk > City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB > T:+44 20 8770 2110 · F:+44 20 8770 2130 > ------------------------------------------------------------------------ > City Computing Limited registered in London No:1767817. > Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE > VAT No: GB 918 4680 96 > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Jay McCarthy http://jeapostrophe.github.io "Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great." - D&C 64:33 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.