From luislavena at gmail.com Sat Dec 8 12:57:32 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 8 Dec 2007 14:57:32 -0300 Subject: [Mongrel-development] Small updates and release plan Message-ID: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> Hello Guys, I'll like to suggest a small release fix before we start doing big changes: platform fixes. Current we're setting MSWIN32 (mswin32) as platform for Windows gem, but we should be using Gem::Platform::CURRENT instead (i386-mswin32 as current Ruby windows implementation). Also, the jruby/java platform need to be defined. That change will ease the compatibility path with now launched 0.9.5 version of rubygems, which currently make our lifes too difficult :-P I plan to work on this next week and make 0.9.5 install correct version of prepackaged mongrel gems. If these changes need to be made on rubygems besides mongrel sides, I'll bug Eric Hodel to push forward a small 0.9.5.1 release to solve this. I hope it pays me attention (on the contrary of Ryan Davis that just ignores my patches since september!) :-P Regards guys and talk later. Nice weekend everybody. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From evan at cloudbur.st Sat Dec 8 18:00:43 2007 From: evan at cloudbur.st (Evan Weaver) Date: Sat, 8 Dec 2007 18:00:43 -0500 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> Message-ID: Sounds good. I've been wanting to do a 1.1.2 release for a while but haven't gotten to it. There's a change related to return a proxy error code (or something) that Wayne checked it that needs to be temporarily reverted. It's too significant for a point release and it doesn't have tests right now. Evan On Dec 8, 2007 12:57 PM, Luis Lavena wrote: > Hello Guys, > > I'll like to suggest a small release fix before we start doing big > changes: platform fixes. > > Current we're setting MSWIN32 (mswin32) as platform for Windows gem, > but we should be using Gem::Platform::CURRENT instead (i386-mswin32 as > current Ruby windows implementation). > > Also, the jruby/java platform need to be defined. That change will > ease the compatibility path with now launched 0.9.5 version of > rubygems, which currently make our lifes too difficult :-P > > I plan to work on this next week and make 0.9.5 install correct > version of prepackaged mongrel gems. > If these changes need to be made on rubygems besides mongrel sides, > I'll bug Eric Hodel to push forward a small 0.9.5.1 release to solve > this. > > I hope it pays me attention (on the contrary of Ryan Davis that just > ignores my patches since september!) :-P > > Regards guys and talk later. Nice weekend everybody. > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From luislavena at gmail.com Sat Dec 8 18:26:18 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 8 Dec 2007 20:26:18 -0300 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> Message-ID: <71166b3b0712081526u3bab8f64k1fc864e21a698cb@mail.gmail.com> On Dec 8, 2007 8:00 PM, Evan Weaver wrote: > Sounds good. I've been wanting to do a 1.1.2 release for a while but > haven't gotten to it. > > There's a change related to return a proxy error code (or something) > that Wayne checked it that needs to be temporarily reverted. It's too > significant for a point release and it doesn't have tests right now. > I'll take a look to the new code and maybe create some test for it. Was the code from a ticket? Maybe that could help me understand better the idea behind it. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From dave at cheney.net Sat Dec 8 20:49:17 2007 From: dave at cheney.net (Dave Cheney) Date: Sun, 9 Dec 2007 12:49:17 +1100 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <71166b3b0712081526u3bab8f64k1fc864e21a698cb@mail.gmail.com> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <71166b3b0712081526u3bab8f64k1fc864e21a698cb@mail.gmail.com> Message-ID: <4A72C38D-413D-47AF-A7C1-AA9DB56EC403@cheney.net> That would probably be my patch that I submitted on ticket 15664, http://rubyforge.org/tracker/index.php?func=detail&aid=15664&group_id=1306&atid=5145 which tries to send a 400 Bad Response in response to a HttpParseException. Cheers Dave On 09/12/2007, at 10:26 AM, Luis Lavena wrote: > On Dec 8, 2007 8:00 PM, Evan Weaver wrote: >> Sounds good. I've been wanting to do a 1.1.2 release for a while but >> haven't gotten to it. >> >> There's a change related to return a proxy error code (or something) >> that Wayne checked it that needs to be temporarily reverted. It's too >> significant for a point release and it doesn't have tests right now. >> > > I'll take a look to the new code and maybe create some test for it. > Was the code from a ticket? Maybe that could help me understand better > the idea behind it. > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development From luislavena at gmail.com Sun Dec 9 12:49:46 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sun, 9 Dec 2007 14:49:46 -0300 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <4A72C38D-413D-47AF-A7C1-AA9DB56EC403@cheney.net> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <71166b3b0712081526u3bab8f64k1fc864e21a698cb@mail.gmail.com> <4A72C38D-413D-47AF-A7C1-AA9DB56EC403@cheney.net> Message-ID: <71166b3b0712090949s7051d5c9j99e489170799f889@mail.gmail.com> On Dec 8, 2007 10:49 PM, Dave Cheney wrote: > That would probably be my patch that I submitted on ticket 15664, > > http://rubyforge.org/tracker/index.php?func=detail&aid=15664&group_id=1306&atid=5145 > > which tries to send a 400 Bad Response in response to a > HttpParseException. > Thank you Dave, I'll take a look during the week and maybe came with a test that stress the issue. Or, if you already wrote some, please share :-D Regards and have a nice weekend. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wayneeseguin at gmail.com Sun Dec 9 22:55:02 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sun, 9 Dec 2007 22:55:02 -0500 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> Message-ID: On Dec 8, 2007 6:00 PM, Evan Weaver wrote: > Sounds good. I've been wanting to do a 1.1.2 release for a while but > haven't gotten to it. > > There's a change related to return a proxy error code (or something) > that Wayne checked it that needs to be temporarily reverted. It's too > significant for a point release and it doesn't have tests right now. > > Evan > If memory serves (and it usually doesn't) that change wasn't major? ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071209/09924aa5/attachment.html From evan at cloudbur.st Mon Dec 10 10:56:28 2007 From: evan at cloudbur.st (Evan Weaver) Date: Mon, 10 Dec 2007 10:56:28 -0500 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> Message-ID: It's not a big change in terms of LOC but it will affect how your load balancer operates, and that seems significant to me. Evan On Dec 9, 2007 10:55 PM, Wayne E. Seguin wrote: > On Dec 8, 2007 6:00 PM, Evan Weaver wrote: > > > Sounds good. I've been wanting to do a 1.1.2 release for a while but > > haven't gotten to it. > > > > There's a change related to return a proxy error code (or something) > > that Wayne checked it that needs to be temporarily reverted. It's too > > significant for a point release and it doesn't have tests right now. > > > > Evan > > > > > > > > If memory serves (and it usually doesn't) that change wasn't major? > > ~Wayne > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > > -- Evan Weaver Cloudburst, LLC From dave at cheney.net Mon Dec 10 15:11:38 2007 From: dave at cheney.net (Dave Cheney) Date: Tue, 11 Dec 2007 07:11:38 +1100 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> Message-ID: <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> Yes - it means using nginx as a proxy to mongrel will actually work ! The current behavior 'stuns' nginx every time mongrel decides it doesn't like the request as passed (which is fair, nginx isn't as strict in its request parsing as mongrel) causing it to try every mongrel in the balancer group in quick succession. The patch makes mongrel behave correctly according to the spec and report the correct error rather than relying on nginx to pass back a 50x when there are no mongrel left. Cheers Dave On 11/12/2007, at 2:56 AM, Evan Weaver wrote: > It's not a big change in terms of LOC but it will affect how your load > balancer operates, and that seems significant to me. > > Evan From luislavena at gmail.com Mon Dec 10 15:24:38 2007 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 10 Dec 2007 17:24:38 -0300 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> Message-ID: <71166b3b0712101224j446a19aasae50608f798524ae@mail.gmail.com> On Dec 10, 2007 5:11 PM, Dave Cheney wrote: > Yes - it means using nginx as a proxy to mongrel will actually work ! > > The current behavior 'stuns' nginx every time mongrel decides it > doesn't like the request as passed (which is fair, nginx isn't as > strict in its request parsing as mongrel) causing it to try every > mongrel in the balancer group in quick succession. The patch makes > mongrel behave correctly according to the spec and report the correct > error rather than relying on nginx to pass back a 50x when there are > no mongrel left. > So in theory this patch fix the nginx behavior, but how this affects other balancers like apache one? (I know is broken, but couldn't miss the importance). Based on RFC rules [1], it seems is the correct behavior instead of the unexpected close of the connection. Adding some test to the malformed requests doesn't seem problematic, but I'll love some feedback on cross-balancer results (apache, balancer, delegate, etc). [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4 Later, -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wayneeseguin at gmail.com Mon Dec 10 18:30:15 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Mon, 10 Dec 2007 18:30:15 -0500 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <71166b3b0712101224j446a19aasae50608f798524ae@mail.gmail.com> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> <71166b3b0712101224j446a19aasae50608f798524ae@mail.gmail.com> Message-ID: On Dec 10, 2007 3:24 PM, Luis Lavena wrote: > On Dec 10, 2007 5:11 PM, Dave Cheney wrote: > > Yes - it means using nginx as a proxy to mongrel will actually work ! > > > > The current behavior 'stuns' nginx every time mongrel decides it > > doesn't like the request as passed (which is fair, nginx isn't as > > strict in its request parsing as mongrel) causing it to try every > > mongrel in the balancer group in quick succession. The patch makes > > mongrel behave correctly according to the spec and report the correct > > error rather than relying on nginx to pass back a 50x when there are > > no mongrel left. > > > > So in theory this patch fix the nginx behavior, but how this affects > other balancers like apache one? (I know is broken, but couldn't miss > the importance). > > Based on RFC rules [1], it seems is the correct behavior instead of > the unexpected close of the connection. > > Adding some test to the malformed requests doesn't seem problematic, > but I'll love some feedback on cross-balancer results (apache, > balancer, delegate, etc). > > [1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4 > Good question, Dave, are you able to test other balancers? ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071210/345249db/attachment.html From zedshaw at zedshaw.com Mon Dec 10 19:52:51 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 10 Dec 2007 19:52:51 -0500 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> Message-ID: <20071210195251.1d91259d.zedshaw@zedshaw.com> On Tue, 11 Dec 2007 07:11:38 +1100 Dave Cheney wrote: > Yes - it means using nginx as a proxy to mongrel will actually work ! > > The current behavior 'stuns' nginx every time mongrel decides it > doesn't like the request as passed (which is fair, nginx isn't as > strict in its request parsing as mongrel) causing it to try every > mongrel in the balancer group in quick succession. The patch makes > mongrel behave correctly according to the spec and report the correct > error rather than relying on nginx to pass back a 50x when there are > no mongrel left. Which part of the spec? 'Cause last time I looked that part of the spec only applied to a webserver talking to a client. NOT to a proxy server which, if written correctly, should try the next server when the one it just tried dies. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From luislavena at gmail.com Mon Dec 10 20:31:34 2007 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 10 Dec 2007 22:31:34 -0300 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <20071210195251.1d91259d.zedshaw@zedshaw.com> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> <20071210195251.1d91259d.zedshaw@zedshaw.com> Message-ID: <71166b3b0712101731y64596a7flbbcf3b3180d095e9@mail.gmail.com> On Dec 10, 2007 9:52 PM, Zed A. Shaw wrote: > > Which part of the spec? 'Cause last time I looked that part of the spec only applied to a webserver talking to a client. NOT to a proxy server which, if written correctly, should try the next server when the one it just tried dies. > So we should forward this issue to nginx developers instead to fix this in your side. I'll like to know how apache or ay other proxy/delegator behave under this circumstance. And for the record, from the log reported in the ticket, it seems the client is asking a malformed URL, shouldn't the proxy take actions about that? -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Mon Dec 10 20:22:29 2007 From: filipe at icewall.org (Filipe) Date: Mon, 10 Dec 2007 23:22:29 -0200 (BRST) Subject: [Mongrel-development] Small updates and release plan In-Reply-To: <20071210195251.1d91259d.zedshaw@zedshaw.com> References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> <20071210195251.1d91259d.zedshaw@zedshaw.com> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, 10 Dec 2007, Zed A. Shaw wrote: > On Tue, 11 Dec 2007 07:11:38 +1100 > Dave Cheney wrote: > >> Yes - it means using nginx as a proxy to mongrel will actually work ! >> >> The current behavior 'stuns' nginx every time mongrel decides it >> doesn't like the request as passed (which is fair, nginx isn't as >> strict in its request parsing as mongrel) causing it to try every >> mongrel in the balancer group in quick succession. The patch makes >> mongrel behave correctly according to the spec and report the correct >> error rather than relying on nginx to pass back a 50x when there are >> no mongrel left. > > Which part of the spec? 'Cause last time I looked that part of the spec only applied to a webserver talking to a client. NOT to a proxy server which, if written correctly, should try the next server when the one it just tried dies. Who invited this Zed-guy to the list? He is just spreading FUD around here :) Anyway, the return code is defined in [1]. you know, it's not because your code works right(TM) that all code in the world will work ok too... and implementing this even clients will display the correct HTML code. 1. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1 Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHXeZimKFbPqa6Qj4RAh2jAJ9GWIb6fJgX3ubHWfnYeQGZn05fBACcDsTH +7ZuWtyxTc0Pn2bw5HbhuK0= =+MNQ -----END PGP SIGNATURE----- From luislavena at gmail.com Mon Dec 10 21:00:16 2007 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 10 Dec 2007 23:00:16 -0300 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> <20071210195251.1d91259d.zedshaw@zedshaw.com> Message-ID: <71166b3b0712101800x5dec5b93m5b9a0576e82627d5@mail.gmail.com> On Dec 10, 2007 10:22 PM, Filipe wrote: > > Who invited this Zed-guy to the list? He is just spreading FUD around here :) > Zed was the owner of the circus, we are just pets on the show ;-) > Anyway, the return code is defined in [1]. you know, it's not because > your code works right(TM) that all code in the world will work ok > too... and implementing this even clients will display the correct > HTML code. > > 1. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1 > A bit above that: Quote: 10.4 Client Error 4xx The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user. == As Zed commented, a client, not a proxy. Quote: If the client is sending data, a server implementation using TCP SHOULD be careful to ensure that the client acknowledges receipt of the packet(s) containing the response, before the server closes the input connection. If the client continues sending data to the server after the close, the server's TCP stack will send a reset packet to the client, which may erase the client's unacknowledged input buffers before they can be read and interpreted by the HTTP application. === Again, I'll *love* to know how apache or any other balancer handle this edge case. (with love I mean, more feedback besides nginx) :-D -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Mon Dec 10 21:20:59 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Mon, 10 Dec 2007 21:20:59 -0500 Subject: [Mongrel-development] Small updates and release plan In-Reply-To: References: <71166b3b0712080957n2da02c0dpbd3af763f6eadf8b@mail.gmail.com> <7111CCF2-6C8F-4D89-8A32-9BBB1D327CC8@cheney.net> <20071210195251.1d91259d.zedshaw@zedshaw.com> Message-ID: <20071210212059.63d7b14d.zedshaw@zedshaw.com> On Mon, 10 Dec 2007 23:22:29 -0200 (BRST) Filipe wrote: > Anyway, the return code is defined in [1]. you know, it's not because > your code works right(TM) that all code in the world will work ok > too... and implementing this even clients will display the correct > HTML code. > > 1. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1 10.4.1 400 Bad Request The request could not be understood by the server due to malformed syntax. The _client_ SHOULD NOT repeat the request without modifications. Again, this is for "clients" not proxy servers. The purpose of a proxy server is to ensure that a request from a client is serviced by 1 of N backends. If a backend closes the connection, that means it's malfunctioning in some way, so the proxy server should try another one. Clients however should stop talking to a server that does a 400. Another way to put this is that the HTTP standard doesn't have anything that applies to the situation of a load balancing proxy server. What you'll be doing is wasting valuable mongrel time to keep a server happy that really should understand a closed connection as "try my neighbor". -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From evan at cloudbur.st Tue Dec 11 12:57:02 2007 From: evan at cloudbur.st (Evan Weaver) Date: Tue, 11 Dec 2007 12:57:02 -0500 Subject: [Mongrel-development] 1.9 Message-ID: Hey so, People are asking about Mongrel Ruby 1.9 compatibility. Isn't the point of 1.9 for library developers to have time to get ready for 2.0? It's not like 1.9 is a production release. Evan -- Evan Weaver Cloudburst, LLC From luislavena at gmail.com Tue Dec 11 13:02:10 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 11 Dec 2007 15:02:10 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: Message-ID: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> On Dec 11, 2007 2:57 PM, Evan Weaver wrote: > Hey so, > > People are asking about Mongrel Ruby 1.9 compatibility. Isn't the > point of 1.9 for library developers to have time to get ready for 2.0? > It's not like 1.9 is a production release. > Exactly. 1.9 (odd numebering) is a development release, not a stable one. Getting reading for 1.9 is a on-going process, mostly due changes Matz and others are implementing (also the new UTF and encoding functionality). Guess lot of projects will require partial rewrite to avoid the deprecations of 1.9. So, for users asking: is mongrel 1.9?... will be, that takes time. We have 1 year ahead to make it compatible. Stop bugging us! :D -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wyhaines at gmail.com Tue Dec 11 13:11:43 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 11 Dec 2007 11:11:43 -0700 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> Message-ID: On Dec 11, 2007 11:02 AM, Luis Lavena wrote: > So, for users asking: is mongrel 1.9?... will be, that takes time. We > have 1 year ahead to make it compatible. > > Stop bugging us! :D Yeah. 1.9 is a moving target. It _may_ not take a lot to make mongrel work with it, but it may take quite a bit more labor to make Mongrel work with it in an optimal way. The switch to native threads means that the thread-per-request approach gets more complex, for instance. Left as is, performance will probaby suffer substantially, as native threads are a lot more expensive to create than Ruby green threads. We should probably start thinking about and talking about these issues so that we don't get too far behind the curve, but having a 1.9-compatible/2.0 read Mongrel is going to take time. Kirk From jeremy at bitsweat.net Tue Dec 11 13:20:09 2007 From: jeremy at bitsweat.net (Jeremy Kemper) Date: Tue, 11 Dec 2007 10:20:09 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> Message-ID: <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> > On Dec 11, 2007 2:57 PM, Evan Weaver wrote: > People are asking about Mongrel Ruby 1.9 compatibility. Isn't the > point of 1.9 for library developers to have time to get ready for 2.0? > It's not like 1.9 is a production release. 1.9.1 is a production release. I think the point is to bridge 1.8 and 2.0 for all users, not just library developers. On 12/11/07, Luis Lavena wrote: > Exactly. 1.9 (odd numebering) is a development release, not a stable one. This is no longer true since last RubyKaigi 2006: Matz announced 1.9.1 is the next stable release, aiming for Christmas 2007. However, this October he said Ruby 1.8 will remain the stable Ruby for the first half of 2008. > Getting reading for 1.9 is a on-going process, mostly due changes Matz > and others are implementing (also the new UTF and encoding > functionality). > > Guess lot of projects will require partial rewrite to avoid the > deprecations of 1.9. > > So, for users asking: is mongrel 1.9?... will be, that takes time. We > have 1 year ahead to make it compatible. > > Stop bugging us! :D It will take time to update for 1.9, but the sooner the better. Best, jeremy From evan at cloudbur.st Tue Dec 11 13:34:30 2007 From: evan at cloudbur.st (Evan Weaver) Date: Tue, 11 Dec 2007 13:34:30 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: So there will be two different stable Rubys, and everyone has to be compatible with both of them? Ugh. Evan On Dec 11, 2007 1:20 PM, Jeremy Kemper wrote: > > On Dec 11, 2007 2:57 PM, Evan Weaver wrote: > > People are asking about Mongrel Ruby 1.9 compatibility. Isn't the > > point of 1.9 for library developers to have time to get ready for 2.0? > > It's not like 1.9 is a production release. > > 1.9.1 is a production release. I think the point is to bridge 1.8 and > 2.0 for all users, not just library developers. > > On 12/11/07, Luis Lavena wrote: > > Exactly. 1.9 (odd numebering) is a development release, not a stable one. > > This is no longer true since last RubyKaigi 2006: Matz announced 1.9.1 > is the next stable release, aiming for Christmas 2007. However, this > October he said Ruby 1.8 will remain the stable Ruby for the first > half of 2008. > > > Getting reading for 1.9 is a on-going process, mostly due changes Matz > > and others are implementing (also the new UTF and encoding > > functionality). > > > > Guess lot of projects will require partial rewrite to avoid the > > deprecations of 1.9. > > > > So, for users asking: is mongrel 1.9?... will be, that takes time. We > > have 1 year ahead to make it compatible. > > > > Stop bugging us! :D > > It will take time to update for 1.9, but the sooner the better. > > Best, > jeremy > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From filipe at icewall.org Tue Dec 11 13:39:17 2007 From: filipe at icewall.org (Filipe) Date: Tue, 11 Dec 2007 16:39:17 -0200 (BRST) Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: On Tue, 11 Dec 2007, Evan Weaver wrote: > So there will be two different stable Rubys, and everyone has to be > compatible with both of them? Ugh. Yeap, kind of. Did anyone here try to run mongrel with ruby 1.9? I already played with ruby1.9 for a while migrating debian packages, so I would be interested in help with this 'port'. >> >> It will take time to update for 1.9, but the sooner the better. >> Yeah.... u are right. Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } From evan at cloudbur.st Tue Dec 11 13:43:20 2007 From: evan at cloudbur.st (Evan Weaver) Date: Tue, 11 Dec 2007 13:43:20 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: Mongrel will probably run with minor changes on 1.9. It will definitely not run well, because (like Kirk says) having a process-level thread queue will destroy your performance under load in short order. It would be nice to move to something simple and eventy, like just select() polling maybe. No dependencies. Evan On Dec 11, 2007 1:39 PM, Filipe wrote: > On Tue, 11 Dec 2007, Evan Weaver wrote: > > > So there will be two different stable Rubys, and everyone has to be > > compatible with both of them? Ugh. > > Yeap, kind of. Did anyone here try to run mongrel with ruby 1.9? I > already played with ruby1.9 for a while migrating debian packages, so I > would be interested in help with this 'port'. > > >> > >> It will take time to update for 1.9, but the sooner the better. > >> > > Yeah.... u are right. > > Cheers, > > filipe { > @ icewall.org > GPG 1024D/A6BA423E > Jabber lautert at jabber.ru > > } > > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Tue Dec 11 13:48:55 2007 From: evan at cloudbur.st (Evan Weaver) Date: Tue, 11 Dec 2007 13:48:55 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: On Ruby-core: > As I said before we try our best to stabilize features before > Christmas. 1.9.1 on Christmas will not be as stable as you (or we) > expected. > > matz. On Dec 11, 2007 1:43 PM, Evan Weaver wrote: > Mongrel will probably run with minor changes on 1.9. It will > definitely not run well, because (like Kirk says) having a > process-level thread queue will destroy your performance under load in > short order. > > It would be nice to move to something simple and eventy, like just > select() polling maybe. No dependencies. > > Evan > > > On Dec 11, 2007 1:39 PM, Filipe wrote: > > On Tue, 11 Dec 2007, Evan Weaver wrote: > > > > > So there will be two different stable Rubys, and everyone has to be > > > compatible with both of them? Ugh. > > > > Yeap, kind of. Did anyone here try to run mongrel with ruby 1.9? I > > already played with ruby1.9 for a while migrating debian packages, so I > > would be interested in help with this 'port'. > > > > >> > > >> It will take time to update for 1.9, but the sooner the better. > > >> > > > > Yeah.... u are right. > > > > Cheers, > > > > filipe { > > @ icewall.org > > GPG 1024D/A6BA423E > > Jabber lautert at jabber.ru > > > > } > > > > > > _______________________________________________ > > Mongrel-development mailing list > > Mongrel-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-development > > > > > > -- > Evan Weaver > Cloudburst, LLC > -- Evan Weaver Cloudburst, LLC From ry at tinyclouds.org Tue Dec 11 14:39:53 2007 From: ry at tinyclouds.org (ry dahl) Date: Tue, 11 Dec 2007 11:39:53 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> I believe someone committed some changes to the http parser from me that make it work on Ruby 1.9. (Very minor things like str->ptr to RSTRING_PTR(str).) So last time I checked (2 or 3 months ago), the C part of mongrel was passing tests in 1.9. ry From luislavena at gmail.com Tue Dec 11 18:51:04 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 11 Dec 2007 20:51:04 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> Message-ID: <71166b3b0712111551w5a8d5c58vcf0c8ba3c5226d3e@mail.gmail.com> On Dec 11, 2007 4:39 PM, ry dahl wrote: > I believe someone committed some changes to the http parser from me > that make it work on Ruby 1.9. (Very minor things like str->ptr to > RSTRING_PTR(str).) So last time I checked (2 or 3 months ago), the C > part of mongrel was passing tests in 1.9. > yes, we discussed that on #mongrel-dev channel. The thing is that 1.9.1 will be a base for the upcoming 2.0 (were community will decide which feature will made into 2.0 or should be dropped). Even I like the performance boost of 1.9, and even I like the bleeding edge stuff, I don't see me running a production quality server/application on 1.9.1 this january. As example, lot of things Rails do will be broken in 1.9, and they need to fix that before we jump into the interpreter/VM switch. Also, the green vs. native thread is a huge change, and that will require a lot of time to get a working, stable and optimized solution to it. I think Fibers will suit best our requirements? [1] [2] anyway, need a deep analysis prior jumping into the Wow 1.9 YARV bandwagon. [1] http://www.infoq.com/news/2007/08/ruby-1-9-fibers [2] http://www.davidflanagan.com/blog/2007_08.html#000139 -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Tue Dec 11 18:56:16 2007 From: filipe at icewall.org (Filipe) Date: Tue, 11 Dec 2007 21:56:16 -0200 (BRST) Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tue, 11 Dec 2007, ry dahl wrote: > I believe someone committed some changes to the http parser from me > that make it work on Ruby 1.9. (Very minor things like str->ptr to > RSTRING_PTR(str).) So last time I checked (2 or 3 months ago), the C > part of mongrel was passing tests in 1.9. > Now i commited this :D Also, two changes for 2 classes that had problems with ruby 1.9. Now it builds for ruby 1.8 and 1.9 . Next step is make is pass all the tests. Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD4DBQFHXyOomKFbPqa6Qj4RAir4AJYmm4MNNl36QoSs58poVKzbwwRNAKCIGIC6 6Ty/aqUpm2OHKVKRUr5tQg== =34br -----END PGP SIGNATURE----- From evan at cloudbur.st Tue Dec 11 18:58:58 2007 From: evan at cloudbur.st (Evan Weaver) Date: Tue, 11 Dec 2007 18:58:58 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712111551w5a8d5c58vcf0c8ba3c5226d3e@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <71166b3b0712111551w5a8d5c58vcf0c8ba3c5226d3e@mail.gmail.com> Message-ID: Fibers don't do any scheduling for you. We'd have to reimplement half of green threads in them. Evan On Dec 11, 2007 6:51 PM, Luis Lavena wrote: > On Dec 11, 2007 4:39 PM, ry dahl wrote: > > I believe someone committed some changes to the http parser from me > > that make it work on Ruby 1.9. (Very minor things like str->ptr to > > RSTRING_PTR(str).) So last time I checked (2 or 3 months ago), the C > > part of mongrel was passing tests in 1.9. > > > > yes, we discussed that on #mongrel-dev channel. > > The thing is that 1.9.1 will be a base for the upcoming 2.0 (were > community will decide which feature will made into 2.0 or should be > dropped). > > Even I like the performance boost of 1.9, and even I like the bleeding > edge stuff, I don't see me running a production quality > server/application on 1.9.1 this january. > > As example, lot of things Rails do will be broken in 1.9, and they > need to fix that before we jump into the interpreter/VM switch. > > Also, the green vs. native thread is a huge change, and that will > require a lot of time to get a working, stable and optimized solution > to it. > > I think Fibers will suit best our requirements? [1] [2] anyway, need a > deep analysis prior jumping into the Wow 1.9 YARV bandwagon. > > [1] http://www.infoq.com/news/2007/08/ruby-1-9-fibers > [2] http://www.davidflanagan.com/blog/2007_08.html#000139 > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Tue Dec 11 18:59:35 2007 From: evan at cloudbur.st (Evan Weaver) Date: Tue, 11 Dec 2007 18:59:35 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> Message-ID: Should we just target 1.2 for YARV compat? And forget about point releases for 1.1? Evan On Dec 11, 2007 6:56 PM, Filipe wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tue, 11 Dec 2007, ry dahl wrote: > > > I believe someone committed some changes to the http parser from me > > that make it work on Ruby 1.9. (Very minor things like str->ptr to > > RSTRING_PTR(str).) So last time I checked (2 or 3 months ago), the C > > part of mongrel was passing tests in 1.9. > > > > Now i commited this :D > > Also, two changes for 2 classes that had problems with ruby 1.9. Now it > builds for ruby 1.8 and 1.9 . Next step is make is pass all the tests. > > Cheers, > > filipe { > @ icewall.org > GPG 1024D/A6BA423E > Jabber lautert at jabber.ru > } > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (GNU/Linux) > > iD4DBQFHXyOomKFbPqa6Qj4RAir4AJYmm4MNNl36QoSs58poVKzbwwRNAKCIGIC6 > 6Ty/aqUpm2OHKVKRUr5tQg== > =34br > -----END PGP SIGNATURE----- > > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From luislavena at gmail.com Tue Dec 11 19:04:31 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 11 Dec 2007 21:04:31 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> Message-ID: <71166b3b0712111604t3965fdfey82e1b8f11a3615c8@mail.gmail.com> On Dec 11, 2007 8:59 PM, Evan Weaver wrote: > Should we just target 1.2 for YARV compat? And forget about point > releases for 1.1? > Hold on a bit... :D We should be doing the 1.2 or YARV compatibility under a branch, and not trunk. Leave trunk for bugfixes to current stable or released code and backport them to the branch. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Tue Dec 11 19:32:39 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 11 Dec 2007 19:32:39 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: <20071211193239.9ec3e82c.zedshaw@zedshaw.com> On Tue, 11 Dec 2007 13:34:30 -0500 "Evan Weaver" wrote: > So there will be two different stable Rubys, and everyone has to be > compatible with both of them? Ugh. Yay! I love Ruby! -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From zedshaw at zedshaw.com Tue Dec 11 19:35:26 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 11 Dec 2007 19:35:26 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> Message-ID: <20071211193526.6de7e239.zedshaw@zedshaw.com> On Tue, 11 Dec 2007 13:43:20 -0500 "Evan Weaver" wrote: > Mongrel will probably run with minor changes on 1.9. It will > definitely not run well, because (like Kirk says) having a > process-level thread queue will destroy your performance under load in > short order. > > It would be nice to move to something simple and eventy, like just > select() polling maybe. No dependencies. A fellow contacted me earlier today about the possiblity of resurrecting my Ruby/Event module (a nice ruby wrapper around libevent) under 1.9. Apparently 1.9 will have an idle real thread that you can put stuff like libevent callbacks and running inside. Sure as hell no have no idea about the actual thread locking requirements of such a hack, but if it is doable then I might give it a try. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From zedshaw at zedshaw.com Tue Dec 11 19:36:35 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 11 Dec 2007 19:36:35 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> Message-ID: <20071211193635.3993ecb4.zedshaw@zedshaw.com> On Tue, 11 Dec 2007 18:59:35 -0500 "Evan Weaver" wrote: > Should we just target 1.2 for YARV compat? And forget about point > releases for 1.1? Hell, while you're at it, why not try a pure ruby http parser that is generated from Ragel and see if it gets decent perf on 1.9. Might be a good time to give that a try. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From luislavena at gmail.com Tue Dec 11 19:35:27 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 11 Dec 2007 21:35:27 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: <20071211193635.3993ecb4.zedshaw@zedshaw.com> References: <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <20071211193635.3993ecb4.zedshaw@zedshaw.com> Message-ID: <71166b3b0712111635x6c16d1b7hfe17a8892c3df286@mail.gmail.com> On Dec 11, 2007 9:36 PM, Zed A. Shaw wrote: > On Tue, 11 Dec 2007 18:59:35 -0500 > "Evan Weaver" wrote: > > > Should we just target 1.2 for YARV compat? And forget about point > > releases for 1.1? > > Hell, while you're at it, why not try a pure ruby http parser that is > generated from Ragel and see if it gets decent perf on 1.9. Might be a > good time to give that a try. > Great Idea, removing the c dependency will ease the path to rubinius too (even they got substend part of mongrel working already). -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Tue Dec 11 20:05:59 2007 From: filipe at icewall.org (Filipe) Date: Tue, 11 Dec 2007 23:05:59 -0200 (BRST) Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712111635x6c16d1b7hfe17a8892c3df286@mail.gmail.com> References: <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <20071211193635.3993ecb4.zedshaw@zedshaw.com> <71166b3b0712111635x6c16d1b7hfe17a8892c3df286@mail.gmail.com> Message-ID: On Tue, 11 Dec 2007, Luis Lavena wrote: > On Dec 11, 2007 9:36 PM, Zed A. Shaw wrote: >> On Tue, 11 Dec 2007 18:59:35 -0500 >> "Evan Weaver" wrote: >> >>> Should we just target 1.2 for YARV compat? And forget about point >>> releases for 1.1? >> >> Hell, while you're at it, why not try a pure ruby http parser that is >> generated from Ragel and see if it gets decent perf on 1.9. Might be a >> good time to give that a try. >> > > Great Idea, removing the c dependency will ease the path to rubinius > too (even they got substend part of mongrel working already). Yeah, this would be cool. Anyway, small changes to support ruby 1.9 will not hurt anyone. for instance, just a simple diff with less than 10 lines makes mongrel compile on ruby 1.8/ruby1.9 . But if we could be a ruby only project this would be superb! cheers, filipe From ry at tinyclouds.org Tue Dec 11 21:44:47 2007 From: ry at tinyclouds.org (ry dahl) Date: Tue, 11 Dec 2007 18:44:47 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: <20071211193635.3993ecb4.zedshaw@zedshaw.com> References: <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <20071211193635.3993ecb4.zedshaw@zedshaw.com> Message-ID: <21ee31950712111844l756f3d7eh63d1271f205676e7@mail.gmail.com> actually i've done that - although it's not operational yet when i realized it was noticeably slower running the unit tests i gave up i can commit the code if anyone wants to check it out ry On Dec 11, 2007 4:36 PM, Zed A. Shaw wrote: > On Tue, 11 Dec 2007 18:59:35 -0500 > "Evan Weaver" wrote: > > > Should we just target 1.2 for YARV compat? And forget about point > > releases for 1.1? > > Hell, while you're at it, why not try a pure ruby http parser that is > generated from Ragel and see if it gets decent perf on 1.9. Might be a > good time to give that a try. > > -- > Zed A. Shaw > - Hate: http://savingtheinternetwithhate.com/ > - Good: http://www.zedshaw.com/ > - Evil: http://yearofevil.com/ > _______________________________________________ > > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > From luislavena at gmail.com Tue Dec 11 21:48:19 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 11 Dec 2007 23:48:19 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712111844l756f3d7eh63d1271f205676e7@mail.gmail.com> References: <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <20071211193635.3993ecb4.zedshaw@zedshaw.com> <21ee31950712111844l756f3d7eh63d1271f205676e7@mail.gmail.com> Message-ID: <71166b3b0712111848r227a7ef7sca99323a24b215ef@mail.gmail.com> On Dec 11, 2007 11:44 PM, ry dahl wrote: > actually i've done that - although it's not operational yet > when i realized it was noticeably slower running the unit tests i gave up > i can commit the code if anyone wants to check it out > If you do try to branch it to avoid problems with trunk (which is almost "stable") or put inside a place where is not called at all and we can look at it (like lib/experimental or something). -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From ry at tinyclouds.org Tue Dec 11 22:12:03 2007 From: ry at tinyclouds.org (ry dahl) Date: Tue, 11 Dec 2007 19:12:03 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712111908q3b72b738k28a5efe03bc875ea@mail.gmail.com> References: <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <20071211193635.3993ecb4.zedshaw@zedshaw.com> <21ee31950712111844l756f3d7eh63d1271f205676e7@mail.gmail.com> <71166b3b0712111848r227a7ef7sca99323a24b215ef@mail.gmail.com> <21ee31950712111908q3b72b738k28a5efe03bc875ea@mail.gmail.com> Message-ID: <21ee31950712111912s79e6f18bnd18ce6109f383774@mail.gmail.com> p.s.: it doesn't conform exactly to the C's API - i was just trying to get it to pass all the tests first (it shouldn't be hard to change things to be that way). i think if someone can get it to pass that dumbfuck_headers test, it would be functional. On Dec 11, 2007 7:08 PM, ry dahl wrote: > er, here i'll just tar it up. when i run the tests i get this: > > ..E.. > Finished in 0.488298 seconds. > > 1) Error: > test_parse_dumbfuck_headers(HttpParserTest): > HttpParser::ParseError: HttpParser::ParseError > ./http11.rb:466:in `execute' > ./test.rb:57:in `test_parse_dumbfuck_headers' > > 5 tests, 15 assertions, 0 failures, 1 errors > > > > > > > On Dec 11, 2007 6:48 PM, Luis Lavena wrote: > > On Dec 11, 2007 11:44 PM, ry dahl wrote: > > > actually i've done that - although it's not operational yet > > > when i realized it was noticeably slower running the unit tests i gave up > > > i can commit the code if anyone wants to check it out > > > > > > > If you do try to branch it to avoid problems with trunk (which is > > almost "stable") or put inside a place where is not called at all and > > we can look at it (like lib/experimental or something). > > > > -- > > Luis Lavena > > Multimedia systems > > - > > A common mistake that people make when trying to design > > something completely foolproof is to underestimate > > the ingenuity of complete fools. > > Douglas Adams > > _______________________________________________ > > > > Mongrel-development mailing list > > Mongrel-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-development > > > From ry at tinyclouds.org Tue Dec 11 22:43:13 2007 From: ry at tinyclouds.org (ry dahl) Date: Tue, 11 Dec 2007 19:43:13 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712111912s79e6f18bnd18ce6109f383774@mail.gmail.com> References: <21ee31950712111139r37883d16w7237b3d1fc84f054@mail.gmail.com> <20071211193635.3993ecb4.zedshaw@zedshaw.com> <21ee31950712111844l756f3d7eh63d1271f205676e7@mail.gmail.com> <71166b3b0712111848r227a7ef7sca99323a24b215ef@mail.gmail.com> <21ee31950712111908q3b72b738k28a5efe03bc875ea@mail.gmail.com> <21ee31950712111912s79e6f18bnd18ce6109f383774@mail.gmail.com> Message-ID: <21ee31950712111943x116a4f84j6113695f0c416c8c@mail.gmail.com> Oh, it seems the list doesn't allow me to post attachments. sorry. here it is. http://s3.amazonaws.com/four.livejournal/20071211/http11_ruby.tar.gz On Dec 11, 2007 7:12 PM, ry dahl wrote: > p.s.: it doesn't conform exactly to the C's API - i was just trying to > get it to pass all the tests first (it shouldn't be hard to change > things to be that way). > i think if someone can get it to pass that dumbfuck_headers test, it > would be functional. > > > > > On Dec 11, 2007 7:08 PM, ry dahl wrote: > > er, here i'll just tar it up. when i run the tests i get this: > > > > ..E.. > > Finished in 0.488298 seconds. > > > > 1) Error: > > test_parse_dumbfuck_headers(HttpParserTest): > > HttpParser::ParseError: HttpParser::ParseError > > ./http11.rb:466:in `execute' > > ./test.rb:57:in `test_parse_dumbfuck_headers' > > > > 5 tests, 15 assertions, 0 failures, 1 errors > > > > > > > > > > > > > > On Dec 11, 2007 6:48 PM, Luis Lavena wrote: > > > On Dec 11, 2007 11:44 PM, ry dahl wrote: > > > > actually i've done that - although it's not operational yet > > > > when i realized it was noticeably slower running the unit tests i gave up > > > > i can commit the code if anyone wants to check it out > > > > > > > > > > If you do try to branch it to avoid problems with trunk (which is > > > almost "stable") or put inside a place where is not called at all and > > > we can look at it (like lib/experimental or something). > > > > > > -- > > > Luis Lavena > > > Multimedia systems > > > - > > > A common mistake that people make when trying to design > > > something completely foolproof is to underestimate > > > the ingenuity of complete fools. > > > Douglas Adams > > > _______________________________________________ > > > > > > Mongrel-development mailing list > > > Mongrel-development at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/mongrel-development > > > > > > From wayneeseguin at gmail.com Wed Dec 12 08:54:26 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 12 Dec 2007 08:54:26 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <20071211193526.6de7e239.zedshaw@zedshaw.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <20071211193526.6de7e239.zedshaw@zedshaw.com> Message-ID: On Dec 11, 2007 7:35 PM, Zed A. Shaw wrote: > A fellow contacted me earlier today about the possiblity of > resurrecting my Ruby/Event module (a nice ruby wrapper around libevent) > under 1.9. Apparently 1.9 will have an idle real thread that you can > put stuff like libevent callbacks and running inside. Sure as hell no > have no idea about the actual thread locking requirements of such a > hack, but if it is doable then I might give it a try. > This idea actually sounds quite promising. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071212/e05bf200/attachment.html From wayneeseguin at gmail.com Wed Dec 12 13:21:41 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 12 Dec 2007 13:21:41 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <20071211193526.6de7e239.zedshaw@zedshaw.com> Message-ID: Let's take things one step at a time then, and just get things working incremetally. Even if they run _slowly_ as is, we could first focus on getting things running and then speeding things up by addressing our model. What do you think? Also, does anyone know if Ruby 1.9 needs fastthread? ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071212/ca54f9d1/attachment.html From luislavena at gmail.com Wed Dec 12 13:29:17 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 15:29:17 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <20071211193526.6de7e239.zedshaw@zedshaw.com> Message-ID: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> On Dec 12, 2007 3:21 PM, Wayne E. Seguin wrote: > Let's take things one step at a time then, and just get things working > incremetally. > Even if they run _slowly_ as is, we could first focus on getting things > running and then speeding things up by addressing our model. What do you > think? > I agree with Wayne on this. Get it running first, then see why it behave slow and then start looking for alternatives to the design. > Also, does anyone know if Ruby 1.9 needs fastthread? > Threading was fixed in latest 1.8.6, and since 1.9 uses native threads instead of green threads queueing methods, is not needed. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wayneeseguin at gmail.com Wed Dec 12 13:32:22 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 12 Dec 2007 13:32:22 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> References: <71166b3b0712111002g7baf183ey8400f4ac3f3c5481@mail.gmail.com> <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> Message-ID: On Dec 12, 2007 1:29 PM, Luis Lavena wrote: > Threading was fixed in latest 1.8.6, and since 1.9 uses native threads > instead of green threads queueing methods, is not needed. > Ok, I just installed ruby-1.9 and ran gem-1.9 install mongrel. So it appears that our first thing to remove is fastthread dependency for 1.9. Let's do that then find the next issue. ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071212/f5779ae5/attachment.html From luislavena at gmail.com Wed Dec 12 13:36:02 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 15:36:02 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <69a2885c0712111020n258f8658je40de3f867b2b8cc@mail.gmail.com> <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> Message-ID: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> On Dec 12, 2007 3:32 PM, Wayne E. Seguin wrote: > On Dec 12, 2007 1:29 PM, Luis Lavena wrote: > > > Threading was fixed in latest 1.8.6, and since 1.9 uses native threads > > instead of green threads queueing methods, is not needed. > > > > Ok, I just installed ruby-1.9 and ran gem-1.9 install mongrel. > So it appears that our first thing to remove is fastthread dependency for > 1.9. > Let's do that then find the next issue. > That will not be easy: you state which version of rubygems you depend on, and which version of ruby depend on. There is no way to tell rubygems that (on Ruby < 1.8.6, we should depend on fastthread, on >= 1.9 we shouldn't). We can do the check on code and leave the following dependencies as warning: fastthread multipart_cgi_eof_fix (or something like that, is quite looong the name of that gem) :-P -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From evan at cloudbur.st Wed Dec 12 13:42:56 2007 From: evan at cloudbur.st (Evan Weaver) Date: Wed, 12 Dec 2007 13:42:56 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> References: <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> Message-ID: I think we need a roadmap. This is getting complicated. Evan On Dec 12, 2007 1:36 PM, Luis Lavena wrote: > > On Dec 12, 2007 3:32 PM, Wayne E. Seguin wrote: > > On Dec 12, 2007 1:29 PM, Luis Lavena wrote: > > > > > Threading was fixed in latest 1.8.6, and since 1.9 uses native threads > > > instead of green threads queueing methods, is not needed. > > > > > > > Ok, I just installed ruby-1.9 and ran gem-1.9 install mongrel. > > So it appears that our first thing to remove is fastthread dependency for > > 1.9. > > Let's do that then find the next issue. > > > > That will not be easy: you state which version of rubygems you depend > on, and which version of ruby depend on. There is no way to tell > rubygems that (on Ruby < 1.8.6, we should depend on fastthread, on >= > 1.9 we shouldn't). > > We can do the check on code and leave the following dependencies as warning: > > fastthread > multipart_cgi_eof_fix (or something like that, is quite looong the > name of that gem) :-P > > > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From luislavena at gmail.com Wed Dec 12 13:50:44 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 15:50:44 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> Message-ID: <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> On Dec 12, 2007 3:42 PM, Evan Weaver wrote: > I think we need a roadmap. This is getting complicated. > Yeah, I like when things get complicated :-D So: 1) Remove external dependencies (fastthread and multi_part_eof_fix) to code warnings instead, like the changes done with the compiled extension in mongrel_experimental. Rescue from them and warn the user about it. 2) Replace the ragel .c part with a ragel-ruby generated one and make all the tests pass on 1.8 3) Move to 1.9 and see if everything will work out of the box (the new generated ragel, the tests, the classes and the modules mongrel implements). 4) Do some benchmark of: Mongrel/MRI18 Mongrel/YARV19 Mongrel/JRUBY102 Mongrel/JRUBY110 Mongrel/Rubinius I put the bench on step 4 to be as fair as possible, compare the same code base across interpreters. 5) Start optimizing the deadlocks/threads and strategies about handling concurrent connections. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From evan at cloudbur.st Wed Dec 12 13:55:16 2007 From: evan at cloudbur.st (Evan Weaver) Date: Wed, 12 Dec 2007 13:55:16 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> References: <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> Message-ID: I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? Also, you need 6) Merge mongrel_rails and mongrel::cluster into a less fussy mongrel runner, possibly removing gem_plugin in the process. Evan On Dec 12, 2007 1:50 PM, Luis Lavena wrote: > On Dec 12, 2007 3:42 PM, Evan Weaver wrote: > > I think we need a roadmap. This is getting complicated. > > > > Yeah, I like when things get complicated :-D > > So: > > 1) Remove external dependencies (fastthread and multi_part_eof_fix) to > code warnings instead, like the changes done with the compiled > extension in mongrel_experimental. > > Rescue from them and warn the user about it. > > 2) Replace the ragel .c part with a ragel-ruby generated one and make > all the tests pass on 1.8 > > 3) Move to 1.9 and see if everything will work out of the box (the new > generated ragel, the tests, the classes and the modules mongrel > implements). > > 4) Do some benchmark of: > > Mongrel/MRI18 > Mongrel/YARV19 > Mongrel/JRUBY102 > Mongrel/JRUBY110 > Mongrel/Rubinius > > I put the bench on step 4 to be as fair as possible, compare the same > code base across interpreters. > > 5) Start optimizing the deadlocks/threads and strategies about > handling concurrent connections. > > -- > > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Wed Dec 12 13:56:28 2007 From: evan at cloudbur.st (Evan Weaver) Date: Wed, 12 Dec 2007 13:56:28 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> Message-ID: And I don't think we really came to a decision about that proxy error response issue thing. Evan On Dec 12, 2007 1:55 PM, Evan Weaver wrote: > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? > > Also, you need > > 6) Merge mongrel_rails and mongrel::cluster into a less fussy mongrel > runner, possibly removing gem_plugin in the process. > > Evan > > > > On Dec 12, 2007 1:50 PM, Luis Lavena wrote: > > On Dec 12, 2007 3:42 PM, Evan Weaver wrote: > > > I think we need a roadmap. This is getting complicated. > > > > > > > Yeah, I like when things get complicated :-D > > > > So: > > > > 1) Remove external dependencies (fastthread and multi_part_eof_fix) to > > code warnings instead, like the changes done with the compiled > > extension in mongrel_experimental. > > > > Rescue from them and warn the user about it. > > > > 2) Replace the ragel .c part with a ragel-ruby generated one and make > > all the tests pass on 1.8 > > > > 3) Move to 1.9 and see if everything will work out of the box (the new > > generated ragel, the tests, the classes and the modules mongrel > > implements). > > > > 4) Do some benchmark of: > > > > Mongrel/MRI18 > > Mongrel/YARV19 > > Mongrel/JRUBY102 > > Mongrel/JRUBY110 > > Mongrel/Rubinius > > > > I put the bench on step 4 to be as fair as possible, compare the same > > code base across interpreters. > > > > 5) Start optimizing the deadlocks/threads and strategies about > > handling concurrent connections. > > > > -- > > > > Luis Lavena > > Multimedia systems > > - > > A common mistake that people make when trying to design > > something completely foolproof is to underestimate > > the ingenuity of complete fools. > > Douglas Adams > > _______________________________________________ > > Mongrel-development mailing list > > Mongrel-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-development > > > > > > -- > Evan Weaver > Cloudburst, LLC > -- Evan Weaver Cloudburst, LLC From luislavena at gmail.com Wed Dec 12 13:59:20 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 15:59:20 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> Message-ID: <71166b3b0712121059l2f2575fdv7ae92a7575864c00@mail.gmail.com> On Dec 12, 2007 3:56 PM, Evan Weaver wrote: > And I don't think we really came to a decision about that proxy error > response issue thing. > We need some test on another load balancer.... help? I mean, if it is just nginx how behaves badly, why don't fix it instead of putting the fix on mongrel? -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From luislavena at gmail.com Wed Dec 12 14:11:08 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 16:11:08 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> Message-ID: <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> On Dec 12, 2007 3:55 PM, Evan Weaver wrote: > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? > How performance penalty was compared to 1.9? If we are going to bring some changes to 1.9, we should start checking for big issues: - native extensions need compilers. - production servers don't have compilers, so some users do the compile locally and generated a new platform-specific gem for their servers. - latest rubygems is broken is broken on windows (and I'm waiting eric releases 0.9.5.1 to fix the damn thing). > Also, you need > > 6) Merge mongrel_rails and mongrel::cluster into a less fussy mongrel > runner, possibly removing gem_plugin in the process. That could be splitted in several steps, you're trying to chum a lot in just one bite. mongrel_rails is another beast, and is the only one that uses gem_plugins in its current form, so: remove all the gem processing from mongrel, isn't our call to workaround Kernel.require or depend on rubygems presence to work. There are some users don't like rubygems, mostly due their memory load. gem_plugin is great, but it have some issues since it "skip" some of the rubygems functionality and try to do it manually. Get a simpler configuration and plugabble mongrel_rails could be addressed later. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From evan at cloudbur.st Wed Dec 12 14:19:30 2007 From: evan at cloudbur.st (Evan Weaver) Date: Wed, 12 Dec 2007 14:19:30 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> Message-ID: > gem_plugin is great Disagree. Evan On Dec 12, 2007 2:11 PM, Luis Lavena wrote: > On Dec 12, 2007 3:55 PM, Evan Weaver wrote: > > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? > > > > How performance penalty was compared to 1.9? If we are going to bring > some changes to 1.9, we should start checking for big issues: > > - native extensions need compilers. > - production servers don't have compilers, so some users do the > compile locally and generated a new platform-specific gem for their > servers. > - latest rubygems is broken is broken on windows (and I'm waiting eric > releases 0.9.5.1 to fix the damn thing). > > > Also, you need > > > > 6) Merge mongrel_rails and mongrel::cluster into a less fussy mongrel > > runner, possibly removing gem_plugin in the process. > > That could be splitted in several steps, you're trying to chum a lot > in just one bite. > > mongrel_rails is another beast, and is the only one that uses > gem_plugins in its current form, so: > > remove all the gem processing from mongrel, isn't our call to > workaround Kernel.require or depend on rubygems presence to work. > > There are some users don't like rubygems, mostly due their memory load. > > gem_plugin is great, but it have some issues since it "skip" some of > the rubygems functionality and try to do it manually. > > Get a simpler configuration and plugabble mongrel_rails could be > addressed later. > > -- > > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From luislavena at gmail.com Wed Dec 12 14:31:21 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 16:31:21 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> Message-ID: <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> On Dec 12, 2007 4:19 PM, Evan Weaver wrote: > > gem_plugin is great > > Disagree. > I mean: great in general speaking, not in the topic we are talking about. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From evan at cloudbur.st Wed Dec 12 14:53:08 2007 From: evan at cloudbur.st (Evan Weaver) Date: Wed, 12 Dec 2007 14:53:08 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> Message-ID: Still disagree :). Evan On Dec 12, 2007 2:31 PM, Luis Lavena wrote: > On Dec 12, 2007 4:19 PM, Evan Weaver wrote: > > > gem_plugin is great > > > > Disagree. > > > > I mean: great in general speaking, not in the topic we are talking about. > > -- > > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From wyhaines at gmail.com Wed Dec 12 14:58:36 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 12 Dec 2007 12:58:36 -0700 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> Message-ID: On Dec 12, 2007 11:56 AM, Evan Weaver wrote: > And I don't think we really came to a decision about that proxy error > response issue thing. The RFC is terribly vague on this issue. Maybe a few of us can each take a different proxy other than nginx and investigate how they handle having the connection closed versus receiving a 400 response. Kirk From wyhaines at gmail.com Wed Dec 12 15:18:22 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 12 Dec 2007 13:18:22 -0700 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <20071211193526.6de7e239.zedshaw@zedshaw.com> <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> Message-ID: On Dec 12, 2007 11:55 AM, Evan Weaver wrote: > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? Performance is going to suffer. HTTP parsing is expensive, and unless we goto a parser like ServerSide's (heavily regexp based), I don't think we're going to come close to the speed of a C based parser. I think the question is whether the performance loss is enough to be debilitating on 1.9.x or on rubinius (or jruby?). I would think that we wouldn't get rid of the C extensions, though. Just render them an additional, optional component. > 6) Merge mongrel_rails and mongrel::cluster into a less fussy mongrel > runner, possibly removing gem_plugin in the process. Hallelujah! Kirk From ry at tinyclouds.org Wed Dec 12 15:34:48 2007 From: ry at tinyclouds.org (ry dahl) Date: Wed, 12 Dec 2007 12:34:48 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> Message-ID: <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> > > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? > How performance penalty was compared to 1.9? I don't have any benchmarks but it was signifigantly slower running test. For something at the very heart of the server, I doubt anyone would want to take that performance hit. Mongrel should stick with the C parser for now. > mongrel_rails is another beast, and is the only one that uses > gem_plugins in its current form, so: My 2 cents: gem_plugins is not being used and doesn't provide any features to the core server except making handlers slightly easier to install. I think it should be removed for the sake of simplicity. ry From evan at cloudbur.st Wed Dec 12 17:14:00 2007 From: evan at cloudbur.st (Evan Weaver) Date: Wed, 12 Dec 2007 17:14:00 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> Message-ID: > Just render them an additional, optional component. I am totally opposed to additional options to set. We have enough trouble as it is responding to people's environment and configuration problems. I don't think there are significant problems with the current C Ragel and Java Ragel. They share have the same .rl file even. And Kevin Clark managed to make it run on Rubinius with relatively few changes. Evan On Dec 12, 2007 3:34 PM, ry dahl wrote: > > > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? > > How performance penalty was compared to 1.9? > > I don't have any benchmarks but it was signifigantly slower running > test. For something at the very heart of the server, I doubt anyone > would want to take that performance hit. Mongrel should stick with the > C parser for now. > > > mongrel_rails is another beast, and is the only one that uses > > gem_plugins in its current form, so: > > My 2 cents: gem_plugins is not being used and doesn't provide any > features to the core server except making handlers slightly easier to > install. I think it should be removed for the sake of simplicity. > > > ry > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From wyhaines at gmail.com Wed Dec 12 17:19:04 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 12 Dec 2007 15:19:04 -0700 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> Message-ID: On Dec 12, 2007 3:14 PM, Evan Weaver wrote: > > Just render them an additional, optional component. > > I am totally opposed to additional options to set. We have enough > trouble as it is responding to people's environment and configuration > problems. > > I don't think there are significant problems with the current C Ragel > and Java Ragel. They share have the same .rl file even. And Kevin > Clark managed to make it run on Rubinius with relatively few changes. I don't, either, but it seems that a lot of people think there needs to be a pure ruby option. Kirk Haines From luislavena at gmail.com Wed Dec 12 18:58:16 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 12 Dec 2007 20:58:16 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> Message-ID: <71166b3b0712121558n20775d6j450a05155e2dd8cd@mail.gmail.com> On Dec 12, 2007 7:19 PM, Kirk Haines wrote: > > > > I don't think there are significant problems with the current C Ragel > > and Java Ragel. They share have the same .rl file even. And Kevin > > Clark managed to make it run on Rubinius with relatively few changes. > > I don't, either, but it seems that a lot of people think there needs > to be a pure ruby option. > Ok, my bad on following Zed proposal :P For the record, rubinius is going to replace the bison parser (like MRI currently have) to a plain ruby one using Racc. [1] Did the Rubinius team introduced changes in the ragel part or just the extension? So we have a java-ragel for JRuby, a C ragel for MRI and YARV and the same C for rbx. Following ruby-core talk there seems 1.9 will not be "re-entrant" to support something libevent, but I could be wrong (lot of traffic on so many lists to follow everything). So, what's next on the list? [1] http://blog.zenspider.com/archives/2007/12/no_longer_secret.html -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Wed Dec 12 21:57:02 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 12 Dec 2007 21:57:02 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> Message-ID: <20071212215702.878a0359.zedshaw@zedshaw.com> On Wed, 12 Dec 2007 12:34:48 -0800 "ry dahl" wrote: > > > I think 2) remove C Ragel is debatable. Didn't ry say that performance suffered? > > How performance penalty was compared to 1.9? > > I don't have any benchmarks but it was signifigantly slower running > test. For something at the very heart of the server, I doubt anyone > would want to take that performance hit. Mongrel should stick with the > C parser for now. Ry, did you try: 1) Ruby parser. 2) Ruby 1.9 absolute latest. 3) Benchmarked tests to see what's slow. 4) Ruled out stupidity or possible easy fixes. ? -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From zedshaw at zedshaw.com Wed Dec 12 21:58:31 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 12 Dec 2007 21:58:31 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> Message-ID: <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> On Wed, 12 Dec 2007 14:53:08 -0500 "Evan Weaver" wrote: > Still disagree :). Sigh, ok, why? It's not fair to just yell disagree without stating your reasons so they can be debated. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From evan at cloudbur.st Thu Dec 13 00:21:01 2007 From: evan at cloudbur.st (Evan Weaver) Date: Thu, 13 Dec 2007 00:21:01 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> References: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> Message-ID: It adds a lot of complexity. It discourages encapsulation of your dependencies per-app. For using inside custom handlers, you have to explicitly specify which plugin you want (:handler => plugin()) etc., so why not just use 'require'. Some plugins just use regular Class#new anyway. It's mostly widely used (outside of mongrel_rails itself) for mongrel_cluster, which is our own project, and which basically duplicates all of mongrel_rails, because there's no way to extend one plugin from another besides reopening classes. This is really awful. For mongrel_rails, it doesn't provide any interfaces. All it does is load stuff. For our purposes it's much simpler to make a runner that takes the name of a handler and an optional list of dependencies to try to load. That runner can deal with the pid files and mount whatever you please on '/' for whatever size cluster you want. The dep list can include rubygems if you want it, or just libraries on the loadpath, or whatever. I understand the glorious vision of thousands of handlers and plugins blooming and breeding, but that's not really how it's worked out. Evan On Dec 12, 2007 9:58 PM, Zed A. Shaw wrote: > On Wed, 12 Dec 2007 14:53:08 -0500 > "Evan Weaver" wrote: > > > Still disagree :). > > Sigh, ok, why? It's not fair to just yell disagree without stating > your reasons so they can be debated. > > -- > Zed A. Shaw > - Hate: http://savingtheinternetwithhate.com/ > - Good: http://www.zedshaw.com/ > - Evil: http://yearofevil.com/ > _______________________________________________ > > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From zedshaw at zedshaw.com Thu Dec 13 02:40:05 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 13 Dec 2007 02:40:05 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> Message-ID: <20071213024005.5152d75c.zedshaw@zedshaw.com> First, I'm all for replacing it if you can simplify things, and I'm just giving out advice. You guys are in charge so do as you wish, but Evan, you're kind of being a jerk about this one. Read my comments below, take your ideas, implement a small prototype for them, and then hit ALL the other projects using mongrel to get their feedback. Not just Rails. If they all like the idea then go for it, but from what I see, you're very narrow minded about Rails, Rails, Rails, and that's bad. Frankly, my insistence on keeping Mongrel relatively agnostic and not sucking rails-core cocks is why everyone uses Mongrel. I saw how the rails-core guys treated the people making them famous and realized I needed to keep things open for anyone in order to level the playing field. Too much power held by one group is a very bad thing. As the new guys in charge of Mongrel, you have to keep this in mind. Fucking things up for even one of the small players can ruin people's trust in you and destroy something that's a key piece of infrastructure for many people. So, I'm not being mean in the below comments at all, because you rock for challenging what exists, I'm just challenging your ideas back because I think your reasoning and proposed alternatives blow. They need more whiteboard time and probably some code. Now with my comments... On Thu, 13 Dec 2007 00:21:01 -0500 "Evan Weaver" wrote: > It adds a lot of complexity. Add the complexity where, and what is your proposed alternative? The last alternative you did was to replace my rake help library (which required no dependencies on build) with your own "simpler" rubygem (which means that now mongrel builds need rubygems). So, let's get crystal clear about what you think is complex, where it's complex, and how it would be simpler under your proposed plan. > It discourages encapsulation of your dependencies per-app. Which "app"? Mongrel? Rails? Mongrel based frameworks? And, how does a gem that's required and loaded on the fly discourage people from putting their stuff in the gems and encapsulate them? My definition of "encapsulation" is that things are like, you know, encapsulated. Shielded. Protected. Kept from other stuff. Can you clarify? And, what would be your proposed alternative that doesn't use gems and yet encourages encapsulation? > For using inside custom handlers, you have to explicitly specify which > plugin you want (:handler => plugin()) etc., so why not just use > 'require'. Some plugins just use regular Class#new anyway. It's intended to be used as something that is configured to start just the handler. Inside your handler or any other ruby code nothing prevents you from just using require. Can you give sample code that shows the situation you're talking about where you MUST use the gemplugin system to load a dependent plain gem? > It's mostly widely used (outside of mongrel_rails itself) for > mongrel_cluster, which is our own project, and which basically > duplicates all of mongrel_rails, because there's no way to extend one > plugin from another besides reopening classes. This is really awful. Ok, but again, you don't need to use gemplugins. In each place where I used it, you can also not use it. That's how it always has been. Commands for mongrel_rails are a small exception (not handlers) because the mongrel_rails script needs some way to load new commands that were added to the system without accessing any list a user controls, and without requiring much more configuration than a gem install. I think you might be missing this feature if you're expecting someone to install a gem AND edit a config file somewhere in order to enable a new command for mongrel_rails for the whole system. I also put forward this observation: You are thinking of gemplugins as subclassable reusable bits of code, but I think of them as standalone components that are loaded (similar to nearly every other plugin system including Rails'). Reusable-subclassable is not how they were designed, they were designed so people who wanted to contribute a handler or command for mongrel could package it independently of the mongrel project and distribute it without requiring us to give them: 1) svn access 2) permission 3) source 4) licensing 5) command line tool changes 6) configuration after install If your proposed alternative doesn't allow that, or requires other external dependencies besides gems, then it's not going to work as an alternative. > For mongrel_rails, it doesn't provide any interfaces. All it does is > load stuff. For our purposes it's much simpler to make a runner that > takes the name of a handler and an optional list of dependencies to > try to load. That runner can deal with the pid files and mount > whatever you please on '/' for whatever size cluster you want. The dep > list can include rubygems if you want it, or just libraries on the > loadpath, or whatever. Uh, it does provide an interface using the -S option to provide a configuration script, and that's even documented. Do you mean for commands or for handlers? But at this point, I realize you probably just have a general distaste/distrust of gemplugins and yet no viable tested and agreed on alternative worked on yet. I think if you went and worked on the alternative you'd have a more convincing argument, especially if it was simply, "Look bitch! My code simpla!" > I understand the glorious vision of thousands of handlers and plugins > blooming and breeding, but that's not really how it's worked out. Well, the glorious vision was that I got to write a web server that everyone uses, which is pretty much what I did so that's cool. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From ry at tinyclouds.org Thu Dec 13 13:57:27 2007 From: ry at tinyclouds.org (ry dahl) Date: Thu, 13 Dec 2007 10:57:27 -0800 Subject: [Mongrel-development] 1.9 In-Reply-To: <20071212215702.878a0359.zedshaw@zedshaw.com> References: <71166b3b0712121029m2d362348lf070c66b55b27ec8@mail.gmail.com> <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> <20071212215702.878a0359.zedshaw@zedshaw.com> Message-ID: <21ee31950712131057m4df4b4a5kf8e5d04ac11b4c5e@mail.gmail.com> > Ry, did you try: > > 1) Ruby parser. > 2) Ruby 1.9 absolute latest. > 3) Benchmarked tests to see what's slow. > 4) Ruled out stupidity or possible easy fixes. No, I haven't - I'm pretty busy these days - if anyone wants to give it a try see my code above. Kirk, didn't you say on IRC that you had written a simple ruby-regex based http parser that was pretty fast and simple? (Or was that someone else?) Also: I gave a brief presentation of Ruby and Ragel at the European Ruby conference last month. It was basically to advise people to read http11 because it's very nice. If anyone is interested in looking at the slides: http://s3.amazonaws.com/four.livejournal/20071116/ragel_talk.pdf ry From wyhaines at gmail.com Thu Dec 13 14:49:03 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 13 Dec 2007 12:49:03 -0700 Subject: [Mongrel-development] 1.9 In-Reply-To: <21ee31950712131057m4df4b4a5kf8e5d04ac11b4c5e@mail.gmail.com> References: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> <20071212215702.878a0359.zedshaw@zedshaw.com> <21ee31950712131057m4df4b4a5kf8e5d04ac11b4c5e@mail.gmail.com> Message-ID: On Dec 13, 2007 11:57 AM, ry dahl wrote: > Kirk, didn't you say on IRC that you had written a simple ruby-regex > based http parser that was pretty fast and simple? (Or was that > someone else?) No. ServerSide's parser is regexp based. That's probably what you are thinking of. Kirk Haines From luislavena at gmail.com Thu Dec 13 15:09:51 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 13 Dec 2007 17:09:51 -0300 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121036y17e039aco252feb040a682325@mail.gmail.com> <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> <20071212215702.878a0359.zedshaw@zedshaw.com> <21ee31950712131057m4df4b4a5kf8e5d04ac11b4c5e@mail.gmail.com> Message-ID: <71166b3b0712131209y6cc8a0c3g29a723614eeee345@mail.gmail.com> On Dec 13, 2007 4:49 PM, Kirk Haines wrote: > On Dec 13, 2007 11:57 AM, ry dahl wrote: > > > Kirk, didn't you say on IRC that you had written a simple ruby-regex > > based http parser that was pretty fast and simple? (Or was that > > someone else?) > > No. ServerSide's parser is regexp based. That's probably what you > are thinking of. > Quoting Zed's own answer back in september 2006 [1], talking about ServerSide: It's still pretty impressive for a first run. I'd be curious to see if some kind of mongrel+severside alliance could be had, but I suspect the author has his eye on the "fastest web server" prize. Also, recent noob comparison of serverside/mongrel performance [2] shows it still is good at performance. Since Mongrel proved being a viable server implementation for Rails, Merb and other frameworks, maybe is just time we can have some collaborative work with SS guys? Just a thought, anyway, we are stuck if we keep discussing without a plan :-P [1] http://rubyforge.org/pipermail/mongrel-users/2006-September/001460.html [2] http://rubyforge.org/pipermail/mongrel-users/2007-November/004461.html -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wayneeseguin at gmail.com Thu Dec 13 15:29:34 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Thu, 13 Dec 2007 15:29:34 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <71166b3b0712131209y6cc8a0c3g29a723614eeee345@mail.gmail.com> References: <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <21ee31950712121234v2080d60eye38916121f134efa@mail.gmail.com> <20071212215702.878a0359.zedshaw@zedshaw.com> <21ee31950712131057m4df4b4a5kf8e5d04ac11b4c5e@mail.gmail.com> <71166b3b0712131209y6cc8a0c3g29a723614eeee345@mail.gmail.com> Message-ID: On Dec 13, 2007 3:09 PM, Luis Lavena wrote: > Quoting Zed's own answer back in september 2006 [1], talking about > ServerSide: > > It's still pretty impressive for a first run. I'd be curious to see if > some kind of mongrel+severside alliance could be had, but I suspect the > author has his eye on the "fastest web server" prize. > > Also, recent noob comparison of serverside/mongrel performance [2] > shows it still is good at performance. > > Since Mongrel proved being a viable server implementation for Rails, > Merb and other frameworks, maybe is just time we can have some > collaborative work with SS guys? > > Just a thought, anyway, we are stuck if we keep discussing without a plan > :-P > > [1] > http://rubyforge.org/pipermail/mongrel-users/2006-September/001460.html > [2] http://rubyforge.org/pipermail/mongrel-users/2007-November/004461.html > I'm one of the ServerSide devs, so if we need to discuss things with the author it is very easy to facilitate. ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071213/819ec1f6/attachment.html From luislavena at gmail.com Fri Dec 14 14:43:34 2007 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 14 Dec 2007 16:43:34 -0300 Subject: [Mongrel-development] Some silly benchs (was: 1.9) Message-ID: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> Guys, Just for fun, I tried to see (I know, a silly way to test it) how much overhead we have calling the C functions of the extensions. the benchmark script and the results: http://pastie.caboo.se/128646 The naive C extension: http://pastie.caboo.se/128647 I compared 1.8.6 (VC6 and mingw builds) against a fresh checkout of ruby trunk. What I understand from that is 1.9 is slower than 1.8 regarding FFI calling, but compared to pure-ruby, it's almost equal, which differ from 1.8 where pure-ruby is twice slow. On another topic, it seems serverside is based on event-machine, like swiftiply. Tried to checkout EM code but the repo is a mess without a clear indication of what branch/directory should be used. Anyway, it appears lot of libraries based on events perform better than other alternatives. But, just random thoughts. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wyhaines at gmail.com Fri Dec 14 15:08:24 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 14 Dec 2007 13:08:24 -0700 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> Message-ID: On Dec 14, 2007 12:43 PM, Luis Lavena wrote: > On another topic, it seems serverside is based on event-machine, like > swiftiply. Tried to checkout EM code but the repo is a mess without a > clear indication of what branch/directory should be used. Just download the latest production release of serverside. An interesting benchmark would be to just compare the HTTP parsing piece of it with Mongrel's, both for performance and for correct parsing. Kirk Haines From luislavena at gmail.com Fri Dec 14 17:05:28 2007 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 14 Dec 2007 19:05:28 -0300 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> Message-ID: <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> On Dec 14, 2007 5:08 PM, Kirk Haines wrote: > On Dec 14, 2007 12:43 PM, Luis Lavena wrote: > > On another topic, it seems serverside is based on event-machine, like > > swiftiply. Tried to checkout EM code but the repo is a mess without a > > clear indication of what branch/directory should be used. > > Just download the latest production release of serverside. An > interesting benchmark would be to just compare the HTTP parsing piece > of it with Mongrel's, both for performance and for correct parsing. > I'll try to rip the ServerSide::HTTP::Parsing module and drop the same tests mongrel does to see how it perform (and how valid it is). Anyway, the pastie was to show the overhead of calling C functions in 1.9 compared to the same naive one in pure-ruby. Hopefully I wouldn't need to adapt lot of code from ServerSide to make the tests pass on 1.9. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Fri Dec 14 19:41:11 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 14 Dec 2007 19:41:11 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> Message-ID: <20071214194111.8861e0c3.zedshaw@zedshaw.com> On Fri, 14 Dec 2007 19:05:28 -0300 "Luis Lavena" wrote: > I'll try to rip the ServerSide::HTTP::Parsing module and drop the same > tests mongrel does to see how it perform (and how valid it is). > > Anyway, the pastie was to show the overhead of calling C functions in > 1.9 compared to the same naive one in pure-ruby. > > Hopefully I wouldn't need to adapt lot of code from ServerSide to make > the tests pass on 1.9. I wouldn't bother. A cornerstone of Mongrel's design is that by using a parser generated by a mathematically sound (hopefully) parser Mongrel is able to reject about 80% of security hacks simply becuase they usually violate the RFC grammar. This is in essence creating a white list for HTTP requests and rejecting anything else, with very exact reasons based on grammar violations. What Serverside (and every other web server) does is creates a black list for HTTP requests and allowing nearly all of them through. It gets its speed from basically not being thorough, and it only needs to do this in Ruby. As the mongrel parser shows you can still use a generator and get a fast as hell http parser. So, running off to a web server that's implemented half assed with the goal of bringing said half-assedness to mongrel in order to improve speed would remove nearly all the other advantages. That's simply bad engineering all around. It would be better to instead check a Ruby version of the .rl parser against 1.9 and then see what can be done to speed it up without losing it's valuable exactness. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From evan at cloudbur.st Fri Dec 14 19:37:47 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 19:37:47 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: <20071213024005.5152d75c.zedshaw@zedshaw.com> References: <71166b3b0712121050u21d788cfue3e2927ca67ea718@mail.gmail.com> <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> <20071213024005.5152d75c.zedshaw@zedshaw.com> Message-ID: > Evan, you're kind of being a jerk about this one. Read my comments Sorry; fair enough. > very narrow minded about Rails, Rails, Rails, and that's bad. Rails and Camping, yeah, because those are what I use. Pushback here is good. When people worried about removing the Trie I was happy to give them the option to keep using it. I explained my idea to Wayne and Kirk though and they seemed to mainly agree. If you guys can respond here that would be great. > required no dependencies on build) with your own "simpler" rubygem Point taken, but setup.rb still works, and rakehelp is no longer duplicated in every subproject, and the tarballs now ship dependency-free gemspecs, and the tests run without Rake. Plus I removed the C Trie. > > It discourages encapsulation of your dependencies per-app. I mean, to bundle your entire app and its dependencies in a repository or tarball or something. gem_plugin requires things to be installed in system-wide Rubygems. > encapsulated. Shielded. Protected. Kept from other stuff. Can you Shielded from other apps. > And, what would be your proposed alternative that doesn't use gems and > yet encourages encapsulation? Just the $LOAD_PATH and require(). > Can you give sample code that shows the situation you're talking about > where you MUST use the gemplugin system to load a dependent plain gem? No, but why do we need yet another alternative load mechanism? I hate Rail's override of require() just as much. > > mongrel_cluster, which is our own project, and which basically > Ok, but again, you don't need to use gemplugins. In each place where I > used it, you can also not use it. That's how it always has been. Maybe then it's misapplied in this situation. > the mongrel_rails script needs some way to load new commands that were > added to the system without accessing any list a user controls, and > without requiring much more configuration than a gem install. I think > you might be missing this feature if you're expecting someone to I disagree. The user is running the command from somewhere, and they could specify requirements to load just like you can with Ruby itself. Instead of: gem install mongrel_thingy ./mongrel_rails mongrel::thingy arg gem install mongrel_thingy ./mongrel #{handler_name} arg -rmongrel_thingy (Autoload of Rubygems implied if mongrel_thingy isn't in $LOAD_PATH). The reqs would get loaded first so they can include your handler class, which is just camelcased from ARGV[0] and mounted on '/'. This breaks us out of a Rails specific runner which I think is undeniably a good thing. > I think of them as standalone > components that are loaded Like plain gems and libraries. > they were designed so people who wanted to contribute a handler or > command for mongrel could package it independently of the mongrel That is the goal. Right now the runner only runs Rails, I want to move it to run any handler. The Rails team would like to work on their own handler internally anyway instead of having it shipped with Mongrel. > Uh, it does provide an interface using the -S option to provide a > configuration script, and that's even documented. Do you mean for > commands or for handlers? I mean for automatically adding commands without having to duplicate everything that is already there regarding process and cluster management. Maybe I don't understand. > no viable tested and agreed on alternative worked on yet. That's why we're talking about it. > > I think if you went and worked on the alternative you'd have a more > convincing argument, especially if it was simply, "Look bitch! My code > simpla!" True but I want feedback before doing something ridiculous. I mention most of this stuff in #mongrel-dev, Wayne and Luis and Kirk have seen it before. > Well, the glorious vision was that I got to write a web server that > everyone uses, which is pretty much what I did so that's cool. Yes. Evan -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Fri Dec 14 19:43:02 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 19:43:02 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <20071214194111.8861e0c3.zedshaw@zedshaw.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> Message-ID: Yeah I am not a fan of a regex parser. What exactly is the deal with events on 1.9? How many connections should we realistically expect? Would it be just as good to use select()? My understanding is that Fibers don't cooperatively multitask the way green threads do, so I don't think Fibers will offer a way forward without horrible hacks. On the other hand, I'm not totally clear how events solve this situation but I haven't looked at any evented lib Is there a way we could re-use a small process pool, and queue extra requests in a simple buffer? How many contexts do you need to get decent CPU saturation in most situations? Do they usually wait on IO 20% of the time, or 60%, or... I realize I am asking for benchmarks without any context. My understand is that WSGI is excellent (Python). How do they handle these issues? Python's threads are just like YARV's. Evan On Dec 14, 2007 7:41 PM, Zed A. Shaw wrote: > On Fri, 14 Dec 2007 19:05:28 -0300 > "Luis Lavena" wrote: > > > I'll try to rip the ServerSide::HTTP::Parsing module and drop the same > > tests mongrel does to see how it perform (and how valid it is). > > > > Anyway, the pastie was to show the overhead of calling C functions in > > 1.9 compared to the same naive one in pure-ruby. > > > > Hopefully I wouldn't need to adapt lot of code from ServerSide to make > > the tests pass on 1.9. > > I wouldn't bother. A cornerstone of Mongrel's design is that by using > a parser generated by a mathematically sound (hopefully) parser Mongrel > is able to reject about 80% of security hacks simply becuase they > usually violate the RFC grammar. > > This is in essence creating a white list for HTTP requests and > rejecting anything else, with very exact reasons based on grammar > violations. > > What Serverside (and every other web server) does is creates a black > list for HTTP requests and allowing nearly all of them through. It > gets its speed from basically not being thorough, and it only needs to > do this in Ruby. As the mongrel parser shows you can still use a > generator and get a fast as hell http parser. > > So, running off to a web server that's implemented half assed with the > goal of bringing said half-assedness to mongrel in order to improve > speed would remove nearly all the other advantages. That's simply bad > engineering all around. > > It would be better to instead check a Ruby version of the .rl parser > against 1.9 and then see what can be done to speed it up without losing > it's valuable exactness. > > -- > Zed A. Shaw > - Hate: http://savingtheinternetwithhate.com/ > - Good: http://www.zedshaw.com/ > - Evil: http://yearofevil.com/ > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Fri Dec 14 19:47:52 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 19:47:52 -0500 Subject: [Mongrel-development] 1.1.2 Message-ID: Hi all, There is a bug with Mongrel on JRuby 1.0.3 that the JRuby guys want fixed before they release it. If it's ok with people I'd like to fix that, revert (at least for now) the proxy response change, and tag that as 1.1.2 and release it. Anything wrong with this plan? Evan -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Fri Dec 14 19:52:34 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 19:52:34 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> Message-ID: > events solve this situation but I haven't looked at any evented lib Got cut off. I haven't looked at any evented lib in detail. On Dec 14, 2007 7:43 PM, Evan Weaver wrote: > Yeah I am not a fan of a regex parser. > > What exactly is the deal with events on 1.9? How many connections > should we realistically expect? Would it be just as good to use > select()? > > My understanding is that Fibers don't cooperatively multitask the way > green threads do, so I don't think Fibers will offer a way forward > without horrible hacks. On the other hand, I'm not totally clear how > events solve this situation but I haven't looked at any evented lib > > Is there a way we could re-use a small process pool, and queue extra > requests in a simple buffer? How many contexts do you need to get > decent CPU saturation in most situations? Do they usually wait on IO > 20% of the time, or 60%, or... I realize I am asking for benchmarks > without any context. > > My understand is that WSGI is excellent (Python). How do they handle > these issues? Python's threads are just like YARV's. > > Evan > > > On Dec 14, 2007 7:41 PM, Zed A. Shaw wrote: > > On Fri, 14 Dec 2007 19:05:28 -0300 > > "Luis Lavena" wrote: > > > > > I'll try to rip the ServerSide::HTTP::Parsing module and drop the same > > > tests mongrel does to see how it perform (and how valid it is). > > > > > > Anyway, the pastie was to show the overhead of calling C functions in > > > 1.9 compared to the same naive one in pure-ruby. > > > > > > Hopefully I wouldn't need to adapt lot of code from ServerSide to make > > > the tests pass on 1.9. > > > > I wouldn't bother. A cornerstone of Mongrel's design is that by using > > a parser generated by a mathematically sound (hopefully) parser Mongrel > > is able to reject about 80% of security hacks simply becuase they > > usually violate the RFC grammar. > > > > This is in essence creating a white list for HTTP requests and > > rejecting anything else, with very exact reasons based on grammar > > violations. > > > > What Serverside (and every other web server) does is creates a black > > list for HTTP requests and allowing nearly all of them through. It > > gets its speed from basically not being thorough, and it only needs to > > do this in Ruby. As the mongrel parser shows you can still use a > > generator and get a fast as hell http parser. > > > > So, running off to a web server that's implemented half assed with the > > goal of bringing said half-assedness to mongrel in order to improve > > speed would remove nearly all the other advantages. That's simply bad > > engineering all around. > > > > It would be better to instead check a Ruby version of the .rl parser > > against 1.9 and then see what can be done to speed it up without losing > > it's valuable exactness. > > > > -- > > Zed A. Shaw > > - Hate: http://savingtheinternetwithhate.com/ > > - Good: http://www.zedshaw.com/ > > - Evil: http://yearofevil.com/ > > > > _______________________________________________ > > Mongrel-development mailing list > > Mongrel-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/mongrel-development > > > > > > -- > Evan Weaver > Cloudburst, LLC > -- Evan Weaver Cloudburst, LLC From zedshaw at zedshaw.com Fri Dec 14 20:37:32 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 14 Dec 2007 20:37:32 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> Message-ID: <20071214203732.c1a9e576.zedshaw@zedshaw.com> On Fri, 14 Dec 2007 19:43:02 -0500 "Evan Weaver" wrote: > Yeah I am not a fan of a regex parser. > > What exactly is the deal with events on 1.9? How many connections > should we realistically expect? Would it be just as good to use > select()? Part of this "events will save" us attitude is based on myth. Originally green or real threads were just too heavyweight for most of the early c10k problems so things like libevent came about. The issue with using libevent though (as I found in my Ruby/Event project) is that Ruby likes being king of the events and doesn't give them up. When you combine the event loop in libevent with the one in ruby via select you get deadlock. Switching to eventmachine won't work either because it's just a heavy layer around select, so you're still stuck at 1024 max open files. When it comes down to it, the ideal situation has been always a fixed set of threads/processes that use some form of event loop (select or other) to handle massive amounts of IO. This usually gives you the most optimal spread of the IO events and give the best parallel processing. Ruby 1.9 might allow this, keeping select and using real threads, but that'd take a serious re-engineer of mongrel. But, I'm looking at maybe resurrecting my Ruby/Event library using libev under 1.9 in order to solve this problem permanently (and cleanly, unlike that garbage festival Ruby/EventMachine is). -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From evan at cloudbur.st Fri Dec 14 20:41:37 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 20:41:37 -0500 Subject: [Mongrel-development] 1.1.2 In-Reply-To: References: Message-ID: Trunk looks kind of unstable now due to changes for 1.9, so I would build this off the 1.1.2 tag instead. Evan On Dec 14, 2007 7:47 PM, Evan Weaver wrote: > Hi all, > > There is a bug with Mongrel on JRuby 1.0.3 that the JRuby guys want > fixed before they release it. > > If it's ok with people I'd like to fix that, revert (at least for now) > the proxy response change, and tag that as 1.1.2 and release it. > > Anything wrong with this plan? > > Evan > > -- > Evan Weaver > Cloudburst, LLC > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Fri Dec 14 20:41:46 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 20:41:46 -0500 Subject: [Mongrel-development] 1.1.2 In-Reply-To: References: Message-ID: 1.1.1 rather. On Dec 14, 2007 8:41 PM, Evan Weaver wrote: > Trunk looks kind of unstable now due to changes for 1.9, so I would > build this off the 1.1.2 tag instead. > > Evan > > > On Dec 14, 2007 7:47 PM, Evan Weaver wrote: > > Hi all, > > > > There is a bug with Mongrel on JRuby 1.0.3 that the JRuby guys want > > fixed before they release it. > > > > If it's ok with people I'd like to fix that, revert (at least for now) > > the proxy response change, and tag that as 1.1.2 and release it. > > > > Anything wrong with this plan? > > > > Evan > > > > -- > > Evan Weaver > > Cloudburst, LLC > > > > > > -- > Evan Weaver > Cloudburst, LLC > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Fri Dec 14 21:10:56 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 14 Dec 2007 21:10:56 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> <20071213024005.5152d75c.zedshaw@zedshaw.com> Message-ID: And just a final, social point; I can be a loose cannon (Wayne has called me as much ;) ), but if you fuss at me I will be reasonable. I haven't been offended by any criticism here. Evan PS. On an unrelated note, what are all the different frameworks we need to keep in mind? Ramaze IOWA Camping Rails Sinatra Nitro (?) ... There must be at 5-10 others. On Dec 14, 2007 7:37 PM, Evan Weaver wrote: > > Evan, you're kind of being a jerk about this one. Read my comments > > Sorry; fair enough. > > > very narrow minded about Rails, Rails, Rails, and that's bad. > > Rails and Camping, yeah, because those are what I use. Pushback here > is good. When people worried about removing the Trie I was happy to > give them the option to keep using it. > > I explained my idea to Wayne and Kirk though and they seemed to mainly > agree. If you guys can respond here that would be great. > > > required no dependencies on build) with your own "simpler" rubygem > > Point taken, but setup.rb still works, and rakehelp is no longer > duplicated in every subproject, and the tarballs now ship > dependency-free gemspecs, and the tests run without Rake. > > Plus I removed the C Trie. > > > > It discourages encapsulation of your dependencies per-app. > > I mean, to bundle your entire app and its dependencies in a repository > or tarball or something. gem_plugin requires things to be installed in > system-wide Rubygems. > > > encapsulated. Shielded. Protected. Kept from other stuff. Can you > > Shielded from other apps. > > > And, what would be your proposed alternative that doesn't use gems and > > yet encourages encapsulation? > > Just the $LOAD_PATH and require(). > > > Can you give sample code that shows the situation you're talking about > > where you MUST use the gemplugin system to load a dependent plain gem? > > No, but why do we need yet another alternative load mechanism? I hate > Rail's override of require() just as much. > > > > mongrel_cluster, which is our own project, and which basically > > > Ok, but again, you don't need to use gemplugins. In each place where I > > used it, you can also not use it. That's how it always has been. > > Maybe then it's misapplied in this situation. > > > the mongrel_rails script needs some way to load new commands that were > > added to the system without accessing any list a user controls, and > > without requiring much more configuration than a gem install. I think > > you might be missing this feature if you're expecting someone to > > I disagree. The user is running the command from somewhere, and they > could specify requirements to load just like you can with Ruby itself. > > Instead of: > > gem install mongrel_thingy > ./mongrel_rails mongrel::thingy arg > > gem install mongrel_thingy > ./mongrel #{handler_name} arg -rmongrel_thingy > > (Autoload of Rubygems implied if mongrel_thingy isn't in $LOAD_PATH). > The reqs would get loaded first so they can include your handler > class, which is just camelcased from ARGV[0] and mounted on '/'. > > This breaks us out of a Rails specific runner which I think is > undeniably a good thing. > > > I think of them as standalone > > components that are loaded > > Like plain gems and libraries. > > > they were designed so people who wanted to contribute a handler or > > command for mongrel could package it independently of the mongrel > > That is the goal. Right now the runner only runs Rails, I want to move > it to run any handler. The Rails team would like to work on their own > handler internally anyway instead of having it shipped with Mongrel. > > > Uh, it does provide an interface using the -S option to provide a > > configuration script, and that's even documented. Do you mean for > > commands or for handlers? > > I mean for automatically adding commands without having to duplicate > everything that is already there regarding process and cluster > management. Maybe I don't understand. > > > no viable tested and agreed on alternative worked on yet. > > That's why we're talking about it. > > > > > I think if you went and worked on the alternative you'd have a more > > convincing argument, especially if it was simply, "Look bitch! My code > > simpla!" > > True but I want feedback before doing something ridiculous. I mention > most of this stuff in #mongrel-dev, Wayne and Luis and Kirk have seen > it before. > > > Well, the glorious vision was that I got to write a web server that > > everyone uses, which is pretty much what I did so that's cool. > > Yes. > > > Evan > > -- > Evan Weaver > Cloudburst, LLC > -- Evan Weaver Cloudburst, LLC From filipe at icewall.org Fri Dec 14 21:32:53 2007 From: filipe at icewall.org (Filipe) Date: Sat, 15 Dec 2007 00:32:53 -0200 (BRST) Subject: [Mongrel-development] 1.1.2 In-Reply-To: References: Message-ID: Yo, go for it. Changes for 1.9 (just 2, one changing "when ... :" for "when ... then" and other to the C code) are not a problem. But there are some other logging changes and maybe some other things around there, as we discussed in the irc. So it's easier for you to use tag 1.1.1 and just backport the bug that was closed in trunk :) Let's leave 1.9 compatibility and logging things for 1.2 release next year, along with some other cool ideas that may pop up until there. Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } On Fri, 14 Dec 2007, Evan Weaver wrote: > 1.1.1 rather. > > On Dec 14, 2007 8:41 PM, Evan Weaver wrote: >> Trunk looks kind of unstable now due to changes for 1.9, so I would >> build this off the 1.1.2 tag instead. >> >> Evan >> >> >> On Dec 14, 2007 7:47 PM, Evan Weaver wrote: >>> Hi all, >>> >>> There is a bug with Mongrel on JRuby 1.0.3 that the JRuby guys want >>> fixed before they release it. >>> >>> If it's ok with people I'd like to fix that, revert (at least for now) >>> the proxy response change, and tag that as 1.1.2 and release it. >>> >>> Anything wrong with this plan? >>> >>> Evan >>> >>> -- >>> Evan Weaver >>> Cloudburst, LLC >>> >> >> >> >> -- >> Evan Weaver >> Cloudburst, LLC >> > > > > -- > Evan Weaver > Cloudburst, LLC > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > From luislavena at gmail.com Fri Dec 14 21:53:42 2007 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 14 Dec 2007 23:53:42 -0300 Subject: [Mongrel-development] 1.1.2 In-Reply-To: References: Message-ID: <71166b3b0712141853r14c37362h8a6526578d27b066@mail.gmail.com> On Dec 14, 2007 11:32 PM, Filipe wrote: > > Yo, go for it. Changes for 1.9 (just 2, one changing "when ... :" for > "when ... then" and other to the C code) are not a problem. But there are > some other logging changes and maybe some other things around there, as > we discussed in the irc. > > So it's easier for you to use tag 1.1.1 and just backport the bug that > was closed in trunk :) > > Let's leave 1.9 compatibility and logging things for 1.2 release next > year, along with some other cool ideas that may pop up until there. > +1 to Filipe comments. use 1.1.1 as base for 1.1.2 and we should start doing the 1.2 on a branch until we get something stable. Nice weekend everyone! -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From luislavena at gmail.com Fri Dec 14 22:04:05 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 15 Dec 2007 00:04:05 -0300 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <20071214194111.8861e0c3.zedshaw@zedshaw.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> Message-ID: <71166b3b0712141904g202c5e25q575df70ca6abd381@mail.gmail.com> On Dec 14, 2007 9:41 PM, Zed A. Shaw wrote: [...] > > I wouldn't bother. A cornerstone of Mongrel's design is that by using > a parser generated by a mathematically sound (hopefully) parser Mongrel > is able to reject about 80% of security hacks simply becuase they > usually violate the RFC grammar. > > This is in essence creating a white list for HTTP requests and > rejecting anything else, with very exact reasons based on grammar > violations. > > What Serverside (and every other web server) does is creates a black > list for HTTP requests and allowing nearly all of them through. It > gets its speed from basically not being thorough, and it only needs to > do this in Ruby. As the mongrel parser shows you can still use a > generator and get a fast as hell http parser. > > So, running off to a web server that's implemented half assed with the > goal of bringing said half-assedness to mongrel in order to improve > speed would remove nearly all the other advantages. That's simply bad > engineering all around. > That wasn't my point, I was trying to comment that we could bomb ServerSide HTTP parser with Mongrel tests and see how it behaves. I wasn't thinking on replace it. The curious note is that a lot of server, the ruby based ones and other based on twisted (python) take the evented approach, which is "funny", just a foot note, not actually a desire to implement. > It would be better to instead check a Ruby version of the .rl parser > against 1.9 and then see what can be done to speed it up without losing > it's valuable exactness. I still agree with you on that. I need to get a stable 1.9 version for windows to abuse (er, I mean, to use). -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From luislavena at gmail.com Fri Dec 14 22:10:25 2007 From: luislavena at gmail.com (Luis Lavena) Date: Sat, 15 Dec 2007 00:10:25 -0300 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <20071214203732.c1a9e576.zedshaw@zedshaw.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> Message-ID: <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> On Dec 14, 2007 10:37 PM, Zed A. Shaw wrote: > On Fri, 14 Dec 2007 19:43:02 -0500 > "Evan Weaver" wrote: > > > Yeah I am not a fan of a regex parser. > > > > What exactly is the deal with events on 1.9? How many connections > > should we realistically expect? Would it be just as good to use > > select()? > > Part of this "events will save" us attitude is based on myth. > Originally green or real threads were just too heavyweight for most of > the early c10k problems so things like libevent came about. The issue > with using libevent though (as I found in my Ruby/Event project) is > that Ruby likes being king of the events and doesn't give them up. > When you combine the event loop in libevent with the one in ruby via > select you get deadlock. > As replied before, I don't think event will save us, but is interesting that lot of frameworks/server take that approach "as a solution"... when ruby is the true limiting factor in the whole equation. > Switching to eventmachine won't work either because it's just a heavy > layer around select, so you're still stuck at 1024 max open files. > We need to figure out how to elude this ruby limitation. Or fix ruby, or drop it for good. > When it comes down to it, the ideal situation has been always a fixed > set of threads/processes that use some form of event loop (select or > other) to handle massive amounts of IO. This usually gives you the > most optimal spread of the IO events and give the best parallel > processing. Worker pools? In my experience they are hard to debug and bugs often are too deep and hidden to really fix them (not to mention some deadlocks)... But maybe that talks on my lack of experience with them. > Ruby 1.9 might allow this, keeping select and using real threads, but > that'd take a serious re-engineer of mongrel. > > But, I'm looking at maybe resurrecting my Ruby/Event library using > libev under 1.9 in order to solve this problem permanently (and > cleanly, unlike that garbage festival Ruby/EventMachine is). Amen on that. I just took the eventmachine code to "see" what is in there and couldn't understand it well... (ala, a mess?) Also tried to run the tests and 'see' them pass on windows and it crashed badly. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From evan at cloudbur.st Sat Dec 15 04:01:05 2007 From: evan at cloudbur.st (Evan Weaver) Date: Sat, 15 Dec 2007 04:01:05 -0500 Subject: [Mongrel-development] 1.1.2 In-Reply-To: <71166b3b0712141853r14c37362h8a6526578d27b066@mail.gmail.com> References: <71166b3b0712141853r14c37362h8a6526578d27b066@mail.gmail.com> Message-ID: It's done; tagged off of branches/stable_1-1. I packaged Ruby and cross-packaged Java from Rubygems 0.9.5 on OS X; I packaged Win32 from Rubygems 0.9.4 in Windows itself. Evan On Dec 14, 2007 9:53 PM, Luis Lavena wrote: > On Dec 14, 2007 11:32 PM, Filipe wrote: > > > > Yo, go for it. Changes for 1.9 (just 2, one changing "when ... :" for > > "when ... then" and other to the C code) are not a problem. But there are > > some other logging changes and maybe some other things around there, as > > we discussed in the irc. > > > > So it's easier for you to use tag 1.1.1 and just backport the bug that > > was closed in trunk :) > > > > Let's leave 1.9 compatibility and logging things for 1.2 release next > > year, along with some other cool ideas that may pop up until there. > > > > +1 to Filipe comments. > > use 1.1.1 as base for 1.1.2 and we should start doing the 1.2 on a > branch until we get something stable. > > Nice weekend everyone! > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From evan at cloudbur.st Sat Dec 15 05:01:17 2007 From: evan at cloudbur.st (Evan Weaver) Date: Sat, 15 Dec 2007 05:01:17 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> Message-ID: I see now that WSGI is a interface spec, not a single server. What's the main WSGI server? Apache/mod_wsgi? The stdlib wsgiref.simple_server looks like Webrick. CherryPy's server looks pretty good ( http://www.cherrypy.org/browser/trunk/cherrypy/wsgiserver/__init__.py ). They use a thread pool with a queue. I guess the GIL lets them sidestep queue race issues? Evan On Dec 14, 2007 10:10 PM, Luis Lavena wrote: > On Dec 14, 2007 10:37 PM, Zed A. Shaw wrote: > > On Fri, 14 Dec 2007 19:43:02 -0500 > > "Evan Weaver" wrote: > > > > > Yeah I am not a fan of a regex parser. > > > > > > What exactly is the deal with events on 1.9? How many connections > > > should we realistically expect? Would it be just as good to use > > > select()? > > > > Part of this "events will save" us attitude is based on myth. > > Originally green or real threads were just too heavyweight for most of > > the early c10k problems so things like libevent came about. The issue > > with using libevent though (as I found in my Ruby/Event project) is > > that Ruby likes being king of the events and doesn't give them up. > > When you combine the event loop in libevent with the one in ruby via > > select you get deadlock. > > > > As replied before, I don't think event will save us, but is > interesting that lot of frameworks/server take that approach "as a > solution"... when ruby is the true limiting factor in the whole > equation. > > > Switching to eventmachine won't work either because it's just a heavy > > layer around select, so you're still stuck at 1024 max open files. > > > > We need to figure out how to elude this ruby limitation. Or fix ruby, > or drop it for good. > > > When it comes down to it, the ideal situation has been always a fixed > > set of threads/processes that use some form of event loop (select or > > other) to handle massive amounts of IO. This usually gives you the > > most optimal spread of the IO events and give the best parallel > > processing. > > Worker pools? In my experience they are hard to debug and bugs often > are too deep and hidden to really fix them (not to mention some > deadlocks)... > > But maybe that talks on my lack of experience with them. > > > Ruby 1.9 might allow this, keeping select and using real threads, but > > that'd take a serious re-engineer of mongrel. > > > > But, I'm looking at maybe resurrecting my Ruby/Event library using > > libev under 1.9 in order to solve this problem permanently (and > > cleanly, unlike that garbage festival Ruby/EventMachine is). > > Amen on that. I just took the eventmachine code to "see" what is in > there and couldn't understand it well... (ala, a mess?) > > Also tried to run the tests and 'see' them pass on windows and it crashed badly. > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From wayneeseguin at gmail.com Sat Dec 15 08:41:21 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sat, 15 Dec 2007 08:41:21 -0500 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> <20071213024005.5152d75c.zedshaw@zedshaw.com> Message-ID: On Dec 14, 2007 9:10 PM, Evan Weaver wrote: > And just a final, social point; I can be a loose cannon (Wayne has > called me as much ;) ), but if you fuss at me I will be reasonable. I > haven't been offended by any criticism here. > > Evan I meant it with respect :-p -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071215/ffd17db7/attachment.html From wayneeseguin at gmail.com Sat Dec 15 08:43:30 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sat, 15 Dec 2007 08:43:30 -0500 Subject: [Mongrel-development] 1.1.2 In-Reply-To: References: Message-ID: On Dec 14, 2007 9:32 PM, Filipe wrote: > Let's leave 1.9 compatibility and logging things for 1.2 release next > year, along with some other cool ideas that may pop up until there. Just an FYI, Kirk, Evan and I discussed adding Chunked encoding support also. Kirk said it's simple so we're going to target 1.2 for it. ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071215/726fe4b5/attachment.html From wayneeseguin at gmail.com Sat Dec 15 09:05:59 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Sat, 15 Dec 2007 09:05:59 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> Message-ID: On Dec 15, 2007 5:01 AM, Evan Weaver wrote: > I see now that WSGI is a interface spec, not a single server. What's > the main WSGI server? Apache/mod_wsgi? The stdlib > wsgiref.simple_server looks like Webrick. > > CherryPy's server looks pretty good ( > http://www.cherrypy.org/browser/trunk/cherrypy/wsgiserver/__init__.py > ). They use a thread pool with a queue. I guess the GIL lets them > sidestep queue race issues? > > Evan > > Is WSGI something worth pursuing? There is a Nginx WSGI extension now. ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071215/33b4f942/attachment-0001.html From evan at cloudbur.st Sat Dec 15 13:29:41 2007 From: evan at cloudbur.st (Evan Weaver) Date: Sat, 15 Dec 2007 13:29:41 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> Message-ID: Well, it's a Python interface spec. I don't think you can run in any WSGI container without Python. Evan On Dec 15, 2007 9:05 AM, Wayne E. Seguin wrote: > On Dec 15, 2007 5:01 AM, Evan Weaver wrote: > > > I see now that WSGI is a interface spec, not a single server. What's > > the main WSGI server? Apache/mod_wsgi? The stdlib > > wsgiref.simple_server looks like Webrick. > > > > CherryPy's server looks pretty good ( > > http://www.cherrypy.org/browser/trunk/cherrypy/wsgiserver/__init__.py > > ). They use a thread pool with a queue. I guess the GIL lets them > > sidestep queue race issues? > > > > Evan > > > > > > > > > > > > Is WSGI something worth pursuing? There is a Nginx WSGI extension now. > > ~Wayne > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > > -- Evan Weaver Cloudburst, LLC From wyhaines at gmail.com Sat Dec 15 20:53:02 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sat, 15 Dec 2007 18:53:02 -0700 Subject: [Mongrel-development] 1.9 In-Reply-To: References: <71166b3b0712121111l4924734cmb883386db2c2db1f@mail.gmail.com> <71166b3b0712121131t66c5212am3e115341e1b8a7b@mail.gmail.com> <20071212215831.a9e6ed0b.zedshaw@zedshaw.com> <20071213024005.5152d75c.zedshaw@zedshaw.com> Message-ID: On Dec 14, 2007 7:10 PM, Evan Weaver wrote: > And just a final, social point; I can be a loose cannon (Wayne has > called me as much ;) ), but if you fuss at me I will be reasonable. I > haven't been offended by any criticism here. > Ramaze > IOWA > Camping > Rails > Sinatra > Nitro (?) Yes, Nitro. They deploy primarily using Mongrel. Add Merb to that list. And include Rack. That set covers the vast majority of mongrel using frameworks that are in production usage, AFAIK. Kirk From wyhaines at gmail.com Sat Dec 15 22:15:04 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sat, 15 Dec 2007 20:15:04 -0700 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <20071214203732.c1a9e576.zedshaw@zedshaw.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> Message-ID: On Dec 14, 2007 6:37 PM, Zed A. Shaw wrote: > On Fri, 14 Dec 2007 19:43:02 -0500 > Switching to eventmachine won't work either because it's just a heavy > layer around select, so you're still stuck at 1024 max open files. Not exactly. The EM reactor currently supports select() and epoll(). Epoll is Linux only, but on Linux systems one can exceed that 1024 descriptor limit that select() has. I have personally tested it up to 20k open descriptors with no problems. kqueue() will probably be supported in the near future, as well, and likely IOCP for Windows systems. I'm also pushing for Solaris events. Kirk From wyhaines at gmail.com Sat Dec 15 22:19:16 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sat, 15 Dec 2007 20:19:16 -0700 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> Message-ID: On Dec 15, 2007 7:05 AM, Wayne E. Seguin wrote: > Is WSGI something worth pursuing? There is a Nginx WSGI extension now. WSGI is just a pre-framework layer. It standardizes an API for request and response handling -- all those little bits that frameworks and servers tend to invent/reinvent it left to do so. Ruby has a pretty well implemented WSGI-like layer, called Rack. Kirk From wyhaines at gmail.com Sat Dec 15 23:38:40 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sat, 15 Dec 2007 21:38:40 -0700 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> Message-ID: On Dec 14, 2007 8:10 PM, Luis Lavena wrote: > Amen on that. I just took the eventmachine code to "see" what is in > there and couldn't understand it well... (ala, a mess?) The API is well documented. In the ext/* code, rubymain.cpp is the extension code itself that glues Ruby to the reactor. cmain.cpp is the main C++ code file. It ties everything else together. Most of the meat of the reactor is in em.cpp. ed.cpp has the code for the eventable descriptors. Most of the rest of it are associated things like support for events on keyboard, files, pipes; ssl support; epoll support, lightweight concurrency, and misc other bits. > Also tried to run the tests and 'see' them pass on windows and it crashed badly. I've been looking at the tests. On my Linux systems there are a couple bugs in the 0.10.0 release's tests. The current gem release for Windows is 0.8.1, and in addition to the bugs that show up on Linux, there are some other testing issues to deal with. I am addressing them. Hopefully we'll have a 0.10.0 gem release for Windows very soon. Kirk From evan at cloudbur.st Sun Dec 16 02:35:27 2007 From: evan at cloudbur.st (Evan Weaver) Date: Sun, 16 Dec 2007 02:35:27 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <71166b3b0712141910m5f8e23d5h9bb6627d46bf672e@mail.gmail.com> Message-ID: Don't forget this classic paper about events: http://www.kegel.com/c10k.html Evan On Dec 15, 2007 11:38 PM, Kirk Haines wrote: > On Dec 14, 2007 8:10 PM, Luis Lavena wrote: > > > Amen on that. I just took the eventmachine code to "see" what is in > > there and couldn't understand it well... (ala, a mess?) > > The API is well documented. In the ext/* code, rubymain.cpp is the > extension code itself that glues Ruby to the reactor. > > cmain.cpp is the main C++ code file. It ties everything else together. > > Most of the meat of the reactor is in em.cpp. > > ed.cpp has the code for the eventable descriptors. Most of the rest > of it are associated things like support for events on keyboard, > files, pipes; ssl support; epoll support, lightweight concurrency, and > misc other bits. > > > Also tried to run the tests and 'see' them pass on windows and it crashed badly. > > I've been looking at the tests. On my Linux systems there are a > couple bugs in the 0.10.0 release's tests. The current gem release > for Windows is 0.8.1, and in addition to the bugs that show up on > Linux, there are some other testing issues to deal with. I am > addressing them. Hopefully we'll have a 0.10.0 gem release for > Windows very soon. > > > Kirk > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From zedshaw at zedshaw.com Sun Dec 16 11:45:50 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 16 Dec 2007 11:45:50 -0500 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> Message-ID: <20071216114550.3db98415.zedshaw@zedshaw.com> On Sat, 15 Dec 2007 20:15:04 -0700 "Kirk Haines" wrote: > On Dec 14, 2007 6:37 PM, Zed A. Shaw wrote: > > On Fri, 14 Dec 2007 19:43:02 -0500 > > > Switching to eventmachine won't work either because it's just a heavy > > layer around select, so you're still stuck at 1024 max open files. > > Not exactly. The EM reactor currently supports select() and epoll(). > Epoll is Linux only, but on Linux systems one can exceed that 1024 > descriptor limit that select() has. I have personally tested it up to > 20k open descriptors with no problems. You know, for years EM has been full of lies so I'll just take the time (once again) to verify what's being claimed before I trust it. > kqueue() will probably be supported in the near future, as well, and > likely IOCP for Windows systems. I'm also pushing for Solaris events. Riiight, just after all that C++ is cleaned up right? Right after it goes "pure ruby"? Face it, EM is a pile of dogshit and it pains me to see people use it. Especially when the real solution is for Ruby to finally get its head out of its ass and stop using select. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From wyhaines at gmail.com Sun Dec 16 14:39:17 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sun, 16 Dec 2007 12:39:17 -0700 Subject: [Mongrel-development] Some silly benchs (was: 1.9) In-Reply-To: <20071216114550.3db98415.zedshaw@zedshaw.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <20071216114550.3db98415.zedshaw@zedshaw.com> Message-ID: On Dec 16, 2007 9:45 AM, Zed A. Shaw wrote: > You know, for years EM has been full of lies so I'll just take the time > (once again) to verify what's being claimed before I trust it. You are so full of vitriol, Zed. It boggles my mind. I _use_ the epoll support. I've hammered it. Lots of other people do, too. > Riiight, just after all that C++ is cleaned up right? Right after it > goes "pure ruby"? What's your definition of "cleaned up"? The code is pretty damn clean. It's easily as readable and understandable as the libev code, and better documented. So what if it's C++ instead of C? And yes, there is a supported pure ruby version, as well as a pure Java version. > Face it, EM is a pile of dogshit and it pains me to see people use it. > Especially when the real solution is for Ruby to finally get its head > out of its ass and stop using select. It performs. Solidly. It's extremely simple to use. It's simple to work on, too. Your anger, apart from being your shtick, is just tired. And even if, tomorrow, Ruby switched to a model where it could use select for portability reasons, but would switch between epoll, kqueue, solaris events, IOCP, etc... depending on platform, it wouldn't matter that much. A very, very large piece of the EM codebase is supporting code for the event reactor. A stucture to build protocols with; support for events other than network events; lightweight concurrency features, deferables, futures, etc.... The reactor would change, but everything else would still be applicable. Kirk Haines From zedshaw at zedshaw.com Sun Dec 16 16:08:52 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Sun, 16 Dec 2007 16:08:52 -0500 Subject: [Mongrel-development] The case against EM (for now) (was: Some silly benchs) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <20071216114550.3db98415.zedshaw@zedshaw.com> Message-ID: <20071216160852.a49e2ebf.zedshaw@zedshaw.com> On Sun, 16 Dec 2007 12:39:17 -0700 "Kirk Haines" wrote: > On Dec 16, 2007 9:45 AM, Zed A. Shaw wrote: > > > You know, for years EM has been full of lies so I'll just take the time > > (once again) to verify what's being claimed before I trust it. > > You are so full of vitriol, Zed. It boggles my mind. I _use_ the > epoll support. I've hammered it. Lots of other people do, too. Fair enough, let's become rational about this then. First, my statements aren't vitriol at all, but instead caution over a project I found dubious. You however seem to confuse hatred of bad code with hatred of the people who wrote it. No such hatred here at all. And, honestly it's been a little while since I wandered through the code to see if it's improved, so let's take a new look. Referring to this post: http://rubyforge.org/pipermail/eventmachine-talk/2007-December/001296.html In reply to Frankie Rai who was asking how to use large numbers of FDs the reply was: "EM's reactor uses select(2), which is the most portable way to do it. It also supports epoll where available. It would not be difficult to add kqueue support to the EM reactor. It's quite similar to epoll and it probably wouldn't be a big job." That says to me that, despite claims, there's something up or people are very misinformed. Taking a look at the code in .cpp files it does have epoll support, I see this in the epoll.cpp file: #ifdef HAVE_EPOLL #include "project.h" #endif // HAVE_EPOLL Nice, just include a project.h. That totally works. So now someone has to dig through the .cpp to find out where epoll is being used. After looking in rubymain.cpp, and then em.cpp I find that it seems to be implemented like this: 1) epoll manages the sockets it needs to deal with, and then uses a "LoopBreaker" to keep it's event loop going. This LoopBreaker is an fd that's used to break some loop. Let's dig further. 2) Further down in _RunSelectOnce we see that it loads the LoopBreaker and any "eventable descriptors" into the normal select fdread/fdwrite list and then loops them. a) It seems to be calling something called EmSelect, geeeee I wonder what THAT does. b) This EmSelect periodically runs via a Quantum of 90000 us_sec (hardcoded too btw). 4) Inside this loop EM is basically "layering" the epoll events on top of the normal ruby select loop and using a timebased polling system. 5) This makes me wonder, how's it loading these, and is it putting in fewer than select can handle. Taking a look further up, there's a loop that goes through all Descriptors (wtf, is that a singleton? goodbye thread safety) and adding any that are read/write ready. What happens if more than 1024 are ready? Don't see it limiting here. 6) In effect, my statement is correct. EM layers an epoll event loop on top of a regular select loop using a timed polling method. It is a complicated framework built on select. Now I'm sure there's all sorts of great reasons this was done, and I'm sure it works, but works and clean/well-written are two totally different things. Put all the comments you want, if people go around saying that "it has epoll" and a quick look shows that even epoll uses select, then that's a lie. Having epoll support and *only* using epoll are very different. I will say it has improved vastly in code quality since the 0.8.x days. I think if there was some more honest effort in making people like me happy it'd be worth using. Let's take a look at security now. If you go hit the page for probably the most secure web server ever: http://www.and.org/and-httpd/ The man has a $2000 reward if you find a hole in his stuff. What's his special power? One tool is grep: egrep '[^_.>a-zA-Z0-9](str(n?cpy|n?cat|xfrm|n?dup|str|pbrk|tok|_)|stpn?\ cpy|r?index[^.]|a?sn?printf|byte_)' src/*.c Yep, that's right, a single grep can find all sorts of security holes. I use it, and flag any place I *must* use those functions. Let's take a look at the .cpp: binder.cpp: static int index = 0; binder.cpp: if ((index >= 1000000) || (seed.length() == 0)) { binder.cpp: sprintf (u2 + (i * 2), "%02x", u1[i]); binder.cpp: index = 0; binder.cpp: ss << seed << (++index); em.cpp: snprintf (buf, sizeof(buf)-1, "unable to create epoll descriptor: %s", strerror(errno)); em.cpp: snprintf (buf, sizeof(buf)-1, "unable to delete epoll event: %s", strerror(errno)); em.cpp: snprintf (buf, sizeof(buf)-1, "unable to modify epoll event: %s", strerror(errno)); em.cpp: strcpy (pun.sun_path, server); em.cpp: snprintf (buf, sizeof(buf)-1, "unable to add new descriptor: %s", strerror(errno)); em.cpp: strncpy (s_sun.sun_path, filename, sizeof(s_sun.sun_path)-1); rubymain.cpp: snprintf (buf, sizeof(buf)-1, "no popen: %s", (err?err:"???")); rubymain.cpp: snprintf (buf, sizeof(buf)-1, ": %s %s", StringValuePtr(filename),(err?err:"???")); ssl.cpp: strcpy (buf, "kittycat"); Nice, much better than when I first looked at the code, but still quite a few potential attack vectors. But wait a minute, what's this "kittycat" in ssl.cpp? extern "C" int builtin_passwd_cb (char *buf, int bufsize, int rwflag, void *userdata) { strcpy (buf, "kittycat"); return 8; } WTF, let's hope nobody's using that. Taking a closer look, it seems the ssl support has embedded SSL keys and other goodies. Let's hope that's been reviewed by someone competent. Finally, let's take a look at code size. A simple wc -l on the .cpp, .h, and .rb files shows the raw lines at around 9819 lines including comments and the very limited amount of whitespace used in the project (just hit the enter key once in a while ok?). Not too bad for a simple event loop project. However, the Mongrel source is 3278 lines of .rb|.rl|.h (don't count .c since it's generated). So, an entire functional web server is almost 1/3rd the size of the whole EM project's gear. I know, I know, "apples and oranges" but not really. When evaluating a project for possible inclusion I first look at code size, then license, then go trolling to potential warning signs and review the design. After all that I review the claims. So, I'll upgrade my assessment of EM's code: * It is still way too much .cpp for my tastes, and I bet a large majority of this could be put in .rb. * The security passwords and keys in ssl.cpp make me wonder. * Use of the above str*() functions is always bad. Just remove them since there's very good alternatives available. In the rare cases you *must* use it, comment the hell out of it. * It *still* uses select. I don't care what anyone says, but if the epoll event loop then calls select, it is still going to be limited by select, just not as limited. Don't even make the claim it uses epoll again unless it *only* uses epoll. * It is still a huge project with dubious design decisions (Descriptors for *all* descriptors?) that I'd rather avoid. TWO GARBAGE CATS? Now, my final question for anyone intersted is: Who the fuck is Francis Girardeau and why does Francis Cianfrocca keep pretending to be him: http://rubyforge.org/users/garbagecat/ http://rubyforge.org/users/blackhedd/ http://rubyforge.org/scm/?group_id=1555 Notice that blackhedd does most of the commits, but for some reason FC likes being both people in his communications: http://www.koders.com/?s=%22Francis+Cianfrocca%22&la=*&li=*&scope=SRPPH8V57VZFKPQF9K8KMLXB7C http://www.koders.com/default.aspx?s=garbagecat10&btn=&la=*&li=* http://www.koders.com/default.aspx?s=garbagecat20&btn=&la=*&li=* Further research shows plenty of hits for an FC living in NYC, but the only mention of FG is a hospital. That one single act makes me not trust the project. It's been like this for *years* and nobody really noticed, which is why I worry about you guys sometimes and why I bring up that you shouldn't include it in Mongrel directly. Everyone is free to use whatever they want, but I'm also free to report my findings and opinions on the matter. If Francis has a reasonable explanation as to why he's pretending to be two different people on the EventMachine project then I'd like to hear it. Actually I wouldn't, it would probably be all lies anyway, just like the above. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From wyhaines at gmail.com Sun Dec 16 19:00:38 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sun, 16 Dec 2007 17:00:38 -0700 Subject: [Mongrel-development] The case against EM (for now) (was: Some silly benchs) In-Reply-To: <20071216160852.a49e2ebf.zedshaw@zedshaw.com> References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <20071216114550.3db98415.zedshaw@zedshaw.com> <20071216160852.a49e2ebf.zedshaw@zedshaw.com> Message-ID: On Dec 16, 2007 2:08 PM, Zed A. Shaw wrote: > 1) epoll manages the sockets it needs to deal with, and then uses a > "LoopBreaker" to keep it's event loop going. This LoopBreaker is an fd > that's used to break some loop. Let's dig further. > 2) Further down in _RunSelectOnce we see that it loads the LoopBreaker > and any "eventable descriptors" into the normal select fdread/fdwrite > list and then loops them. > a) It seems to be calling something called EmSelect, geeeee I wonder > what THAT does. > b) This EmSelect periodically runs via a Quantum of 90000 us_sec > (hardcoded too btw). > 4) Inside this loop EM is basically "layering" the epoll events on top > of the normal ruby select loop and using a timebased polling system. In order for EM to do what couldn't be done with Ruby/Event, it has to coexist with the Ruby threads. EmSelect is ruby_thread_select. The default Quantum is set to be just a little shorter than the default scheduling interval for Ruby. It can be set by the user, though, to whatever works for one's application: EventMachine.set_timer_quantum(99) > 6) In effect, my statement is correct. EM layers an epoll event loop > on top of a regular select loop using a timed polling method. It is a > complicated framework built on select. It's built so that it works with Ruby, allowing Ruby threads to run. > Now I'm sure there's all sorts of great reasons this was done, and I'm > sure it works, but works and clean/well-written are two totally > different things. Put all the comments you want, if people go around > saying that "it has epoll" and a quick look shows that even epoll uses > select, then that's a lie. Having epoll support and *only* using epoll > are very different. It coexists with rb_thread_select. That's the crucial missing part of your analysis. EM is using epoll, but EM does its work by interleaving with Ruby's select based thread management so that ruby threads outside of EM have a chance to run, without deadlocks. What EM will need to be doing in the face of the changes in 1.9 is a discussion, much like the one we are having about Mongrel, that needs to take place. > I will say it has improved vastly in code quality since the 0.8.x > days. I think if there was some more honest effort in making people > like me happy it'd be worth using. And *I* am happy to put time towards addressing real issues. > I use it, and flag any place I *must* use those functions. Let's take > a look at the .cpp: > > binder.cpp: static int index = 0; > binder.cpp: if ((index >= 1000000) || (seed.length() == 0)) { > binder.cpp: sprintf (u2 + (i * 2), "%02x", u1[i]); > binder.cpp: index = 0; > binder.cpp: ss << seed << (++index); > em.cpp: snprintf (buf, sizeof(buf)-1, "unable to create > epoll descriptor: %s", strerror(errno)); > em.cpp: snprintf (buf, sizeof(buf)-1, > "unable to delete epoll event: %s", strerror(errno)); > em.cpp: snprintf (buf, sizeof(buf)-1, "unable to modify > epoll event: %s", strerror(errno)); em.cpp: strcpy (pun.sun_path, > server); em.cpp: snprintf (buf, sizeof(buf)-1, > "unable to add new descriptor: %s", strerror(errno)); em.cpp: strncpy > (s_sun.sun_path, filename, sizeof(s_sun.sun_path)-1); > rubymain.cpp: snprintf (buf, sizeof(buf)-1, "no popen: %s", > (err?err:"???")); rubymain.cpp: snprintf (buf, sizeof(buf)-1, > ": %s %s", StringValuePtr(filename),(err?err:"???")); ssl.cpp: > strcpy (buf, "kittycat"); Yep. Some of those things probably deserve attention and maybe changes. I'm making a note of them. > Nice, much better than when I first looked at the code, but still quite > a few potential attack vectors. But wait a minute, what's this > "kittycat" in ssl.cpp? The first pass of the SSL support used hardcoded privkey and creds. Those are still there, but anyone with any sense uses set_tls_params() to provide their own privkey and cert. > Finally, let's take a look at code size. A simple wc -l on > the .cpp, .h, and .rb files shows the raw lines at around 9819 lines > including comments and the very limited amount of whitespace used in > the project (just hit the enter key once in a while ok?). Not too bad > for a simple event loop project. ??? 2388 lines in the C++ and Ruby code files are blank lines. And a huge number of the remaining lines are comments. Most of the code is very comment heavy. > TWO GARBAGE CATS? > > Now, my final question for anyone intersted is: > > Who the fuck is Francis Girardeau and why does Francis Cianfrocca keep > pretending to be him: . . . > That one single act makes me not trust the project. It's been like > this for *years* and nobody really noticed, which is why I worry about > you guys sometimes and why I bring up that you shouldn't include it in > Mongrel directly. Everyone is free to use whatever they want, but I'm > also free to report my findings and opinions on the matter. 1) Do you honestly think that nobody has ever noticed this before? 2) Who cares? If the code works; if the license terms are acceptable; if my patches are accepted and the reasonable changes that I need in the codebase happen, then I don't really give a rat's ass about the "Francis Girardeau" name that is on the rubyforge project. It doesn't appear anywhere in the source, nor the licensing, nor the copyright notices. It's a curiosity, at most. Kirk Haines From luislavena at gmail.com Tue Dec 18 02:44:14 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Dec 2007 04:44:14 -0300 Subject: [Mongrel-development] First Shoot, many more to appear: Rails on Ruby 1.9 Message-ID: <71166b3b0712172344l390ff828wcbb8ace7a0f4c118@mail.gmail.com> Guys, Subject says everything: http://www.frederico-araujo.com/2007/12/18/my-first-successful-booting-rails-2-0-2-ruby-1-9-attempt Even ActionView uses Proc.binding (which isn't correctly supported in 1.9) it appears that lot of folks will try to put their hands in Ruby 1.9 when it comes out, and of course, try to get Rails with Mongrel running in it. Zed, Wayne, Evan and ry: maybe we need an official statement about it? (put in the web site?) I know Evan did a blog post about it, but still, we need to work on something that: Warn the user on running mongrel with 1.9 (until we got it working). Limit the gem to work only with 1.8 line (instead of >= 1.8.4) #=> '>= 1.8.4', '< 1.9.0' or #=> '~> 1.8.4' ? Do a RUBY_VERSION check in the code and warn the user about it. Thoughts? -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Tue Dec 18 05:46:52 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Tue, 18 Dec 2007 05:46:52 -0500 Subject: [Mongrel-development] The case against EM (for now) (was: Some silly benchs) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <71166b3b0712141405s4a5ebfeco5ddb3e383aafda5b@mail.gmail.com> <20071214194111.8861e0c3.zedshaw@zedshaw.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <20071216114550.3db98415.zedshaw@zedshaw.com> <20071216160852.a49e2ebf.zedshaw@zedshaw.com> Message-ID: <20071218054652.dcc3a595.zedshaw@zedshaw.com> On Sun, 16 Dec 2007 17:00:38 -0700 "Kirk Haines" wrote: > In order for EM to do what couldn't be done with Ruby/Event, it has to > coexist with the Ruby threads. > EmSelect is ruby_thread_select. And that means it's *still* using select. You haven't disproven this, and it's a shitty design. > > 6) In effect, my statement is correct. EM layers an epoll event loop > > on top of a regular select loop using a timed polling method. It is a > > complicated framework built on select. > > It's built so that it works with Ruby, allowing Ruby threads to run. However, the statements you made, and other make about EM are that it somehow sidesteps this. That's a lie, and one more reason not to use the project. If the statements were more honest like, "it layers an epoll system on top of ruby's select so not super fast as epol, but getting better" then it might be excusable. However, instead it's hyperbole about using epoll, and it's been this way forever. The project has claimed Ruby licensed for years and didn't change the license statements in source until I mentioned it. You even missed that, which you constantly seem to do which is why I don't trust your statements about even basic assertions. > > Now I'm sure there's all sorts of great reasons this was done, and I'm > > sure it works, but works and clean/well-written are two totally > > different things. Put all the comments you want, if people go around > > saying that "it has epoll" and a quick look shows that even epoll uses > > select, then that's a lie. Having epoll support and *only* using epoll > > are very different. > > It coexists with rb_thread_select. That's the crucial missing part of > your analysis. > > EM is using epoll, but EM does its work by interleaving with Ruby's > select based thread management so that ruby threads outside of EM have > a chance to run, without deadlocks. And again Kirk, that's a lie. It does not "interleave with Ruby's select" which implies that the epoll descriptors are handled off to the side and are not impacted by Ruby's select or that Ruby's select isn't involved in the processing. If what you say is true, why is this code in em.cpp: // prepare the sockets for reading and writing size_t i; for (i = 0; i < Descriptors.size(); i++) { EventableDescriptor *ed = Descriptors[i]; assert (ed); int sd = ed->GetSocket(); assert (sd != INVALID_SOCKET); if (ed->SelectForRead()) FD_SET (sd, &fdreads); if (ed->SelectForWrite()) FD_SET (sd, &fdwrites); if (maxsocket < sd) maxsocket = sd; } THAT is loading the file descriptors into a god damned read/write set so they can be processed by Ruby. THAT means that Ruby's select is still processing them. THAT means you are still limited by Ruby's IO, GC, and thread limitations. Now Kirk, how is it that you missed this? I know you're not the kind of guy to just bold-faced lie about something, so is it that you're having a hard time reading the C++ code? Obviously all that code is a problem then. > > I will say it has improved vastly in code quality since the 0.8.x > > days. I think if there was some more honest effort in making people > > like me happy it'd be worth using. > > And *I* am happy to put time towards addressing real issues. I'm guessing you mean nothing I've brought up with the 10-20 minutes of effort nobody else seems to want to exert on the project before using it. > > I use it, and flag any place I *must* use those functions. Let's take > > a look at the .cpp: > > > > binder.cpp: static int index = 0; > > binder.cpp: if ((index >= 1000000) || (seed.length() == 0)) { > > binder.cpp: sprintf (u2 + (i * 2), "%02x", u1[i]); > > binder.cpp: index = 0; > > binder.cpp: ss << seed << (++index); > > em.cpp: snprintf (buf, sizeof(buf)-1, "unable to create > > epoll descriptor: %s", strerror(errno)); > > em.cpp: snprintf (buf, sizeof(buf)-1, > > "unable to delete epoll event: %s", strerror(errno)); > > em.cpp: snprintf (buf, sizeof(buf)-1, "unable to modify > > epoll event: %s", strerror(errno)); em.cpp: strcpy (pun.sun_path, > > server); em.cpp: snprintf (buf, sizeof(buf)-1, > > "unable to add new descriptor: %s", strerror(errno)); em.cpp: strncpy > > (s_sun.sun_path, filename, sizeof(s_sun.sun_path)-1); > > rubymain.cpp: snprintf (buf, sizeof(buf)-1, "no popen: %s", > > (err?err:"???")); rubymain.cpp: snprintf (buf, sizeof(buf)-1, > > ": %s %s", StringValuePtr(filename),(err?err:"???")); ssl.cpp: > > strcpy (buf, "kittycat"); > > Yep. Some of those things probably deserve attention and maybe > changes. I'm making a note of them. What the fuck, so you tell me that I'm vitriolic. I show that a SINGLE DAMN GREP finds massive security holes like loading a buffer in a loop via sprintf (binder.cpp) or the use of a clear text password in the source as the basis of my assertion. You don't say, "Damn Zed, you were right, that does suck." You say, "Taking note, thanks man." I'm guessing there's no way you'd ever admit that EM isn't that good, just what's available, so I'll just leave this email as my last statement on it until you start pimping it again. > > Nice, much better than when I first looked at the code, but still quite > > a few potential attack vectors. But wait a minute, what's this > > "kittycat" in ssl.cpp? > > The first pass of the SSL support used hardcoded privkey and creds. > Those are still there, but anyone with any sense uses set_tls_params() > to provide their own privkey and cert. Riiiight, that's never been an issue. People *never* accidentally use defaults for stuff. Totally secure. > > Finally, let's take a look at code size. A simple wc -l on > > the .cpp, .h, and .rb files shows the raw lines at around 9819 lines > > including comments and the very limited amount of whitespace used in > > the project (just hit the enter key once in a while ok?). Not too bad > > for a simple event loop project. > > ??? 2388 lines in the C++ and Ruby code files are blank lines. And a > huge number of the remaining lines are comments. Most of the code is > very comment heavy. It's still an event loop system that's larger than most of the ones written in pure C. Hell, libev is damn sexy and has even more features and is faster than anything cooked up in this mess, and it's only 5242 lines of *well commented* C code. > > TWO GARBAGE CATS? > > 1) Do you honestly think that nobody has ever noticed this before? And this is what makes me cry: people don't notice it. They just go about their business missing that point, which leads to... > 2) Who cares? If the code works; if the license terms are acceptable; > if my patches are accepted and the reasonable changes that I need in > the codebase happen, then I don't really give a rat's ass about the > "Francis Girardeau" name that is on the rubyforge project. It doesn't > appear anywhere in the source, nor the licensing, nor the copyright > notices. It's a curiosity, at most. Not in my book. That's a sign of stupidity at the least and con-artistry at the most. Either way its explained it points to something weird about the individual that I'd rather avoid. My experiences has also showed being cautious when it comes to who's software you inject into your own is the best thing to do. Anything else is just bad business. Now, you and anyone else can keep on using the damn thing--I care less--but when you keep mentioning it for Mongrel it kind of pisses me off. Do what you want outside Mongrel, but all of the above reasons (and then some) make me not want to have it within 10 feet of the Mongrel project. So Please Kirk, quit mentioning it, quit mentioning that it is "faster than Ruby's select" which is a lie, and quit saying that my objections to it are based on anything other than the facts I find right in the source or online. It's not vitriol or opinion, it's based on a review of the source that you obviously aren't doing. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From filipe at icewall.org Tue Dec 18 07:42:24 2007 From: filipe at icewall.org (Filipe) Date: Tue, 18 Dec 2007 10:42:24 -0200 (BRST) Subject: [Mongrel-development] First Shoot, many more to appear: Rails on Ruby 1.9 In-Reply-To: <71166b3b0712172344l390ff828wcbb8ace7a0f4c118@mail.gmail.com> References: <71166b3b0712172344l390ff828wcbb8ace7a0f4c118@mail.gmail.com> Message-ID: Hello, how about our good and unstable trunk? renmazuo:/tmp/rails_trunk/rails_ruby19_app# ./script/server => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Tue, 18 Dec 2007 12:30:35 GMT | info | Starting Mongrel listening at 0.0.0.0:3000, further information can be found in log/mongrel-0.0.0.0-3000.log /tmp/rails_trunk/rails_ruby19_app/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:8: warning: undefining `object_id' may cause serious problem Tad?, and mongrel is running and serving requests with ruby1.9 and rails 2.0.2 trunk :) Only change I made was to swap File.exists? (that is deprecated) by File.exist? at lib/mongrel/logger.rb and compile mongrel through setup.rb only. As I already commited this change to svn right now, the ones who update it may have a clean 1.9 run. So, now that rails run on top of it, i'll start to test test test test test test and test. If we drop support requirement for fastthread in mongrel 1.2, mongrel will be 1.9 compatible out-of-the-box. Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } On Tue, 18 Dec 2007, Luis Lavena wrote: > Guys, > > Subject says everything: > > http://www.frederico-araujo.com/2007/12/18/my-first-successful-booting-rails-2-0-2-ruby-1-9-attempt > > Even ActionView uses Proc.binding (which isn't correctly supported in > 1.9) it appears that lot of folks will try to put their hands in Ruby > 1.9 when it comes out, and of course, try to get Rails with Mongrel > running in it. > > Zed, Wayne, Evan and ry: maybe we need an official statement about it? > (put in the web site?) > > I know Evan did a blog post about it, but still, we need to work on > something that: > > Warn the user on running mongrel with 1.9 (until we got it working). > Limit the gem to work only with 1.8 line (instead of >= 1.8.4) > #=> '>= 1.8.4', '< 1.9.0' > or > #=> '~> 1.8.4' > ? > > Do a RUBY_VERSION check in the code and warn the user about it. > > Thoughts? > > -- > Luis Lavena > Multimedia systems > - > A common mistake that people make when trying to design > something completely foolproof is to underestimate > the ingenuity of complete fools. > Douglas Adams > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > From luislavena at gmail.com Tue Dec 18 09:24:16 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 18 Dec 2007 11:24:16 -0300 Subject: [Mongrel-development] First Shoot, many more to appear: Rails on Ruby 1.9 In-Reply-To: References: <71166b3b0712172344l390ff828wcbb8ace7a0f4c118@mail.gmail.com> Message-ID: <71166b3b0712180624p3a6e8025mc0cf0b50e291b32e@mail.gmail.com> On Dec 18, 2007 9:42 AM, Filipe wrote: > > Hello, > > how about our good and unstable trunk? > > renmazuo:/tmp/rails_trunk/rails_ruby19_app# ./script/server > => Booting Mongrel (use 'script/server webrick' to force WEBrick) > => Rails application starting on http://0.0.0.0:3000 > => Call with -d to detach > => Ctrl-C to shutdown server > Tue, 18 Dec 2007 12:30:35 GMT | info | Starting Mongrel listening at 0.0.0.0:3000, further information can be found in log/mongrel-0.0.0.0-3000.log > /tmp/rails_trunk/rails_ruby19_app/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:8: warning: undefining `object_id' may cause serious problem > > Tad?, and mongrel is running and serving requests with ruby1.9 and rails 2.0.2 trunk :) > Yeah, running doesn't mean it will work as good as 1.8. There are still issues we need to address like Threading, naive example: Taking 2 pasties from 2006 about mutex/sync issues (mostly what mongrel currently does to gard from Rails): http://pastie.caboo.se/10194 http://pastie.caboo.se/10317 1.8.6: they work. 1.9.0: they fail: pastie-10194.rb:34:in `initialize': can't create Thread (0) (ThreadError) from pastie-10194.rb:34:in `new' from pastie-10194.rb:34:in `block in run' from pastie-10194.rb:30:in `loop' from pastie-10194.rb:30:in `run' from pastie-10194.rb:52:in `
' > Only change I made was to swap File.exists? (that is deprecated) by File.exist? at lib/mongrel/logger.rb and compile mongrel through setup.rb only. As I already commited this change to svn right now, the ones who update it may have a clean 1.9 run. > > So, now that rails run on top of it, i'll start to test test test test test test and test. > I think I described the situation: more users will start firing huge projects into 1.9 and mostly they will blame Mongrel for all of them (as usual, if not, check mongrel-users list). > If we drop support requirement for fastthread in mongrel 1.2, mongrel will be 1.9 compatible out-of-the-box. > Is not that simple, but anyway... be my guess, try it ourself and shoot you in your foot :-P -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Tue Dec 18 11:20:43 2007 From: filipe at icewall.org (Filipe Lautert) Date: Tue, 18 Dec 2007 14:20:43 -0200 Subject: [Mongrel-development] First Shoot, many more to appear: Rails on Ruby 1.9 In-Reply-To: <71166b3b0712180624p3a6e8025mc0cf0b50e291b32e@mail.gmail.com> References: <71166b3b0712172344l390ff828wcbb8ace7a0f4c118@mail.gmail.com> <71166b3b0712180624p3a6e8025mc0cf0b50e291b32e@mail.gmail.com> Message-ID: <1197994843.7533.6.camel@renmazuo> On Ter, 2007-12-18 at 11:24 -0300, Luis Lavena wrote: > On Dec 18, 2007 9:42 AM, Filipe wrote: > > ... > > Tad?, and mongrel is running and serving requests with ruby1.9 and rails 2.0.2 trunk :) > > > > Yeah, running doesn't mean it will work as good as 1.8. For sure :) What I want at first is to make mongrel ruby1.9 compatible. If we can make it build and at least start, so wee can get more people to test it. You know, we can do a lot of tests but we will never fire all the bugs that are hidden.. so we can release early and got help from users. What we can do is advise users that mongrel + ruby1.9 is a dangerous combination, and that compatible != stable. Cheers, filipe From wyhaines at gmail.com Tue Dec 18 12:27:32 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Tue, 18 Dec 2007 10:27:32 -0700 Subject: [Mongrel-development] The case against EM (for now) (was: Some silly benchs) In-Reply-To: References: <71166b3b0712141143k44808f7am357c0c2573c23565@mail.gmail.com> <20071214203732.c1a9e576.zedshaw@zedshaw.com> <20071216114550.3db98415.zedshaw@zedshaw.com> <20071216160852.a49e2ebf.zedshaw@zedshaw.com> <20071218054652.dcc3a595.zedshaw@zedshaw.com> Message-ID: On Dec 18, 2007 3:46 AM, Zed A. Shaw wrote: > On Sun, 16 Dec 2007 17:00:38 -0700 > "Kirk Haines" wrote: > > > In order for EM to do what couldn't be done with Ruby/Event, it has to > > coexist with the Ruby threads. > > EmSelect is ruby_thread_select. > > And that means it's *still* using select. You haven't disproven this, > and it's a shitty design. LOL. No, that means that it is written so that it works with Ruby's design, to permit Ruby's threads to run without deadlocking. Specifically, EM's epoll loop processes epoll events, and then it runs rb_thread_select with no descriptors in order to give Ruby's threads a chance to run. It's a good design for the requirements, which involve being about to work with Ruby's threading mechanism. > However, the statements you made, and other make about EM are that it > somehow sidesteps this. That's a lie, and one more reason not to use > the project. If the statements were more honest like, "it layers an > epoll system on top of ruby's select so not super fast as epol, but > getting better" then it might be excusable. However, instead it's > hyperbole about using epoll, and it's been this way forever. *I* have tested my apps with up to 20000 open, active simultaneous connections on Linux platforms. You're calling me a liar. Don't do that. As for your other assertion, EM supports Ruby thread interoperability because it has to. It's as simple as that. Your own experience with Ruby/Event's failure demonstrates why it has to. > The project has claimed Ruby licensed for years and didn't change the > license statements in source until I mentioned it. You even missed > that, which you constantly seem to do which is why I don't trust your > statements about even basic assertions. Again, you go on with the unsupported statements that I missed things. I didn't. EventMachine has existed as a project since April of 2006 (i.e. less than 2 years), and it has always been dual licensed. In August of 2006 you pointed out some incorrect source file headings, and they were fixed. > > It coexists with rb_thread_select. That's the crucial missing part of > > your analysis. > > > > EM is using epoll, but EM does its work by interleaving with Ruby's > > select based thread management so that ruby threads outside of EM have > > a chance to run, without deadlocks. > > And again Kirk, that's a lie. It does not "interleave with > Ruby's select" which implies that the epoll descriptors are handled off > to the side and are not impacted by Ruby's select or that Ruby's > select isn't involved in the processing. If what you say is true, why is > this code in em.cpp: > > // prepare the sockets for reading and writing > size_t i; > for (i = 0; i < Descriptors.size(); i++) { > EventableDescriptor *ed = Descriptors[i]; > assert (ed); > int sd = ed->GetSocket(); > assert (sd != INVALID_SOCKET); > > if (ed->SelectForRead()) > FD_SET (sd, &fdreads); > if (ed->SelectForWrite()) > FD_SET (sd, &fdwrites); > > if (maxsocket < sd) > maxsocket = sd; > } > > THAT is loading the file descriptors into a god damned read/write set > so they can be processed by Ruby. THAT means that Ruby's select > is still processing them. THAT means you are still limited by > Ruby's IO, GC, and thread limitations. > > Now Kirk, how is it that you missed this? I know you're not the kind > of guy to just bold-faced lie about something, so is it that you're > having a hard time reading the C++ code? Obviously all that code is a > problem then. I didn't miss anythiing, here, Zed, nor did I lie. Don't misunderstand me, here. Desist from that libelous assertion. I don't appreciate your defamation. /************************ EventMachine_t::_RunOnce ************************/ bool EventMachine_t::_RunOnce() { if (bEpoll) return _RunEpollOnce(); else return _RunSelectOnce(); } This dispatches to the appropriate handler depending on whether epoll is being used or not. The code that you quoted is from _RunSelectOnce(). As you can see above, that code is used only if one is using select. If one is using epoll, _RunEpollOnce() is called; select() isn't used. Your assertion is incorrect. And again, to be quite clear, quit calling me a liar. I did not misunderstand the code. You very clearly did. And *I* have not intentionally misrepresented anything. > > And *I* am happy to put time towards addressing real issues. > > I'm guessing you mean nothing I've brought up with the 10-20 minutes of > effort nobody else seems to want to exert on the project before using > it. No. It means that I am right here, listening to you, and am happy to look at the issues and see if any of them are real problems. That is, I will look at them and analyze them instead of just taking your word of authority on the matter. If my analysis agrees with yours, then I will fix them. > What the fuck, so you tell me that I'm vitriolic. I show that a SINGLE > DAMN GREP finds massive security holes like loading a buffer in a loop > via sprintf (binder.cpp) or the use of a clear text password in the > source as the basis of my assertion. You don't say, "Damn Zed, you were > right, that does suck." You say, "Taking note, thanks man." No, you showed that a single grep finds a number of things without context. One of the things that grep looks for is the use of a variable named 'index'. That's hardly a security hole. None of those lines would have showed up in the magic grep had a different variable name been used in that place. So what I am saying is that those lines deserve to be examined in context, and the use of the dangerous str* functions needs to be looked at closely, because, as you said, there usually are safer functions to use. I'm saying that there could well be room for improvement there. What I am not doing is getting aggitated, or excited, or fearful, or antagonistic. In that place you pointed out some things that need to be looked at more closely, and I will be doing so. Speaking of looking closely at things, regarding the sprintf usage in binder (which comprised a large number of the lines that your grep found): That's not a security violation. The value is being copied to an automatic array with a carefully-computed size, and the data is not coming from user input but is generated internally. > I'm guessing there's no way you'd ever admit that EM isn't that good, > just what's available, so I'll just leave this email as my last > statement on it until you start pimping it again. I haven't pimped it for Mongrel. I've _never_ said that it should be used in Mongrel core. I've resisted that notion, in fact. I just resist your defamation of EM, and of me, for using it. I would like an easier, cleaner way for things to swap out the core request handling pieces of Mongrel, but if Mongrel were mine, I'd work very hard to make sure the _core_ of Mongrel is as simple, and as base-ruby as possible. For 1.9, that means one of two things, I think. Whether this is fibers, a thread pool that plucks things off the accept queue, or some combination of the two, I don't know. On Linux and Windows, system threads per request are going to be slow. On Solaris, though, it stands a real chance of performing all right because Solaris threads are very lightweight. And since, as you have often pointed out, Mongrel is a library, and a LOT of people use it in a lot of different ways, were it mine, I'd be embracing that fact and making sure that it continues to be a flexible platform that people can adopt to their own needs. > > > Nice, much better than when I first looked at the code, but still quite > > > a few potential attack vectors. But wait a minute, what's this > > > "kittycat" in ssl.cpp? > > > > The first pass of the SSL support used hardcoded privkey and creds. > > Those are still there, but anyone with any sense uses set_tls_params() > > to provide their own privkey and cert. > > Riiiight, that's never been an issue. People *never* accidentally use > defaults for stuff. Totally secure. "kittycat" is dead code. It's a placeholder for an encryption key in case users want to add one themselves. It was originally there for decrypting the default private key. Since the private key right there in open source code for all to see, there's no point in encrypting it. Anyone who understands how X509 works would not use the default credential for authentication, but only for encryption. So in the end it comes down to doing a little RTFM and knowing what you are doing. The user can make the choices and is responsible for the outcome of those choices. > Now, you and anyone else can keep on using the damn thing--I care > less--but when you keep mentioning it for Mongrel it kind of pisses me > off. Do what you want outside Mongrel, but all of the above reasons > (and then some) make me not want to have it within 10 feet of the > Mongrel project. As I mentioned above, I have never advocated using it for Mongrel itself. I have said as much to Evan, Wayne, Luis, and Fillipe during IRC conversations. I have only advocated for EM itself in this forum because you persist with the shouting, name calling, and inaccuracies in your statements. > So Please Kirk, quit mentioning it, quit mentioning that it is "faster > than Ruby's select" which is a lie, and quit saying that my objections > to it are based on anything other than the facts I find right in the > source or online. It's not vitriol or opinion, it's based on a review > of the source that you obviously aren't doing. /************************ EventMachine_t::_RunOnce ************************/ bool EventMachine_t::_RunOnce() { if (bEpoll) return _RunEpollOnce(); else return _RunSelectOnce(); } Kirk Haines From luislavena at gmail.com Tue Dec 25 17:58:15 2007 From: luislavena at gmail.com (Luis Lavena) Date: Tue, 25 Dec 2007 19:58:15 -0300 Subject: [Mongrel-development] Review of Code for 1.9 Message-ID: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> Hello Guys, I'm reviewing the code for 1.9, and forgot about this when we first spoke on this subject. The current way we stop threads is using Thread#raise to spread StopServer exception, which will not work as expected in 1.9. 1.9 will treat raised exceptions as #kill, like JRuby does, so the worker threads will not finish serving the client and _then_ exiting, but will be kill'ed in the middle of the request. (at the bottom of mongrel.rb): http://mongrel.rubyforge.org/svn/trunk/lib/mongrel.rb According to some docs of Jruby and YARV, we should rely on 'thread safety' of these methods (including #critical and #kill). Thoughts? btw, merry christmas to everybody! :-D -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Tue Dec 25 19:05:46 2007 From: filipe at icewall.org (Filipe) Date: Tue, 25 Dec 2007 22:05:46 -0200 (BRST) Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> Message-ID: On Tue, 25 Dec 2007, Luis Lavena wrote: > Hello Guys, > > I'm reviewing the code for 1.9, and forgot about this when we first > spoke on this subject. > > The current way we stop threads is using Thread#raise to spread > StopServer exception, which will not work as expected in 1.9. > > 1.9 will treat raised exceptions as #kill, like JRuby does, so the > worker threads will not finish serving the client and _then_ exiting, > but will be kill'ed in the middle of the request. > > (at the bottom of mongrel.rb): > http://mongrel.rubyforge.org/svn/trunk/lib/mongrel.rb > > According to some docs of Jruby and YARV, we should rely on 'thread > safety' of these methods (including #critical and #kill). Hum.. could you point where are those docs? Easier ask than search, as you already know them.... Anyway, we can still raising an Exception to it, just to stop the accept thing. But then we can call graceful_shutdown method within stop, and not within the @acceptor thread. Something like this: --- lib/mongrel.rb (revision 919) +++ lib/mongrel.rb (working copy) @@ -307,9 +307,6 @@ Mongrel.log(:error, e.backtrace.join("\n")) end end - graceful_shutdown - ensure - @socket.close # Mongrel.log(:error, "#{Time.now.httpdate}: Closed socket.") end end @@ -349,6 +346,9 @@ if synchronous sleep(0.5) while @acceptor.alive? end + + graceful_shutdown + @socket.close end end How about it? > > btw, merry christmas to everybody! :-D For you too! Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } From luislavena at gmail.com Wed Dec 26 01:46:28 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 26 Dec 2007 03:46:28 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> Message-ID: <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> On Dec 25, 2007 9:05 PM, Filipe wrote: [...] > > > > According to some docs of Jruby and YARV, we should rely on 'thread > > safety' of these methods (including #critical and #kill). > > Hum.. could you point where are those docs? Easier ask than search, as > you already know them.... > infoQ: http://www.infoq.com/news/2007/05/ruby-threading-futures Sasada Koichi post at ruby-core: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/10252 Headius, first quarter of 2007: http://headius.blogspot.com/2007_04_25_archive.html > Anyway, we can still raising an Exception to it, just to stop the accept thing. > But then we can call graceful_shutdown method within stop, and not within the @acceptor > thread. Something like this: > The problem is that raising a exception to another thread (Thread#raise) will not work as expected in different interpreters, but maybe I'm reading the docs wrong. > --- lib/mongrel.rb (revision 919) > +++ lib/mongrel.rb (working copy) > @@ -307,9 +307,6 @@ > Mongrel.log(:error, e.backtrace.join("\n")) > end > end > - graceful_shutdown > - ensure > - @socket.close > # Mongrel.log(:error, "#{Time.now.httpdate}: Closed socket.") > end > end > @@ -349,6 +346,9 @@ > if synchronous > sleep(0.5) while @acceptor.alive? > end > + > + graceful_shutdown > + @socket.close > end > > end > Mmm, need to check, no time right now. I'm bootstrapping ruby 1.9 completely from scratch for mingw (part of the new One-Click Ruby Installer). -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Wed Dec 26 02:26:19 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 26 Dec 2007 02:26:19 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> Message-ID: <20071226022619.f1ab4608.zedshaw@zedshaw.com> On Tue, 25 Dec 2007 19:58:15 -0300 "Luis Lavena" wrote: > Hello Guys, > > I'm reviewing the code for 1.9, and forgot about this when we first > spoke on this subject. Don't forget to check out Rev while you're at it: http://rev.rubyforge.org/ :-) -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From luislavena at gmail.com Wed Dec 26 02:31:24 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 26 Dec 2007 04:31:24 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <20071226022619.f1ab4608.zedshaw@zedshaw.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <20071226022619.f1ab4608.zedshaw@zedshaw.com> Message-ID: <71166b3b0712252331w2d396d3awcc44dd5b49d8148a@mail.gmail.com> On Dec 26, 2007 4:26 AM, Zed A. Shaw wrote: > On Tue, 25 Dec 2007 19:58:15 -0300 > "Luis Lavena" wrote: > > > Hello Guys, > > > > I'm reviewing the code for 1.9, and forgot about this when we first > > spoke on this subject. > > Don't forget to check out Rev while you're at it: > > http://rev.rubyforge.org/ > > :-) Didn't forgot it, but: "This includes the epoll system call for Linux, the kqueue system call for BSDs and OS X, and the completion ports interface for Solaris." No mention of Windows support or test, even that libev code works with fd and sockets on win32. I'll check that later, now I need to solve some segfaults in readline extension (for ruby 1.9 mingw32 build). Later guys, -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wayneeseguin at gmail.com Wed Dec 26 09:33:25 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 26 Dec 2007 09:33:25 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> Message-ID: On Dec 25, 2007 5:58 PM, Luis Lavena wrote: > Hello Guys, > > I'm reviewing the code for 1.9, and forgot about this when we first > spoke on this subject. > > The current way we stop threads is using Thread#raise to spread > StopServer exception, which will not work as expected in 1.9. > > 1.9 will treat raised exceptions as #kill, like JRuby does, so the > worker threads will not finish serving the client and _then_ exiting, > but will be kill'ed in the middle of the request. > > (at the bottom of mongrel.rb): > http://mongrel.rubyforge.org/svn/trunk/lib/mongrel.rb > > According to some docs of Jruby and YARV, we should rely on 'thread > safety' of these methods (including #critical and #kill). > > Thoughts? > > btw, merry Christmas to everybody! :-D > -- > Luis Lavena > Multimedia systems Merry Christmas and happy holidays all!!! Perhaps we should implement a check when Mongrel is loaded which sets a variable based on platform / ruby version for which Thread method to call for stop server handling. Then at the point where we stop threads we can .send() the method stored in the variable. ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071226/e8669223/attachment-0001.html From luislavena at gmail.com Wed Dec 26 09:38:45 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 26 Dec 2007 11:38:45 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> Message-ID: <71166b3b0712260638n6afc9899q444375674236e282@mail.gmail.com> On Dec 26, 2007 11:33 AM, Wayne E. Seguin wrote: [...] > > Merry Christmas and happy holidays all!!! > > Perhaps we should implement a check when Mongrel is loaded which sets a > variable based on platform / ruby version for which Thread method to call > for stop server handling. Then at the point where we stop threads we can > .send() the method stored in the variable. > I'll suggest that for the time being, we set required ruby version <= 1.8.6 and do some release. *everybody* is playing with 1.9 and they think is stable, they don't read the "development release" sticker matz put on it... Argh... I'm getting angry :-P -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From zedshaw at zedshaw.com Wed Dec 26 14:01:07 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Wed, 26 Dec 2007 14:01:07 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712252331w2d396d3awcc44dd5b49d8148a@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <20071226022619.f1ab4608.zedshaw@zedshaw.com> <71166b3b0712252331w2d396d3awcc44dd5b49d8148a@mail.gmail.com> Message-ID: <20071226140107.0d9aa01a.zedshaw@zedshaw.com> On Wed, 26 Dec 2007 04:31:24 -0300 "Luis Lavena" wrote: > > > > Don't forget to check out Rev while you're at it: > > > > http://rev.rubyforge.org/ > > > > :-) > > Didn't forgot it, but: > > No mention of Windows support or test, even that libev code works with > fd and sockets on win32. That's 'cause windows sucks. :-) Actually, Tony and I mostly just do unix so we haven't been motivated to work on it. Thus the reason I said you should check it out since it might help you on Windows. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From luislavena at gmail.com Wed Dec 26 13:58:54 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 26 Dec 2007 15:58:54 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <20071226140107.0d9aa01a.zedshaw@zedshaw.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <20071226022619.f1ab4608.zedshaw@zedshaw.com> <71166b3b0712252331w2d396d3awcc44dd5b49d8148a@mail.gmail.com> <20071226140107.0d9aa01a.zedshaw@zedshaw.com> Message-ID: <71166b3b0712261058q51e3f073md5884b46b3ecee2a@mail.gmail.com> On Dec 26, 2007 4:01 PM, Zed A. Shaw wrote: [...] > > That's 'cause windows sucks. :-) > Yeah, totally agree, but since I earn money from it... shouldn't complain too much, isn't? > Actually, Tony and I mostly just do unix so we haven't been motivated > to work on it. Thus the reason I said you should check it out since it > might help you on Windows. > Will take a look, this weekend with more spare time :-D -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wayneeseguin at gmail.com Wed Dec 26 14:22:19 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Wed, 26 Dec 2007 14:22:19 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712260638n6afc9899q444375674236e282@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712260638n6afc9899q444375674236e282@mail.gmail.com> Message-ID: On Dec 26, 2007 9:38 AM, Luis Lavena wrote: > I'll suggest that for the time being, we set required ruby version <= > 1.8.6 and do some release. > Agreed *everybody* is playing with 1.9 and they think is stable, they don't > read the "development release" sticker matz put on it... > Perhaps branch for 1.9? ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071226/59766a42/attachment.html From luislavena at gmail.com Wed Dec 26 14:26:21 2007 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 26 Dec 2007 16:26:21 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712260638n6afc9899q444375674236e282@mail.gmail.com> Message-ID: <71166b3b0712261126m255d8e3di3c10f729d588938c@mail.gmail.com> On Dec 26, 2007 4:22 PM, Wayne E. Seguin wrote: > On Dec 26, 2007 9:38 AM, Luis Lavena wrote: > > > I'll suggest that for the time being, we set required ruby version <= > > 1.8.6 and do some release. > > > > Agreed > The same was commented on ruby-core: define ruby version < 1.9 and > 1.8.2 (since there could exist a 1.8.7 release). > > *everybody* is playing with 1.9 and they think is stable, they don't > > read the "development release" sticker matz put on it... > > > > Perhaps branch for 1.9? > We should leave trunk for 1.8 and bugfixing and start playing with 1.9 in a branch. We already did a lot of changes in trunk that are not 'release quality' and some experimental stuff (that shouldn't be there, for the record). Don't have enough time to start playing with some ideas (not until weekend), but feel free to branch and play safe ;-) -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Wed Dec 26 22:28:07 2007 From: filipe at icewall.org (Filipe) Date: Thu, 27 Dec 2007 01:28:07 -0200 (BRST) Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712261126m255d8e3di3c10f729d588938c@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712260638n6afc9899q444375674236e282@mail.gmail.com> <71166b3b0712261126m255d8e3di3c10f729d588938c@mail.gmail.com> Message-ID: On Wed, 26 Dec 2007, Luis Lavena wrote: > On Dec 26, 2007 4:22 PM, Wayne E. Seguin wrote: >> On Dec 26, 2007 9:38 AM, Luis Lavena wrote: >> >>> I'll suggest that for the time being, we set required ruby version <= >>> 1.8.6 and do some release. >>> >> >> Agreed >> +1 > > The same was commented on ruby-core: > > define ruby version < 1.9 and > 1.8.2 (since there could exist a 1.8.7 release). > >>> *everybody* is playing with 1.9 and they think is stable, they don't >>> read the "development release" sticker matz put on it... >>> >> >> Perhaps branch for 1.9? >> > > We should leave trunk for 1.8 and bugfixing and start playing with 1.9 > in a branch. Hey guys, we already have a branch called stable_1-1 - evn used this to generate 1.1.2 . So this can be our stable thing and we can stay playing with trunk... > > We already did a lot of changes in trunk that are not 'release > quality' and some experimental stuff (that shouldn't be there, for the > record). Hum... not sure :) Well, we have the logger thing, but besides this I don't remember any other big change... > > Don't have enough time to start playing with some ideas (not until > weekend), but feel free to branch and play safe ;-) > Welcome back to the party! Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } From filipe at icewall.org Wed Dec 26 23:07:26 2007 From: filipe at icewall.org (Filipe) Date: Thu, 27 Dec 2007 02:07:26 -0200 (BRST) Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> Message-ID: On Wed, 26 Dec 2007, Luis Lavena wrote: > On Dec 25, 2007 9:05 PM, Filipe wrote: > [...] >>> >>> According to some docs of Jruby and YARV, we should rely on 'thread >>> safety' of these methods (including #critical and #kill). >> >> Hum.. could you point where are those docs? Easier ask than search, as >> you already know them.... >> > ... (links) Thanks for the links :) Well, one important note from ko1 in one of those links: (3') select() system call can be interrupted with pthread_kill(). But on cygwin system, pthread_kill() doesn't work well. oops. If we use the code that I sent, we may have problems wih cygwin. BUT: 1) (I hope that) no sane human will run a production server in cygwin 2) This problem would only happen in cygwin when stopping mongrel, so it's not really one of the biggest problems in the world. Also, besides using the code already sent, we could call accept_nonblock() and then get into a loop calling select in the socket for a limited time and then check a variable to exit. Something like this: serv = TCPServer.new('127.0.0.1', 3000) begin sock = serv.accept_nonblock rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR #executes select for 3 seconds before try our exit variable IO.select([serv], nil, nil, 3) return if die retry end This way we just set @acceptor.die = true, join it and wait. How about it? Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E Jabber lautert at jabber.ru } From luislavena at gmail.com Thu Dec 27 07:01:10 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 27 Dec 2007 09:01:10 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> Message-ID: <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> On Dec 27, 2007 1:07 AM, Filipe wrote: [...] > > Thanks for the links :) > > Well, one important note from ko1 in one of those links: > > (3') select() system call can be interrupted with pthread_kill(). But > on cygwin system, pthread_kill() doesn't work well. oops. > > If we use the code that I sent, we may have problems wih cygwin. BUT: > 1) (I hope that) no sane human will run a production server in cygwin > 2) This problem would only happen in cygwin when stopping mongrel, so it's not > really one of the biggest problems in the world. > Yeah, cygwin is not a good alternative, even that some editors (like E) encourage users to use a cygwin environment to "mimic" linux. I give support for mongrel on "mswin32" platform, not cygwin (hey, I even plan to support mingw when get it working right). > Also, besides using the code already sent, we could call accept_nonblock() > and then get into a loop calling select in the socket for a limited time and then > check a variable to exit. Something like this: > > serv = TCPServer.new('127.0.0.1', 3000) > begin > sock = serv.accept_nonblock > rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR > #executes select for 3 seconds before try our exit variable > IO.select([serv], nil, nil, 3) > return if die > retry > end > > This way we just set @acceptor.die = true, join it and wait. How about it? > That could work, but we will still be attached/limited/sticked/busted to Threads. one developer started a thread at ruby-core listing the 'evented' frameworks available, how bad they behave and listing part of the problems they currently present. Also, describe that something could be done in the Fibers arena to workaround this, thus removing the need for external C code: http://groups.google.com/group/ruby-core-google/browse_thread/thread/fbf8bae96b00d1f5 [ruby-core:14497] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/14497 But still, don't have free time to look deep into this (damn work, I hate it, need to code some usb driver for windows by tonight). For the time being, I suggest we take stable 1.1 and: force required_ruby_version '<1.9.0' release a new gems for it (I'll do the same for the pre-build binary). Volunteers? :-D I'm working on getting mongrel_service fixed (removing win32-service dependency since latest version broke API and affect GemPlugin namespace) I'll add the same forced ruby_version to it. I don't ask for volunteers here, but if someone can, it's really welcome :-D Regards, -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From filipe at icewall.org Thu Dec 27 07:45:24 2007 From: filipe at icewall.org (Filipe Lautert) Date: Thu, 27 Dec 2007 10:45:24 -0200 (BRST) Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> Message-ID: On Thu, 27 Dec 2007, Luis Lavena wrote: > On Dec 27, 2007 1:07 AM, Filipe wrote: > [...] >> >> bla bla bla > > Yeah, cygwin is not a good alternative, even that some editors (like > E) encourage users to use a cygwin environment to "mimic" linux. > > I give support for mongrel on "mswin32" platform, not cygwin (hey, I > even plan to support mingw when get it working right). I installed a cygwin... gonna try to build ruby1.9 + mongrel on it today. But this thing is damn slow... say, vmware player running debian runs ruby1.9's ./configure a lot faster than cygwin. > >> Also, besides using the code already sent, we could call accept_nonblock() >> and then get into a loop calling select in the socket for a limited time and then >> check a variable to exit. Something like this: >> >> serv = TCPServer.new('127.0.0.1', 3000) >> begin >> sock = serv.accept_nonblock >> rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR >> #executes select for 3 seconds before try our exit variable >> IO.select([serv], nil, nil, 3) >> return if die >> retry >> end >> >> This way we just set @acceptor.die = true, join it and wait. How about it? >> > > That could work, but we will still be attached/limited/sticked/busted > to Threads. Yeah.. and it also uses select... just noticed that after I sent. Maybe the best aproach is really drop it all and rewrite this from scratch using events. Now.. which lib to use? The is event machine, zed's rev, ezmorbius' packet... lot of options. I think here wyhaines could give us a big hand! > > one developer started a thread at ruby-core listing the 'evented' > frameworks available, how bad they behave and listing part of the > problems they currently present. > > Also, describe that something could be done in the Fibers arena to > workaround this, thus removing the need for external C code: Yeap I'm following this... hope this discussion goes a long way to help us decide :) > > But still, don't have free time to look deep into this (damn work, I > hate it, need to code some usb driver for windows by tonight). :( Good luck... > > For the time being, I suggest we take stable 1.1 and: > > force required_ruby_version '<1.9.0' > release a new gems for it (I'll do the same for the pre-build binary). > > Volunteers? :-D Hey, evn is our release guy ;) > > I'm working on getting mongrel_service fixed (removing win32-service > dependency since latest version broke API and affect GemPlugin > namespace) > I'll add the same forced ruby_version to it. > > I don't ask for volunteers here, but if someone can, it's really welcome :-D Thanks for not asking... Cheers, filipe From wyhaines at gmail.com Thu Dec 27 11:47:36 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 27 Dec 2007 09:47:36 -0700 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> Message-ID: On Dec 27, 2007 5:45 AM, Filipe Lautert wrote: > Maybe the best aproach is really drop it all and rewrite this from > scratch using events. Now.. which lib to use? The is event machine, > zed's rev, ezmorbius' packet... lot of options. > > I think here wyhaines could give us a big hand! We're in a situation where having a single version that is compatible with 1.8.x and 1.9.x means suboptimal performance on 1.9.x. So.... The choices: 1) Rewrite the network core to make use of a thread pool, and keep Mongrel, natively, as a threaded app based on core ruby facilities. 2) Rewrite the network core in an evented style of some sort. 2a) Use pure Ruby, maybe with something like hemant's packet.rb. Performance on this is not bad, but it retains the select() limitations. On the other hand, being pure ruby it'll run anywhere without any problems, including windows machines and machines that lack compilers, and will ease the packaging chores. I don't know how well packet works on jruby, but it may also ease the chore of maintaining Mongrel on that platform if it works adequately there, too. 2b) Use an event framework with an extension at its core. The main options here are really Tony Aceri's Rev, which is a brand new release, written specifically for Ruby 1.9, that uses libev under the covers, or EM. EM itself needs work before it's really 1.9 ready, though, because it's current design is optimized for best performance with 1.8 thread semantics.... Tony and I have had a couple conversations recently about the possibility of using Rev as the reactor in the pure ruby version of EM, too. The drawbacks to Rev are that is currently doesn't work on Windows, it is _very_ new, and libev, while based on libevent, is itself pretty new. I think there are a few things that are important for Mongrel. Two things, really. 1) It should run just about everywhere that Ruby does, including Windows machines. 2) It should perform pretty well everywhere that it runs. 3) It needs to remain stable. A lot of people depend on Mongrel, so we need to be conservative about changes, and do a lot of due diligence work before making any radical changes to the core. I don't think it has to run faster than anything else out there. It doesn't right now. ServerSide, for example, is a lot faster, but people host their stuff on Mongrel because Mongrel because of all of the other advantages Mongrel confers. To me, the immediate release goal should be to just repackage the current gem with a ruby version requirement on it < 1.9.0. Then, the next immediate goal should be to release a separate gem that simply works with 1.9.0. It's not a major set of changes. It doesn't matter that it doesn't work optimally so long as it does at least work. We can very, very clearly state that it's a _development_ release, and is not intended for production use. Then, third, we look at 1.9 specific changes/rewrites for performance. IMHO, we should lean towards a thread pool architecture, or a pure ruby event architecture for the base design (both of which should then work nearly unchanged on jruby, which would be good) unless developments procede in a way that lets us guarantee accessiblity of Mongrel on platforms like Windows with an event-extension based design. Kirk Haines From luislavena at gmail.com Thu Dec 27 12:30:07 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 27 Dec 2007 14:30:07 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> Message-ID: <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> On Dec 27, 2007 1:47 PM, Kirk Haines wrote: > On Dec 27, 2007 5:45 AM, Filipe Lautert wrote: > > Maybe the best aproach is really drop it all and rewrite this from > > scratch using events. Now.. which lib to use? The is event machine, > > zed's rev, ezmorbius' packet... lot of options. > > > > I think here wyhaines could give us a big hand! > > We're in a situation where having a single version that is compatible > with 1.8.x and 1.9.x means suboptimal performance on 1.9.x. > > So.... (my comments below) > The choices: > > 1) Rewrite the network core to make use of a thread pool, and keep > Mongrel, natively, as a threaded app based on core ruby facilities. +1 > 2) Rewrite the network core in an evented style of some sort. > 2a) Use pure Ruby, maybe with something like hemant's packet.rb. > Performance on this is not bad, but it retains the select() > limitations. On the other hand, being pure ruby it'll run anywhere > without any problems, including windows machines and machines that > lack compilers, and will ease the packaging chores. I don't know how > well packet works on jruby, but it may also ease the chore of > maintaining Mongrel on that platform if it works adequately there, > too. I want to remember you that our ragel parser still requires compilation, as far we ship pre-compiled gems, we will be good on that subject. > 2b) Use an event framework with an extension at its core. The main > options here are really Tony Aceri's Rev, which is a brand new > release, written specifically for Ruby 1.9, that uses libev under the > covers, or EM. EM itself needs work before it's really 1.9 ready, > though, because it's current design is optimized for best performance > with 1.8 thread semantics.... Tony and I have had a couple > conversations recently about the possibility of using Rev as the > reactor in the pure ruby version of EM, too. The drawbacks to Rev are > that is currently doesn't work on Windows, it is _very_ new, and > libev, while based on libevent, is itself pretty new. Evented models are too radical from what Mongrel is currently now. Jumping on *any* of these frameworks (no matter if its EM or Rev) will require us a lot of effort. by pure-ruby you mean plain ruby code? It seems Rev uses a extension, which require you compile and thus, depending on it will require us (I mean: me) shipping pre-compiled versions for Windows. > I think there are a few things that are important for Mongrel. Two > things, really. > > 1) It should run just about everywhere that Ruby does, including > Windows machines. +1, we have achieved that. > 2) It should perform pretty well everywhere that it runs. It currently does, even with slowest VC6 build on Windows, Mongrel feels snappy (Mongrel, not Rails). > 3) It needs to remain stable. A lot of people depend on Mongrel, so > we need to be conservative about changes, and do a lot of due > diligence work before making any radical changes to the core. > +100 on this, I'm against huge and compulsive changes to the 'core', and pointed that several times before. > I don't think it has to run faster than anything else out there. It > doesn't right now. ServerSide, for example, is a lot faster, but > people host their stuff on Mongrel because Mongrel because of all of > the other advantages Mongrel confers. > > To me, the immediate release goal should be to just repackage the > current gem with a ruby version requirement on it < 1.9.0. > 1.1.3? > Then, the next immediate goal should be to release a separate gem that > simply works with 1.9.0. It's not a major set of changes. > It doesn't matter that it doesn't work optimally so long as it does at > least work. We can very, very clearly state that it's a _development_ > release, and is not intended for production use. > We can put these gems in mongrel.rubyforge.org/releases, to avoid users downloading them by mistake during "gem update". I need to confirm that required_ruby_version (part of rubygems specifications) is working, will do it later today. If it work as we expect, will be no need for the special /release/ and we can use rubyforge instead. > Then, third, we look at 1.9 specific changes/rewrites for performance. > IMHO, we should lean towards a thread pool architecture, or a pure > ruby event architecture for the base design (both of which should then > work nearly unchanged on jruby, which would be good) unless > developments procede in a way that lets us guarantee accessiblity of > Mongrel on platforms like Windows with an event-extension based > design. As commented before, I'm interested in Rev (and libev). I wrote my own evented library for sockets in FB almost 2 years ago, and was a great experience. Looking at C code will be really nice (nice?) after so long (without counting ruby and mongrel C code, will be 5 years). By the way Rev is structured, I don't see will be major troubles adjusting/correcting it to work on windows, but the lack of extensive test suite (or specs) and the lack of benchmarks to compare with make me think twice before invest time on this. -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wyhaines at gmail.com Thu Dec 27 12:42:15 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 27 Dec 2007 10:42:15 -0700 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> Message-ID: On Dec 27, 2007 10:30 AM, Luis Lavena wrote: > I want to remember you that our ragel parser still requires > compilation, as far we ship pre-compiled gems, we will be good on that > subject. Right. There is a possibility that the pure ruby one might not suck on 1.9.x, but I'm not holding my breath. However, the ragel based extension is a bit different than using an extension based event framework that itself has to work on all of the platforms that we are targetting. > by pure-ruby you mean plain ruby code? It seems Rev uses a extension, > which require you compile and thus, depending on it will require us (I > mean: me) shipping pre-compiled versions for Windows. Packet is pure ruby. That's what I was referring to. There's a pure ruby EM, but for our purposes right now, I think packet is faster (though I have not done any benchmarks on the pure ruby stuff; that's just a hunch). Kirk From luislavena at gmail.com Thu Dec 27 12:54:06 2007 From: luislavena at gmail.com (Luis Lavena) Date: Thu, 27 Dec 2007 14:54:06 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> Message-ID: <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> On Dec 27, 2007 2:42 PM, Kirk Haines wrote: > On Dec 27, 2007 10:30 AM, Luis Lavena wrote: > > > I want to remember you that our ragel parser still requires > > compilation, as far we ship pre-compiled gems, we will be good on that > > subject. > > Right. There is a possibility that the pure ruby one might not suck > on 1.9.x, but I'm not holding my breath. However, the ragel based > extension is a bit different than using an extension based event > framework that itself has to work on all of the platforms that we are > targetting. Maybe it suck less, but as I pointed in previous emails on the list, on 1.9 there wasn't "overhead" on calling C functions or pure-ruby ones. > > by pure-ruby you mean plain ruby code? It seems Rev uses a extension, > > which require you compile and thus, depending on it will require us (I > > mean: me) shipping pre-compiled versions for Windows. > > Packet is pure ruby. That's what I was referring to. There's a pure > ruby EM, but for our purposes right now, I think packet is faster > (though I have not done any benchmarks on the pure ruby stuff; that's > just a hunch). Based on rumors (comments on ruby-core) it seems EM is not designed for 1.9 and do a intense use of rb_thread_schedule and rb_funcall -- maybe I should call it abuse ;-) Damn, I really hate we can do so many things to test and research but not enough time to actually do it! :-P -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wyhaines at gmail.com Thu Dec 27 13:09:54 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Thu, 27 Dec 2007 11:09:54 -0700 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> Message-ID: > Based on rumors (comments on ruby-core) it seems EM is not designed > for 1.9 and do a intense use of rb_thread_schedule and rb_funcall -- > maybe I should call it abuse ;-) Regarding 1.9, I mentioned that in my earlier email. It was designed to work optimally with the 1.8 threading model. What this involves is making calls to rb_thread_select at specific points in the event loop so that Ruby has a chance to do its thing. rb_funcall comes into play when events are being triggered. The architecture isn't really an abuse of rb_funcall. What happens is that there is an event_callback method that the extension calls. The event_callback method is in pure ruby, and it, in turn, dispatches the event callbacks that one wrote in one's protocol class. If Ruby's method dispatch were faster, it'd be a non-issue, and would constitute a nice, modular design. Because Ruby's method dispatch isn't fast, though, I have an optimization that I am waiting to commit that more than halves the amount of time taken to dispatch events. > Damn, I really hate we can do so many things to test and research but > not enough time to actually do it! :-P Yeah. I know. :( A person could _easily_ work full time on this sort of stuff, if there were money in it. Kirk From filipe at icewall.org Thu Dec 27 13:22:53 2007 From: filipe at icewall.org (Filipe Lautert) Date: Thu, 27 Dec 2007 16:22:53 -0200 (BRST) Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> Message-ID: On Thu, 27 Dec 2007, Kirk Haines wrote: > ... >> Damn, I really hate we can do so many things to test and research but >> not enough time to actually do it! :-P > > Yeah. I know. :( A person could _easily_ work full time on this > sort of stuff, if there were money in it. Yeap, sad. Someone from the team could have vacations to do it ;) Anyway, I really liked the idea of release 1.1.3 for ruby < 1.9.0, release a version that just works on ruby 1.9 and play new core things to a new major release (2.0?) . Also, we have some things that could be released in a 1.2 release, like logging facility. So, by the talks that I see for 1.9 support here in the list, it seems that we are really going to an event based/thread based approach, is it? And the preference is for a pure ruby approach. Got it? Cheers, Filipe From evan at cloudbur.st Thu Dec 27 15:14:57 2007 From: evan at cloudbur.st (Evan Weaver) Date: Thu, 27 Dec 2007 15:14:57 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> Message-ID: I'm gonna see if CNET can give me some official time for Mongrel work. Dunno if it will happen though. Evan On Dec 27, 2007 1:22 PM, Filipe Lautert wrote: > On Thu, 27 Dec 2007, Kirk Haines wrote: > > ... > >> Damn, I really hate we can do so many things to test and research but > >> not enough time to actually do it! :-P > > > > Yeah. I know. :( A person could _easily_ work full time on this > > sort of stuff, if there were money in it. > > Yeap, sad. Someone from the team could have vacations to do it ;) > > Anyway, I really liked the idea of release 1.1.3 for ruby < 1.9.0, > release a version that just works on ruby 1.9 and play new core things to > a new major release (2.0?) . > > Also, we have some things that could be released in a 1.2 release, like > logging facility. > > So, by the talks that I see for 1.9 support here in the list, it seems that > we are really going to an event based/thread based approach, is it? And > the preference is for a pure ruby approach. Got it? > > Cheers, > > Filipe > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From wayneeseguin at gmail.com Thu Dec 27 20:47:05 2007 From: wayneeseguin at gmail.com (Wayne E. Seguin) Date: Thu, 27 Dec 2007 20:47:05 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> Message-ID: I am in favor of: * Keeping as much of Mongrel core as it is, if possible. * Rewriting only what is needed to target a thread pool (configurable) and/or evented implementation (I believe that adding support for both would be ideal). ~Wayne -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-development/attachments/20071227/e1ee52f8/attachment.html From zedshaw at zedshaw.com Thu Dec 27 21:57:57 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Thu, 27 Dec 2007 21:57:57 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> Message-ID: <20071227215757.2530d2f7.zedshaw@zedshaw.com> On Thu, 27 Dec 2007 14:30:07 -0300 "Luis Lavena" wrote: > On Dec 27, 2007 1:47 PM, Kirk Haines wrote: > > On Dec 27, 2007 5:45 AM, Filipe Lautert wrote: > > > Maybe the best aproach is really drop it all and rewrite this from > > > scratch using events. Now.. which lib to use? The is event machine, > > > zed's rev, ezmorbius' packet... lot of options. No, that's a bad idea, and again I keep saying and again people keep suggesting it so I'll say it one more time: Use only what's available in Ruby from the beginning (select and threads) for the base mongrel IO processing, and then have a mod for other methods. There's a reason: Other event systems and libs that are not part of ruby will get stomped on by all the different Ruby implementations, and if a new ruby comes out that isn't retarded you'll all get bit in the ass trying to use it. That means, use regular ruby with minimal gear for the base mongrel. Not evented libraries. Additionally: Event based systems are not a cure for speed. They are a lame hack for getting around most operating system's shitty AIO or thread implementations. If you don't always have your vanilla source tree you'll get screwed when these systems improve. It happens all the time so learn from past mistakes. And finally: Mongrel is also a library. The problem with event libs is once you use them they are viral and always require everything else to start using the event system. If the only way someone can embed mongrel in their little app is to also include all of EM or Rev and then hook their crap into that event loop then you've all failed hard. > > We're in a situation where having a single version that is compatible > > with 1.8.x and 1.9.x means suboptimal performance on 1.9.x. > > > > So.... Sigh, metrics and evidence please. Without those a debate on performance is meaningless. > > The choices: > > > > 1) Rewrite the network core to make use of a thread pool, and keep > > Mongrel, natively, as a threaded app based on core ruby facilities. Now, this is doable, and I did this intially, so I'll lay out some original design choices I tried and why I didn't do them: 1) select based reactor to a state machine based processor. Worked great and was fast, but crashed HARD when you put it in a thread since ruby confused using select in a thread with having to deadlocked threads. This is because ruby (used to?) not properly mesh the thread select processing with regular select calls so juggling this was a nightmare. This was actually the absolute fastest thing I built except for this last flaw. 2) Thread pool reading of a single work queue at random with a feeder thread. This was not fast at all. The thread queues were so slow then and buggy that they were next to useless, and they aslo didn't allocate to the readers at random. Also the contention between the main master read/accept thread and the other threads made this not work so well. 3) Select loop to read the request, then put that on a thread queue. Combined both problems for a spectacular disaster. 4) Create new thread for each request. This is what you have now. So, I'd say try these again, with the select+FSM approach first and then see what you get. The #1 approach worked great as long as you didn't put the select inside a thread, and it'd basically be a lo-fi event system that everyone can love. A thread queue would be next but you'd probably have a lot of work to do on that. > > I think there are a few things that are important for Mongrel. Two > > things, really. > > > > 1) It should run just about everywhere that Ruby does, including > > Windows machines. > > +1, we have achieved that. Not really, the requirement is that it run embedded inside anything with just a few little calls and a thread. See above for why EM, Rev, or Packrat don't satisfy that. > > To me, the immediate release goal should be to just repackage the > > current gem with a ruby version requirement on it < 1.9.0. > > > > 1.1.3? That's what I'd shoot for in the next release, also, what happened to giving people the ablity to put in their own "work handler" so that this problem becomes somebody else's problem? -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From filipe at icewall.org Fri Dec 28 00:10:14 2007 From: filipe at icewall.org (Filipe Lautert) Date: Fri, 28 Dec 2007 03:10:14 -0200 (BRST) Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <71166b3b0712270954u42e92499if762fb1409546010@mail.gmail.com> Message-ID: On Thu, 27 Dec 2007, Wayne E. Seguin wrote: > I am in favor of: > > * Keeping as much of Mongrel core as it is, if possible. > * Rewriting only what is needed to target a thread pool (configurable) > and/or evented implementation (I believe that adding support for both would > be ideal). WHOW, now here is a new thing for me. wyhaines and zed agreeing about something! Then let us play with threads! Btw, with commits from today to trunk, just one test is not running on ruby 1.9 . But I'm already discuting this at ruby-core list (I wrote a resume at my blog anyway), because this is a Net::HTTP problem, and not a mongrel one. So, by now trunk builds in 1.8 and 1.9 and passes all tests (except this one) for both! Cheers, filipe { @ icewall.org GPG 1024D/A6BA423E http://filipe.icewall.org/ } From luislavena at gmail.com Fri Dec 28 08:59:52 2007 From: luislavena at gmail.com (Luis Lavena) Date: Fri, 28 Dec 2007 10:59:52 -0300 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <20071227215757.2530d2f7.zedshaw@zedshaw.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <20071227215757.2530d2f7.zedshaw@zedshaw.com> Message-ID: <71166b3b0712280559k1403fc23s7161c8c2354b2b7f@mail.gmail.com> On Dec 27, 2007 11:57 PM, Zed A. Shaw wrote: > > > > We're in a situation where having a single version that is compatible > > > with 1.8.x and 1.9.x means suboptimal performance on 1.9.x. > > > > > > So.... > > Sigh, metrics and evidence please. Without those a debate on > performance is meaningless. > I can confirm that thread spawning and context switching in 1.9 is more expensive than 1.8, done some tests but didn't collect the data for posterity (or for later big discussion and metrics comparison with you Zed) :-D Also, done some testing regarding C function calling and pure-ruby function calling overhead, being 1.9 slower than 1.8 in pure-ruby calling. > > > The choices: > > > > > > 1) Rewrite the network core to make use of a thread pool, and keep > > > Mongrel, natively, as a threaded app based on core ruby facilities. > > Now, this is doable, and I did this intially, so I'll lay out some > original design choices I tried and why I didn't do them: > > 1) select based reactor to a state machine based processor. Worked > great and was fast, but crashed HARD when you put it in a thread since > ruby confused using select in a thread with having to deadlocked > threads. This is because ruby (used to?) not properly mesh the thread > select processing with regular select calls so juggling this was a > nightmare. This was actually the absolute fastest thing I built > except for this last flaw. > Did you keep that original code somewhere? A few things improved regarding this topic, or at least they seem in 1.9 > 2) Thread pool reading of a single work queue at random with a feeder > thread. This was not fast at all. The thread queues were so slow > then and buggy that they were next to useless, and they aslo didn't > allocate to the readers at random. Also the contention between the > main master read/accept thread and the other threads made this not work > so well. > Can't comment on this, my brain is still trying to understand what you wrote. > 3) Select loop to read the request, then put that on a thread queue. > Combined both problems for a spectacular disaster. > > 4) Create new thread for each request. This is what you have now. > This is resource expensive, I'll collect some sample data this weekend and show to you the problem that is present in 1.9 regarding this. I've followed that path before, but on FreeBASIC, and faced the same results, FB threads where native (linux and windows) but wasn't scalable, too many threads bring the OS down, linux or windows. Didn't test it on Solaris, which have a better threading functionality to compare with. > > > I think there are a few things that are important for Mongrel. Two > > > things, really. > > > > > > 1) It should run just about everywhere that Ruby does, including > > > Windows machines. > > > > +1, we have achieved that. > > Not really, the requirement is that it run embedded inside anything > with just a few little calls and a thread. See above for why EM, Rev, > or Packrat don't satisfy that. > I was talking about *current* mongrel, not the hypothetical evented one. > > > To me, the immediate release goal should be to just repackage the > > > current gem with a ruby version requirement on it < 1.9.0. > > > > > > > 1.1.3? > > That's what I'd shoot for in the next release, also, what happened to > giving people the ablity to put in their own "work handler" so that > this problem becomes somebody else's problem? Mmm, don't follow you on that. You mean allow pluggable replacement for HttpServer? -- Luis Lavena Multimedia systems - A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. Douglas Adams From wyhaines at gmail.com Fri Dec 28 10:02:20 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Fri, 28 Dec 2007 08:02:20 -0700 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: <71166b3b0712280559k1403fc23s7161c8c2354b2b7f@mail.gmail.com> References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <20071227215757.2530d2f7.zedshaw@zedshaw.com> <71166b3b0712280559k1403fc23s7161c8c2354b2b7f@mail.gmail.com> Message-ID: On Dec 28, 2007 6:59 AM, Luis Lavena wrote: > > That's what I'd shoot for in the next release, also, what happened to > > giving people the ablity to put in their own "work handler" so that > > this problem becomes somebody else's problem? > > Mmm, don't follow you on that. You mean allow pluggable replacement > for HttpServer? I think Zed is referring to the suggestion that the portion of the guts that deals with network IO interactions, and the idea that we make that more modular so that it is easy to plug different architectures into it. Kirk Haines From evan at cloudbur.st Fri Dec 28 19:23:27 2007 From: evan at cloudbur.st (Evan Weaver) Date: Fri, 28 Dec 2007 19:23:27 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <20071227215757.2530d2f7.zedshaw@zedshaw.com> <71166b3b0712280559k1403fc23s7161c8c2354b2b7f@mail.gmail.com> Message-ID: Zed, Can you elaborate on the thread pool problems you had? Do you think any of these will be mitigated by YARV threads (better scheduling etc). Evan On Dec 28, 2007 10:02 AM, Kirk Haines wrote: > On Dec 28, 2007 6:59 AM, Luis Lavena wrote: > > > > That's what I'd shoot for in the next release, also, what happened to > > > giving people the ablity to put in their own "work handler" so that > > > this problem becomes somebody else's problem? > > > > Mmm, don't follow you on that. You mean allow pluggable replacement > > for HttpServer? > > I think Zed is referring to the suggestion that the portion of the > guts that deals with network IO interactions, and the idea that we > make that more modular so that it is easy to plug different > architectures into it. > > > Kirk Haines > > _______________________________________________ > Mongrel-development mailing list > Mongrel-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-development > -- Evan Weaver Cloudburst, LLC From zedshaw at zedshaw.com Fri Dec 28 21:12:14 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 28 Dec 2007 21:12:14 -0500 Subject: [Mongrel-development] Review of Code for 1.9 In-Reply-To: References: <71166b3b0712251458h2227853ew2a8d652a81ce0706@mail.gmail.com> <71166b3b0712252246xf3d6503s972f83c22a008ee0@mail.gmail.com> <71166b3b0712270401q68b26a69v61c57041eac387fc@mail.gmail.com> <71166b3b0712270930r5ded1ec0kbca5ff19eb777e04@mail.gmail.com> <20071227215757.2530d2f7.zedshaw@zedshaw.com> <71166b3b0712280559k1403fc23s7161c8c2354b2b7f@mail.gmail.com> Message-ID: <20071228211214.1856a5a4.zedshaw@zedshaw.com> On Fri, 28 Dec 2007 19:23:27 -0500 "Evan Weaver" wrote > Zed, > > Can you elaborate on the thread pool problems you had? Do you think > any of these will be mitigated by YARV threads (better scheduling > etc). They might be gone in YARV since the threading is more real and (supposedly) higher performance. My problem was mostly that putting the requests through a thread queue was a lot slower (1/2 speed iirc) than just making new threads. Without a queue though it's really difficult to do a pool of processors model. I tried using the plain synchronized primitives but that turned out to be the same problem for speed, especially when combined with rails. Finally, in order for a set of queue listeners to work properly the selection of the next processor/listener to receive a queue entry has to be fairly random. However I found that it wasn't that random and usually it was more first-come-first served. -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/ From zedshaw at zedshaw.com Fri Dec 28 21:31:08 2007 From: zedshaw at zedshaw.com (Zed A. Shaw) Date: Fri, 28 Dec 2007 21:31:08 -0500 Subject: [Mongrel-development] [SECURITY] Patch For Bug Serving Arbitrary Files Message-ID: <20071228213108.35b0c427.zedshaw@zedshaw.com> This is a proposed patch for the security hole reported today. You can just add the test for @path being at index 0 in the exanded req_path as shown below. Take heed of the comment I've added too, and there was a test for this very attack in the unit test suite, so it was removed by someone as well. I didn't test this but I'm pretty sure it's the fix. === lib/mongrel/handlers.rb ================================================================== --- lib/mongrel/handlers.rb (revision 6851) +++ lib/mongrel/handlers.rb (local) @@ -132,8 +132,12 @@ # Add the drive letter or root path req_path = File.join(@path, req_path) if @path req_path = File.expand_path req_path - - if File.exist? req_path + + # do not remove the check for @path at the beginning, it's what prevents + # the serving of arbitrary files (and good programmer Rule #1 Says: If + # you don't understand something, it's not because I'm stupid, it's + # because you are). + if req_path.index(@path) == 0 and File.exist? req_path # It exists and it's in the right location if File.directory? req_path # The request is for a directory @@ -153,7 +157,7 @@ return req_path end else - # does not exist or isn't in the right spot + # does not exist or isn't in the right spot or isn't valid because not start with @path return nil end end -- Zed A. Shaw - Hate: http://savingtheinternetwithhate.com/ - Good: http://www.zedshaw.com/ - Evil: http://yearofevil.com/