View Problem Report: 9593
Audit Trail:
From: "Jay McCarthy" <jay.mccarthy@gmail.com>
To: simon@joyful.com, bugs@plt-scheme.org
Cc:
Subject: Re: [plt-bug] all/9593: intermittent "Connection reset by peer" with web server on mac
Date: Wed, 9 Jul 2008 14:36:32 -0400
How many file descriptors did you allow the server process?
Jay
On Wed, Jul 9, 2008 at 1:32 PM, <simon@joyful.com> wrote:
> A new problem report is waiting at
> http://bugs.plt-scheme.org/query/?cmd=view&pr=9593
>
> Reported by Simon Michael for release: 4.0.2
>
> *** Description:
> CC'd from mail list. With the systems programming tutorial or plt-web-server, running mzscheme 4.0.2 on mac osx leopard, I observe intermittent connection failures when making concurrent connections.
>
> *** How to repeat:
> Eg this fails pretty often, perhaps one time in four:
>
> ab -n 1000 -c 100 http://localhost:8080/
>
> with:
>
> === context ===
> /Users/simon/src/serve.ss:36:0: handle
> /Users/simon/src/serve.ss:23:12
>
> regexp-match: expects type <string, byte string, or input port> as 2nd argument, given: #<eof>; other arguments were: #rx"^GET (.+) HTTP/[0-9]+\\.[0-9]+"
>
> With plt-web-server I see:
>
> output-file: tcp-write: error writing (Broken pipe; errno=32) File a PLT bug report if this is on a live server!
>
> *** Environment:
> macosx "Darwin pool-71-104-90-64.lsanca.dsl-w.verizon.net 9.4.0 Darwin Kernel Version 9.4.0: Mon Jun 9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386 i386 i386" (i386-macosx/3m) (get-display-depth) = 32
> Human Language: english
> (current-memory-use) 45654624
>
> Collections:
> (("/Users/simon/Library/PLT Scheme/4.0.2/collects" non-existent-path) ("/Applications/PLT Scheme v4.0.2/collects" "afm" "algol60" "browser" "combinator-parser" "compiler" "config" "defaults" "drscheme" "dynext" "embedded-gui" "eopl" "errortrace" "ffi" "file" "framework" "frtime" "games" "graphics" "gui-debugger" "help" "hierlist" "htdch" "htdp" "html" "icons" "info-domain" "lang" "launcher" "lazy" "macro-debugger" "make" "mred" "mrlib" "mysterx" "mzcom" "mzlib" "mzscheme" "net" "openssl" "parser-tools" "planet" "plot" "preprocessor" "profj" "r5rs" "r6rs" "readline" "rnrs" "s-exp" "scheme" "scribble" "scribblings" "setup" "sgl" "slatex" "slideshow" "srfi" "stepper" "string-constants" "swindle" "syntax" "syntax-color" "teachpack" "test-box-recovery" "test-engine" "tex2page" "texpict" "trace" "typed-scheme" "version" "web-server" "wxme" "xml"))
> Computer Language: (("Legacy Languages" "Pretty Big (includes MrEd and Advanced Student)") #(#t write mixed-fraction-e #f #t debug #t))
>
>
--
Jay McCarthy <jay.mccarthy@gmail.com>
http://jay.teammccarthy.org
From: Simon Michael <simon@joyful.com>
To: Jay McCarthy <jay.mccarthy@gmail.com>
Cc: bugs@plt-scheme.org
Subject: Re: [plt-bug] all/9593: intermittent "Connection reset by peer" with web server on mac
Date: Wed, 9 Jul 2008 13:46:33 -0700
Ah, I was ignoring serve.ss.
That seems to be the culprit! Increasing that to at least the number
of concurrent ab requests seems to make serve.ss reliable. I don't
understand why it (and plt-web-server) give the errors described, or
how the tutorial should steer clear of this pitfall, but hopefully
this is some help. Due to some system troubles I might not be able to
respond further today. Thanks - Simon
On Jul 9, 2008, at 12:47 PM, Jay McCarthy wrote:
> That's the parameter to tcp-listen in your serve.ss
>
> On Wed, Jul 9, 2008 at 3:28 PM, Simon Michael <simon@joyful.com>
> wrote:
>>> Change the "5" on the max-allow and see if you get much of a
>>> difference?
From: Simon Michael <simon@joyful.com>
To: Matthew Flatt <mflatt@cs.utah.edu>
Cc: plt-scheme@list.cs.brown.edu
Subject: all/9593 Re: [plt-scheme] intermittent "Connection reset by peer" with web server on mac
Date: Wed, 9 Jul 2008 17:45:39 -0700
On Jul 9, 2008, at 5:11 PM, Matthew Flatt wrote:
>
> But if I replace the 5 passed to `tcp-listen' with 100 or more ---
> making the TCP listener "backlog" larger than the number of attempted
> concurrent connections --- then I'm unable to trigger the "Connection
> reset by peer" error in the original server and `ab' configuration. If
> I then raise the `ab' concurrency to 200, the errors come back.
That's what I see -
> (According to system headers, the maximum backlog value in Leopard is
> 128, so it doesn't help to pass a larger value to `tcp-listen'.)
Ah, good to know.
> confirm that with a ListenBackLog setting of 50 (instead of the
> default
> 511), Apache also leads to "Connection reset by peer" errors from
> `ab'.
Interesting. Even more interesting, I can repeatably kill OS X by
testing this stuff. Eg with tcp-listen's queue increased to 100 and
running ab -n 10000 -c 100 ... a few times, I will pretty soon see
either a freeze with a "you must reboot" screen, or a reboot without
warning. Is it just me ? I do have third-party ram in this macbook.
Class changed from "sw-bug" to "not-a-bug" by jay at Mon, 16 Mar 2009 15:30:27 -0400
Reason>>> This error is harmless and squelching it would be a special case that would
block interesting error messages
State changed from "open" to "closed" by jay at Mon, 16 Mar 2009 15:30:27 -0400
Reason>>> See class