From list at mrtech.ru Sun May 1 08:51:53 2011 From: list at mrtech.ru (Troex Nevelin) Date: Sun, 01 May 2011 15:51:53 +0300 Subject: bind to socket with relative path Message-ID: <4DBD5769.5090705@mrtech.ru> I cannot bind to socket with `-l` option if I specify relative path. Is it bug or absolute path is mandatory? Tried 3.4.0 and 3.6.2 - both failed. -- root at zenon:/var/www/test.st.std42.ru/SiteTarget/server# unicorn -l /var/www/test.st.std42.ru/SiteTarget/server/counter.sock I, [2011-05-01T16:46:55.194425 #30369] INFO -- : listening on addr=/var/www/test.st.std42.ru/SiteTarget/server/counter.sock fd=3 I, [2011-05-01T16:46:55.194867 #30369] INFO -- : worker=0 spawning... I, [2011-05-01T16:46:55.196281 #30376] INFO -- : worker=0 spawned pid=30376 I, [2011-05-01T16:46:55.196533 #30376] INFO -- : Refreshing Gem list I, [2011-05-01T16:46:55.234478 #30369] INFO -- : master process ready I, [2011-05-01T16:46:56.166438 #30376] INFO -- : worker=0 ready I, [2011-05-01T16:46:58.303501 #30369] INFO -- : reaped # worker=0 I, [2011-05-01T16:46:58.303703 #30369] INFO -- : master complete root at zenon:/var/www/test.st.std42.ru/SiteTarget/server# unicorn -l ./counter.sock F, [2011-05-01T16:47:10.661755 #31915] FATAL -- : error adding listener addr=./counter.sock /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn/socket_helper.rb:143:in `bind_listen': Don't know how to bind: ./counter.sock (ArgumentError) from /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn/http_server.rb:248:in `listen' from /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn/http_server.rb:145:in `start' from /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn/http_server.rb:145:in `each' from /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn/http_server.rb:145:in `start' from /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn.rb:13:in `run' from /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/bin/unicorn:120 from /usr/bin/unicorn:19:in `load' from /usr/bin/unicorn:19 From normalperson at yhbt.net Sun May 1 14:44:11 2011 From: normalperson at yhbt.net (Eric Wong) Date: Sun, 1 May 2011 11:44:11 -0700 Subject: bind to socket with relative path In-Reply-To: <4DBD5769.5090705@mrtech.ru> References: <4DBD5769.5090705@mrtech.ru> Message-ID: <20110501184411.GA4196@dcvr.yhbt.net> Troex Nevelin wrote: > I cannot bind to socket with `-l` option if I specify relative path. > Is it bug or absolute path is mandatory? > > Tried 3.4.0 and 3.6.2 - both failed. > > root at zenon:/var/www/test.st.std42.ru/SiteTarget/server# unicorn -l ./counter.sock > F, [2011-05-01T16:47:10.661755 #31915] FATAL -- : error adding listener addr=./counter.sock > /usr/lib/ruby/gems/1.8/gems/unicorn-3.4.0/lib/unicorn/socket_helper.rb:143:in `bind_listen': Don't know how to bind: ./counter.sock (ArgumentError) Use "unix:./counter.sock" or "unix:counter.sock" instead (should be compatible with nginx notation). Without a leading "/" or "~", it can be hard to tell if it's a hostname address or not. -- Eric Wong From normalperson at yhbt.net Thu May 5 15:48:33 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 5 May 2011 12:48:33 -0700 Subject: kgio 2.4.0 coming soon Message-ID: <20110505194833.GB29336@dcvr.yhbt.net> The I/O library used by the latest version Unicorn/Rainbows! got some OpenBSD portability fixes thanks to Jeremy Evans. Users of the latest Rainbows!/Unicorn versions should just be able to update kgio independently and be on their way if they need OpenBSD fixes. Summary of changes and reasoning here: http://mid.gmane.org/20110505194305.GA29336 at dcvr.yhbt.net Feel free to comment on kgio at librelist.com[1], reply here, or email me privately if you're shy. [1] subscription is required there unfortunately, send a message and follow directions to subscribe -- Eric Wong From normalperson at yhbt.net Thu May 5 19:34:21 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 5 May 2011 23:34:21 +0000 Subject: [ANN] kgio 2.4.0 released In-Reply-To: <20110505194833.GB29336@dcvr.yhbt.net> References: <20110505194833.GB29336@dcvr.yhbt.net> Message-ID: <20110505233421.GA4358@dcvr.yhbt.net> http://mid.gmane.org/20110505231506.GA3810 at dcvr.yhbt.net OpenBSD (and other *BSD) users should upgrade if you haven't been able to use the latest releases. -- Eric Wong From stones.gao at gmail.com Sat May 7 07:54:11 2011 From: stones.gao at gmail.com (Stone) Date: Sat, 7 May 2011 19:54:11 +0800 Subject: unicorn worker partially restarted when using USR2 Message-ID: In the deployment I did kill -s USR2 `cat unicorn_pid` to gracefully restart unicorn. But I noticed that unicorn workers were partially restarted when using USR2. The following is how I did test: start unicorn in production environment: the action has the following code: def index logger.info "-----------------------------------------fooo bar ---------" logger.info "-----------------------------------fooo bar ---------" end then changed the code to: def index logger.info "--####---------------------------------fooo bar ---------" logger.info "-----------------------------------fooo bar ---------" end and run kill -s USR2 `cat unicorn_pid` and then tail the production.log (after several minutes) Started GET "/" for 192.168.21.1 at Sat May 07 04:13:31 -0700 2011 Processing by NewHomeController#index as HTML -----------------------------------fooo bar --------- -----------------------------------fooo bar --------- Rendered new_home/index.html.erb within layouts/new_home (15.5ms) Completed 200 OK in 16ms (Views: 16.2ms) Started GET "/" for 192.168.21.1 at Sat May 07 04:13:31 -0700 2011 Processing by NewHomeController#index as HTML --####---------------------------------fooo bar --------- -----------------------------------fooo bar --------- Rendered new_home/index.html.erb within layouts/new_home (28.1ms) Completed 200 OK in 29ms (Views: 28.9ms) Started GET "/" for 192.168.21.1 at Sat May 07 04:13:31 -0700 2011 Processing by NewHomeController#index as HTML -----------------------------------fooo bar --------- -----------------------------------fooo bar --------- Rendered new_home/index.html.erb within layouts/new_home (17.5ms) Completed 200 OK in 20ms (Views: 18.4ms) Started GET "/" for 192.168.21.1 at Sat May 07 04:13:37 -0700 2011 Processing by NewHomeController#index as HTML --####---------------------------------fooo bar --------- -----------------------------------fooo bar --------- Rendered new_home/index.html.erb within layouts/new_home (13.5ms) So it seems that unicorn was just partially restarted. Best Regards, Stone From normalperson at yhbt.net Sat May 7 13:54:48 2011 From: normalperson at yhbt.net (Eric Wong) Date: Sat, 7 May 2011 17:54:48 +0000 Subject: unicorn worker partially restarted when using USR2 In-Reply-To: References: Message-ID: <20110507175448.GA31876@dcvr.yhbt.net> Stone wrote: > In the deployment I did kill -s USR2 `cat unicorn_pid` to gracefully > restart unicorn. But I noticed that unicorn workers were partially > restarted when using USR2. You need to send a SIGQUIT to the original master process, otherwise both masters and all workers continue running. This allows you to test the new deploy (combined with SIGWINCH). The last section of http://unicorn.bogomips.org/SIGNALS.html describes this process in detail. > The following is how I did test: > > start unicorn in production environment: > > the action has the following code: Ugh, don't you have something like "ps axf" that shows you a process tree? It's much easier just to *see* the process tree. -- Eric Wong From kostyahorrof at mail.ru Fri May 13 04:17:14 2011 From: kostyahorrof at mail.ru (=?Windows-1251?B?Qujk+yDkZf/y5ev87e7x8ugg188=?=) Date: Fri, 13 May 2011 12:17:14 +0400 Subject: =?Windows-1251?B?wmPlIOLu5+xv5u37ZSBj9WXs+yBjIGHvcGXr/w==?= Message-ID: <739179731.20110513088357@pop3.harikpotter.com> ----------------------------------------------------------------------------------- |B?? ??? ??C?H??? ??E??P?????????. B?e ????????e ??e?? c 1.04.2011 | |?po?e??? ?P???P????????? - ?ex?????? ?a?o?????? ?o?????, | |?e?????????? ?e?????? ?pe???????????? ? c????? ?e???????? A????. | ----------------------------------------------------------------------------------- > ?e???a? ? 16 ?a? ? 2011 ?. > ?. K??? ? ??. ?????????a?, 12 > ?e?.: (044) 331-?4-14, 592-75-6? > ??O?????? > B??? ?E?????H???? ?? (??o?e??? ????a? ?o ???a? ?e??????????, ?e ??ec????? > ? ????e?e?????? ??????o ???o?a: ?a? ce????? ?o??o ???a?????????? o???????): ?po????? c ??c???????? ? ?epe??? pa?????????? ??????x? ???o? ????e???????. ??ep?a??? ????o?? c?????????? ????c? ?p? ??????e ?o???? ??e??p????????? - ????e ?o??????? ????o ????o??????? ?p.????. > ?e????? ??e?a c 2011?., ?H??? ??e?? ?o?o??? ? ?a??????, "??a???????" ??p?????e ?o???????: ?o?e?? ?e ???a?e???? ?EP??? ?????. ?a?????????? ?op???a ??????e??? ??a? ?a?????? ? ?ox????. ??p??? ?a ????a??????? ???o??????. ??p?o???????? ?a???????? (e?e??e???...), ?o??? ?? o?????????? ??, c????? ?o????????? ?a?????, ?e???e??? ????a ?o??p?? ?o ?ec?? pea???????. ?a???????? ??a?? p?c????? -3 ??p?????. ?a? ?ec?? pa????? ?e? ?o????p??????? ?????e????. ??????H?? ?OK??E??? ?a ?OBA? ??P???, ????a??????? ?e?e??? ??e?a (c?a?????? ??a??? p????? ? 2010 ? 2011 ?.): 2-?p????? pa??e?, 45% ?.? K?? ????????o ?a?????? ??o? ?pa?a. B????? ?????e??o? ?a ?o????? ????p? (?c???) ? ?o??o ?? ?e ??e?? ?o???e??? ?a ???xo? ????p?, ??o ???a??, ec?? ?x ?e?. ???a????? ??p???? ??c?? ?a???? ??e?????: o????? ?????c? ?pe???????, ?p???e??? ??o???. - ???a? ?a ?e ??e? ?o??p??-???????????? ?e??????? - ???e?? ?o?a p???o ???????e??? ?a ?pa?????. ?????H?? ?E?E???? ???A?????. ?a??e ?????e??? ???a?a?? ?o???????? (???A?? ??E??? - A H? ?????O ??O ??E????????). K???e ?op?a?????? a??? ? ??o? ????o?? ????? ??????o???? ? 2011 ?. (?o?op?? ???c????? ? c?????). > ?P?B????.????????! ?pa?????? - ?a? ????e???? ?e?? ??pe? ????e????, ??o?? ?e ?o??c?? ? ???a? 7,5 ???! (?p? ??o???? 500 ??c.). > ?P?B???? ?a??????? ???e????? o??a?????: x?o????????, ?o????????? ?a?????, ??c??????? ?p????p???????......... K???e ??a???? ? ?po?? ?po?e????? ?AK???????? ?P?B????. > HA????? ?A???????. ????o ?? ?e?e??????????????? ?p??o??? ? ??a???????-????????. ?a????e??? ?pa??a????-???????? ???o?o??? c pa?????????: c ?a???? ?a????????? ???o?????? ?e???? ?a????a??, ?pa?????????? ??????a ?a?o??????????? ?o ??????o?? ? ?p????????-?????????. ?o??? ?????a????-???????? ?o???o? ???a?a?? ?o? ?a?????????????. ??p???? ?a????e??? ? o?pa????? ? ???e??o??? ????o?? co????????? ????c? - ?a??? ????? ?p??e???, ?o?op?? ?e ???o ?o c?? ?op. H???????? ??KO???????????? ??O ?P??: c ?e? ce????? ???????a???? ?p?????????????, ?a??e o????? ????o??? ? ??O?OB??? ??BE???????????. ????o???op???: ?a??e o??p???? ?o???? ?????a?? ???o??????. > O?????????? ???o?o????????? c 1.04.2011 ??? ?e?, ??o ???o??? ?a e???o? ?a???e: ? ?o????????? ?e?????? ?????a?? ?a????? ?o? 0- 10-11-15-17%: ?o ?ce? ????????x ??????a????. P??????? ?p???????? ?a??????? ???o? ? ????o?????? ?e ??a???? ?a?o?? (?e ???a) c 1.04.2011. ??pa?????????? ??e? o?op???? - 300 ??c., 500 ??c., 1???. ? ??c??????????? ??e?????: ?o??cc??, ?op??e???, ??e??c???. ?p????e??? ??c???????? ??? ???????a??? ?a?????????????. ? ?o????a ???ap? ? ?? c 1.04.2011- ?a? "o?o???" ?a?pe? ????c??? ?a pac???? ?o ?p?????. ? ?c???? ?o K?E? 72, 74. ?o????e ???c????a??? c ?o??? ??e??? ??????c???? ? ?e????ap?????? ?a?o?o??????????. O?????e ????e??????? o? o???????. K?? ?e ?o?ac?? ? ?????a??e c???o? ????o?????, ??????????. ? ?c? ?p? ?e??????o??? ? c?ep? ???op????????? (72 ?o? KBE?) c 1.04.2011. ????a ?? ?? c?e??a????? ?o??o?o??? ??? o?a????? ???x ?c???. ??c????????? p?????????? ???c???a ?a ??? ?e??. ? ?o??o ?? ????????a?? ??B???H?? "?o??a ?a?o?????" ? ?e? ?p?????. ? "????o???e ?a???" H???????? K?H???? - ?o??a ?p??????? ?c? ?p????? o??a?? ?oc??a?????. ? H?C, ?p?????, H???, EC? - o?ep????, ?p? ?o??p?? ?e? ?? ???o?o ?a???a. ? O???????????? pa?o?? ??_???e??????_???????? c 2011 ?. ?a???? ?? c o???? ?????p?????? - ??a????? ??o?e???. > ??????EC??? ???O ??a?e????? e?????o ?a????. ? ??????a ???e??? ??x?a??e?????? ????a. B ?e? ?a????ae??? ?????e?????? ??e?a ? ?a???????? K???? ????a ?o?o??? ? ?a??????. ??c???????? ?e???o??????. ? ?oc??????????? o?ep???? ??? ?p.??? - ???????e ????o?? ?H?? ? ?p.? ???.???a?. ? B?? c???? ?????e??? ?a????? - o? 0 ?o 17% ???ep? > ?P????????? ???O ?a ?????o??? ?a??????x. ? ??o ?o??? ?ep???? (??pa??????? ?o ???a? ?e??????????) ? o?????????? ?o ?c?o????????? ?e??? ? "????o???e ?a???" ?o ???a?? ?a?o???. > ??????E???? ???O, ?c??e????????? ???c????a???????, ??x?a??e?????, ?p?????c??? ?c????... ? ???a???????, c???????e c ??a??????????(?????????????????) ?c??? > Pa???? "?O?P???????" ??c?o????? ?? ? ?p???p?????: ?o?????? ? ?? ??? ???a?? ?a?????????. ?p????e??? 500 ??c. ?A???????? ??E? ? O??O? O?????. Ec?? "c??????????" c???a???e ???a. ?a?o?? ?o? ???o? ????o??? ????o?. ???P?????????? ??P?? ? ?? c 2011?. - ???ee? ?o???????????: ??o?a?? ???e c????????????, ??????e ?e??: ?o??e ??a??? c 2011 ?. ?o??? ??e????? ?????a?? ?o? ????????op???. ???a?? H??? c ?o???? ? 2011 ?.- c ?a?o? ?pe????????? ?a????e?????? ??a????? H???. > ?OC??????????? ????E??H????: ?o????? ???a ?p? o?pe??????? - ??o ?a??? ??p????. ?e? ?o???c?? o????a???? o? ?o???e???, ?pa????????? ??c???????, ?p???x ?o???????????? ?o???o???. ??O ?E?A?? ?E????? ?O????????? ?a ??OB????. > APE???/????????? c 1.04.2011. ????e?c? ?? ape??? ?c???o?? ?o??o ?? ???e? o???c??? ?p???? ?a pa????? c 1.04.2011 ?p? ape??? ?: ? ?? e???????, ? ???. ???a. H???c? ?p??e????? ?o????? "?????????a? ????a a?e?????? ????e?a" > P????? ?O ??B????????? O? ?pe??p?????????: ????o ?? c?????? o?????, ??ce???? ?a??- ??o ?o?o????, e??? ???c?????, ??o pa???? ???a ?e????a????. > P????? ?? ?a ???E? C?C?E??: e??? ?e ???e? ????????o??? - ????o ?? ??a???? e????? ?o???????? ???o?, ?a? p?c??????? (?e ??a????) ??a?????? ??a????. Pa?o?? ?a o???? c??????: ????e ????o ???a?????? ?a?o??, ?p??e????? ??c?????? a???????. H???? ?op??o? ???e??? ??e?a ?? ?a o??e? c???e?? - o?????? ??????a ?e????? ???o?? ??e???????????? ? ?ae??o?? pa???????. ??c???????? o?c??c???? ?p?x????? ?o???????? ?a ?o?ap ? ?? ?a o???? ??c?e??. K???e ?????e??? ?e???????? co??????? ?e?, ??o ???e? ?o?a???? ?c?a??? ?p? ??p????? ?a o???? ??c????, ??c???????? o????????? ?????e??o? ?o ?c?????? c 1.04.2011 > A??o?? ? ?e????e c???????: ? Be??????a? ????a ??o?e??? - ??????p, ????p ??????a??? ? ?p?c??, ????? ?E????? ???o? ??? ???????c??? ? ??????c??x ????. ? Kp??o????? A??pe? ????o??? - ?p???, ??e???? ?o????? o??? c?o??? (c????) c ????p?????????? o??????? ?a c?o???? ?a????????????????. > ?AC??????? ? ????c?????? c 9:30 ?o 10:00 ? Ha?a?? ? 10:00 ? O?o??a??? ? 17:00 > C????O??? ? 750.00 ?p?. ?a o????o ????????a (?p? o????? ?a ?O?). ? 830.00 ?p?. ?a o??o?o ???c????a (?p? o??a?? ?a ?p. ???o). ? ??? ??opo?o ? ?pe????o ??ac????a c????? ? 15% ? B ??o??oc?? ?xo???: ???op?a??????-???????????????? o?c?????a??? ?a ce???a??, c?o???? ?a??p?a???, ???a???, o?????e??e ?o??a??? ? o??e? ??e????? c ?e???po?. ? Ka???? ??ac???? ?o???ae? ??x?a???p???? ?o???e?? ?o???e??o?. ? ?????? ????? ??????? ????????? ?????? ????????? ????????? ??????? ????? ??????? ??????? ????????? ??????? ???? ???????? ???? ??????? ?????? ??????????? ????????? ????? ???????? ??????? ????? ?????? ?????? ????????? ???? ????? ??????? ??????? ?????? ? ?ape?????????????? ????o ?o: (044) ?31-64-14, 592-75-6? From normalperson at yhbt.net Mon May 16 17:54:59 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 16 May 2011 21:54:59 +0000 Subject: adding GPLv3 to unicorn license In-Reply-To: <20110428005727.GA19557@dcvr.yhbt.net> References: <20110428005727.GA19557@dcvr.yhbt.net> Message-ID: <20110516215459.GD18848@dcvr.yhbt.net> Eric Wong wrote: > Hello, I would like to extend the unicorn license from > (GPLv2|Ruby terms) to (GPLv2|GPLv3|Ruby terms). > > Zed and Evan are still the authors of much of the HTTP parser code I just repinged both of them and got affirmative replies from both \o/ Thanks! I'll email the rest of the smaller contributors in a separate email. ref: http://mid.gmane.org/20110428005727.GA19557 at dcvr.yhbt.net -- Eric Wong From normalperson at yhbt.net Mon May 16 18:03:41 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 16 May 2011 22:03:41 +0000 Subject: adding GPLv3 to unicorn license In-Reply-To: <20110516215459.GD18848@dcvr.yhbt.net> References: <20110428005727.GA19557@dcvr.yhbt.net> <20110516215459.GD18848@dcvr.yhbt.net> Message-ID: <20110516220341.GE18848@dcvr.yhbt.net> Hello, you're being Cc:-ed on this email because you've contributed to the Mongrel or Unicorn code base at some point. I would like to add the GPLv3 to the existing Unicorn license, making it (Ruby terms|GPLv2|GPLv3). Furthermore, I'd like the project leader of Unicorn (currently me) to be given the option to add future versions of the GPL (as published by the Free Software Foundation) to the license. I'm /not/ asking for a "GPLv2 or later" clause since that would give the FSF too much power for GPLv4. The original request to Zed Shaw and Evan Weaver is here: http://mid.gmane.org/20110428005727.GA19557 at dcvr.yhbt.net Besides myself, Zed Shaw and Evan Weaver have the largest amount of code in Unicorn, and both have OK-ed the addition of the GPLv3, so I hope you do the same. Thank you. -- Eric Wong From normalperson at yhbt.net Mon May 16 18:07:12 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 16 May 2011 22:07:12 +0000 Subject: Fwd: adding GPLv3 to unicorn license Message-ID: <20110516220712.GF18848@dcvr.yhbt.net> Hi Ian, I also found this address in the git history, hoping this works since ian at inspir.es doesn't. ----- Forwarded message from Eric Wong ----- From: Eric Wong To: mongrel-unicorn at rubyforge.org Cc: Hongli Lai , Augusto Becciu , I?aki Baz Castillo , Wayne Larsen , Andrey Stikheev , "Suraj N. Kurapati" , Luis Lavena , Ian Ownbey Subject: Re: adding GPLv3 to unicorn license Hello, you're being Cc:-ed on this email because you've contributed to the Mongrel or Unicorn code base at some point. I would like to add the GPLv3 to the existing Unicorn license, making it (Ruby terms|GPLv2|GPLv3). Furthermore, I'd like the project leader of Unicorn (currently me) to be given the option to add future versions of the GPL (as published by the Free Software Foundation) to the license. I'm /not/ asking for a "GPLv2 or later" clause since that would give the FSF too much power for GPLv4. The original request to Zed Shaw and Evan Weaver is here: http://mid.gmane.org/20110428005727.GA19557 at dcvr.yhbt.net Besides myself, Zed Shaw and Evan Weaver have the largest amount of code in Unicorn, and both have OK-ed the addition of the GPLv3, so I hope you do the same. Thank you. -- Eric Wong ----- End forwarded message ----- -- Eric Wong From normalperson at yhbt.net Mon May 16 18:10:28 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 16 May 2011 22:10:28 +0000 Subject: adding GPLv3 to unicorn license In-Reply-To: <20110516220341.GE18848@dcvr.yhbt.net> References: <20110428005727.GA19557@dcvr.yhbt.net> <20110516215459.GD18848@dcvr.yhbt.net> <20110516220341.GE18848@dcvr.yhbt.net> Message-ID: <20110516221028.GG18848@dcvr.yhbt.net> Anybody have a current email address for Augusto? augusto at jadedpixel.com isn't working for me. -- Eric Wong From luislavena at gmail.com Mon May 16 18:39:32 2011 From: luislavena at gmail.com (Luis Lavena) Date: Mon, 16 May 2011 18:39:32 -0400 Subject: adding GPLv3 to unicorn license In-Reply-To: <20110516220341.GE18848@dcvr.yhbt.net> References: <20110428005727.GA19557@dcvr.yhbt.net> <20110516215459.GD18848@dcvr.yhbt.net> <20110516220341.GE18848@dcvr.yhbt.net> Message-ID: I'm OK. mongrel_service do not fall into Mongrel's licensing I believe. Also, since is a gem plugin, do not need to comply with GPL licensing, correct? If that is the case, then yes, no complains from me. If that is not the case, then you have my complain. mongrel_service uses a library created by myself which is MIT, by turning mongrel and mongrel_service into GPL, could affect my usage of this library in other projects. Just saying. Licensing sucks. On Mon, May 16, 2011 at 6:03 PM, Eric Wong wrote: > Hello, you're being Cc:-ed on this email because you've contributed > to the Mongrel or Unicorn code base at some point. > > I would like to add the GPLv3 to the existing Unicorn license, making it > (Ruby terms|GPLv2|GPLv3). ?Furthermore, I'd like the project leader of > Unicorn (currently me) to be given the option to add future versions of > the GPL (as published by the Free Software Foundation) to the license. > > I'm /not/ asking for a "GPLv2 or later" clause since that would give the > FSF too much power for GPLv4. > > The original request to Zed Shaw and Evan Weaver is here: > ?http://mid.gmane.org/20110428005727.GA19557 at dcvr.yhbt.net > > Besides myself, Zed Shaw and Evan Weaver have the largest amount of code > in Unicorn, and both have OK-ed the addition of the GPLv3, so I hope you > do the same. > > Thank you. > > -- > Eric Wong > -- Luis Lavena AREA 17 - Perfection in design is achieved not when there is nothing more to add, but rather when there is nothing more to take away. Antoine de Saint-Exup?ry From normalperson at yhbt.net Mon May 16 19:20:14 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 16 May 2011 16:20:14 -0700 Subject: adding GPLv3 to unicorn license In-Reply-To: References: <20110428005727.GA19557@dcvr.yhbt.net> <20110516215459.GD18848@dcvr.yhbt.net> <20110516220341.GE18848@dcvr.yhbt.net> Message-ID: <20110516232014.GA11037@dcvr.yhbt.net> Luis Lavena wrote: > I'm OK. > > mongrel_service do not fall into Mongrel's licensing I believe. > > Also, since is a gem plugin, do not need to comply with GPL licensing, > correct? I think so, but Mongrel is has been GPLv2 + Ruby license terms for years, now. > If that is the case, then yes, no complains from me. The Ruby license terms can still be chosen for mongrel_service ever an issue since Mongrel itself already has the GPLv2 option. I don't plan on removing the Ruby licensing terms option from the Unicorn license, ever[1]. This addition only affects Mongrel code that remains in Unicorn, even, so it doesn't affect Mongrel-only things like mongrel_service. If Mongrel itself ever wanted to add the GPLv3 to it's license, I'd of course be in full support to it. > If that is not the case, then you have my complain. mongrel_service > uses a library created by myself which is MIT, by turning mongrel and > mongrel_service into GPL, could affect my usage of this library in > other projects. The Ruby-specific terms remain, so I believe mongrel_service is fine. The GPLv3 option is no more "viral" than the existing GPLv2 option. > Just saying. Licensing sucks. Agreed :< -- Eric Wong From hongli at phusion.nl Tue May 17 00:45:53 2011 From: hongli at phusion.nl (Hongli Lai) Date: Tue, 17 May 2011 06:45:53 +0200 Subject: adding GPLv3 to unicorn license In-Reply-To: <20110516220341.GE18848@dcvr.yhbt.net> References: <20110428005727.GA19557@dcvr.yhbt.net> <20110516215459.GD18848@dcvr.yhbt.net> <20110516220341.GE18848@dcvr.yhbt.net> Message-ID: On Tue, May 17, 2011 at 12:03 AM, Eric Wong wrote: > Hello, you're being Cc:-ed on this email because you've contributed > to the Mongrel or Unicorn code base at some point. > > I would like to add the GPLv3 to the existing Unicorn license, making it > (Ruby terms|GPLv2|GPLv3). ?Furthermore, I'd like the project leader of > Unicorn (currently me) to be given the option to add future versions of > the GPL (as published by the Free Software Foundation) to the license. > > I'm /not/ asking for a "GPLv2 or later" clause since that would give the > FSF too much power for GPLv4. > > The original request to Zed Shaw and Evan Weaver is here: > ?http://mid.gmane.org/20110428005727.GA19557 at dcvr.yhbt.net > > Besides myself, Zed Shaw and Evan Weaver have the largest amount of code > in Unicorn, and both have OK-ed the addition of the GPLv3, so I hope you > do the same. > > Thank you. I'm OK with GPLv3. -- Phusion | Ruby & Rails deployment, scaling and tuning solutions Web: http://www.phusion.nl/ E-mail: info at phusion.nl Chamber of commerce no: 08173483 (The Netherlands) From koji1903 at sta-m1.bayern.de Wed May 18 15:16:45 2011 From: koji1903 at sta-m1.bayern.de (Clem) Date: Wed, 18 May 2011 22:16:45 +0300 Subject: Get tool buildup every day Message-ID: <000b01cc1588$9af08010$28396050@Foreverfkojcf> Hottest increasing effect on male wellbeing. http://a2zsexshop.co.uk/czg6t1ax.html From jason at lookbook.nu Thu May 19 01:56:55 2011 From: jason at lookbook.nu (Jason Su) Date: Wed, 18 May 2011 22:56:55 -0700 Subject: unicorn doesn't restart properly after cap deploy (not using Bundler) Message-ID: Hey guys, I'm sending USR2 to unicorn after cap deploy, and the old master is getting replaced by a new master that doesn't work. Here are some similar threads I found ... http://rubyforge.org/pipermail/mongrel-unicorn/2010-October/000733.html http://rubyforge.org/pipermail/mongrel-unicorn/2010-October/000717.html I'm not using Bundler, and I have working_directory set in my unicorn config: Unicorn::HttpServer::START_CTX[0] = "/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails" pid "/var/www/lookbook/shared/pids/unicorn.pid" stderr_path "/var/www/lookbook/shared/log/unicorn.stderr.log" stdout_path "/var/www/lookbook/shared/log/unicorn.stdout.log" preload_app true if GC.respond_to?(:copy_on_write_friendly=) ? GC.copy_on_write_friendly = true end before_fork do |server, worker| ? STDERR.puts "BEFORE FORK:" ? STDERR.puts ENV.inspect ? defined?(ActiveRecord::Base) and ? ? ActiveRecord::Base.connection.disconnect! ? if old_pid != server.pid ? ? begin ? ? ? sig = (worker.nr?+ 1) >= server.worker_processes ? :QUIT : :TTOU ? ? ? Process.kill(sig, File.read(old_pid).to_i) ? ? rescue Errno::ENOENT, Errno::ESRCH ? ? end ? end end after_fork do |server, worker| ? STDERR.puts "AFTER FORK:" ? STDERR.puts ENV.inspect ? defined?(ActiveRecord::Base) and ? ? ActiveRecord::Base.establish_connection ? begin ? ? uid, gid = Process.euid, Process.egid ? ? user, group = 'apache', 'apache' ? ? target_uid = Etc.getpwnam(user).uid ? ? target_gid = Etc.getgrnam(group).gid ? ? worker.tmp.chown(target_uid, target_gid) ? ? if uid != target_uid || gid != target_gid ? ? ? Process.initgroups(user, target_gid) ? ? ? Process::GID.change_privilege(target_gid) ? ? ? Process::UID.change_privilege(target_uid) ? ? end ? rescue => e ? ? if RAILS_ENV == 'development' ? ? ? STDERR.puts "couldn't change user, oh well" ? ? else ? ? ? raise e ? ? end ? end end before_exec do |server| ? STDERR.puts "BEFORE EXEC:" ? ENV["PATH"] = "/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin" ? STDERR.puts ENV.inspect end Below is the output from unicorn.stderr.log.. I'm not sure if UNICORN_FD has something to do with it? 1) starting unicorn BEFORE FORK: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production"} AFTER FORK: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production"} 2) restarting unicorn (kill -USR2) BEFORE EXEC: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production", "UNICORN_FD"=>"3"} I, [2011-05-18T18:13:56.318531 #510] ?INFO -- : inherited addr=/var/www/lookbook/current/tmp/sockets/unicorn.sock fd=3 I, [2011-05-18T18:13:56.318819 #510] ?INFO -- : Refreshing Gem list BEFORE FORK: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production", "UNICORN_FD"=>"3"} AFTER FORK: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production", "UNICORN_FD"=>"3"} 3) cap deploy with symlinks + restart unicorn (kill -USR2) BEFORE EXEC: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production", "UNICORN_FD"=>"3"} I, [2011-05-18T18:17:13.732600 #1589] ?INFO -- : inherited addr=/var/www/lookbook/current/tmp/sockets/unicorn.sock fd=3 I, [2011-05-18T18:17:13.732942 #1589] ?INFO -- : Refreshing Gem list BEFORE FORK: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production", "UNICORN_FD"=>"3"} AFTER FORK: {"SHELL"=>"/bin/bash", "TERM"=>"xterm", "SSH_CLIENT"=>"24.23.182.32 38170 22", "OLDPWD"=>"/root", "SSH_TTY"=>"/dev/pts/5", "USER"=>"root", "SSH_AUTH_SOCK"=>"/tmp/ssh-eeoDcvH461/agent.461", "PATH"=>"/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local:/opt/ruby-enterprise-1.8.7-2010.02/bin", "MAIL"=>"/var/mail/root", "PWD"=>"/var/www/lookbook/current", "HOME"=>"/root", "SHLVL"=>"2", "LOGNAME"=>"root", "SSH_CONNECTION"=>"24.23.182.32 38170 98.158.22.100 22", "_"=>"/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails", "RAILS_ENV"=>"production", "UNICORN_FD"=>"3"} worker=1 ready any help appreciated, thanks :D Jason From normalperson at yhbt.net Thu May 19 05:27:59 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 19 May 2011 09:27:59 +0000 Subject: unicorn doesn't restart properly after cap deploy (not using Bundler) In-Reply-To: References: Message-ID: <20110519092759.GA727@dcvr.yhbt.net> Jason Su wrote: > Hey guys, > > I'm sending USR2 to unicorn after cap deploy, and the old master is > getting replaced by a new master that doesn't work. Can you expand on "doesn't work"? > Here are some similar threads I found ... > http://rubyforge.org/pipermail/mongrel-unicorn/2010-October/000733.html > http://rubyforge.org/pipermail/mongrel-unicorn/2010-October/000717.html > > I'm not using Bundler, and I have working_directory set in my unicorn config: I don't see where you have working_directory set below > Unicorn::HttpServer::START_CTX[0] = > "/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails" You shouldn't need to touch START_CTX unless you're switching Ruby installations. It's rope to hang yourself with. I would simplify the config file as much as possible if you're debugging a problem. > pid "/var/www/lookbook/shared/pids/unicorn.pid" > stderr_path "/var/www/lookbook/shared/log/unicorn.stderr.log" > stdout_path "/var/www/lookbook/shared/log/unicorn.stdout.log" > preload_app true > if GC.respond_to?(:copy_on_write_friendly=) > ? GC.copy_on_write_friendly = true > end > before_fork do |server, worker| > ? STDERR.puts "BEFORE FORK:" > ? STDERR.puts ENV.inspect > ? defined?(ActiveRecord::Base) and > ? ? ActiveRecord::Base.connection.disconnect! The auto-killing old workers bit is fragile and you shouldn't need it unless you're very low on memory. > ? if old_pid != server.pid > ? ? begin > ? ? ? sig = (worker.nr?+ 1) >= server.worker_processes ? :QUIT : :TTOU > ? ? ? Process.kill(sig, File.read(old_pid).to_i) > ? ? rescue Errno::ENOENT, Errno::ESRCH > ? ? end > ? end > > end > after_fork do |server, worker| > ? STDERR.puts "AFTER FORK:" > ? STDERR.puts ENV.inspect > > ? defined?(ActiveRecord::Base) and > ? ? ActiveRecord::Base.establish_connection > ? begin If you want to use user switching, the "user" directive which appeared a while back is much simpler and less error prone. > ? ? uid, gid = Process.euid, Process.egid > ? ? user, group = 'apache', 'apache' > ? ? target_uid = Etc.getpwnam(user).uid > ? ? target_gid = Etc.getgrnam(group).gid > ? ? worker.tmp.chown(target_uid, target_gid) > ? ? if uid != target_uid || gid != target_gid > ? ? ? Process.initgroups(user, target_gid) > ? ? ? Process::GID.change_privilege(target_gid) > ? ? ? Process::UID.change_privilege(target_uid) > ? ? end > Below is the output from unicorn.stderr.log.. I'm not sure if > UNICORN_FD has something to do with it? UNICORN_FD is absolutely for the old master tells the new master about the listener sockets to inherit. Don't touch it. > 3) cap deploy with symlinks + restart unicorn (kill -USR2) > addr=/var/www/lookbook/current/tmp/sockets/unicorn.sock fd=3 You should make sure your socket is in a shared path, not current. Whatever's in current gets replaced by Capistrano, right? I'm not sure if tmp is a symlink that's relinked on a new deploy, but there could be a race condition where the path to the socket is unreachable and nginx can't see it. -- Eric Wong From Rob.Greenwood at melbourne.co.uk Thu May 19 09:39:34 2011 From: Rob.Greenwood at melbourne.co.uk (Rob Greenwood) Date: Thu, 19 May 2011 13:39:34 +0000 Subject: Unicorn preload_app and upstart Message-ID: ?Hi, I was wondering if anyone has managed to get the preload_app and SIGUSR2 combination working well with upstart? My issue currently is that when I perform a SIGUSR2 against the master, check everything's working and close off the old master, upstart then attempts to restart it because the original PID/binary are no longer running. What is the correct way of handling this? In my opinion, should unicorn not always be using the same master process and just spawning additional children/cycling them? Else the above functionality will never work with upstart, which will be replacing init. Thanks, Rob Rob Greenwood You'll love cloud hosting with Serverlove! Find out more at http://www.serverlove.com Phone us 0161 232 0125 | Email us rob.greenwood at melbourne.co.uk Visit us http://www.melbourne.co.uk | Follow us http://twitter.com/melbournehost Office Address | Turing House, Archway, Manchester, M15 5RL Melbourne Server Hosting Ltd Registered in England and Wales, Company Number 4091836. Please don?t print this email unless necessary. Our Environmental and Ethical Policy can be found at: http://www.melbourne.co.uk/env From Rob.Greenwood at melbourne.co.uk Thu May 19 10:08:18 2011 From: Rob.Greenwood at melbourne.co.uk (Rob Greenwood) Date: Thu, 19 May 2011 14:08:18 +0000 Subject: Unicorn preload_app and upstart Message-ID: ?Hi, I was wondering if anyone has managed to get the preload_app and SIGUSR2 combination working well with upstart? My issue currently is that when I perform a SIGUSR2 against the master, check everything's working and close off the old master, upstart then attempts to restart it because the original PID/binary are no longer running. What is the correct way of handling this? In my opinion, should unicorn not always be using the same master process and just spawning additional children/cycling them? Else the above functionality will never work with upstart, which will be replacing init. Thanks, Rob Rob Greenwood You'll love cloud hosting with Serverlove! Find out more at http://www.serverlove.com Phone us 0161 232 0125 | Email us rob.greenwood at melbourne.co.uk Visit us http://www.melbourne.co.uk | Follow us http://twitter.com/melbournehost Office Address | Turing House, Archway, Manchester, M15 5RL Melbourne Server Hosting Ltd Registered in England and Wales, Company Number 4091836. Please don?t print this email unless necessary. Our Environmental and Ethical Policy can be found at: http://www.melbourne.co.uk/env From normalperson at yhbt.net Thu May 19 14:35:34 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 19 May 2011 18:35:34 +0000 Subject: Unicorn preload_app and upstart In-Reply-To: References: Message-ID: <20110519183534.GA6075@dcvr.yhbt.net> Rob Greenwood wrote: > Hi, > > I was wondering if anyone has managed to get the preload_app and SIGUSR2 > combination working well with upstart? > > My issue currently is that when I perform a SIGUSR2 against the master, > check everything's working and close off the old master, upstart then > attempts to restart it because the original PID/binary are no longer > running. I guess upstart is similar to daemontools in this respect? I posted a potentially working script to wrap unicorn and preserve the same pid with daemon tools in this thread: http://thread.gmane.org/gmane.comp.lang.ruby.unicorn.general/917 http://mid.gmane.org/20110425183458.GA5826%40dcvr.yhbt.net > What is the correct way of handling this? In my opinion, should unicorn > not always be using the same master process and just spawning additional > children/cycling them? Else the above functionality will never work with > upstart, which will be replacing init. USR2 needs to be able to load a new Ruby executable and the only way is to replace the master. And for "preload_app true" to work, Unicorn itself has to manage processes. If you teach upstart/daemontools to bind listeners, you can have them export a comma-separated list of listener file descriptors in the UNICORN_FD environment (e.g. UNICORN_FD=3,4) and use QUIT + restart in upstart/daemontools and avoid using USR2 entirely. Unicorn itself still has to be given the listen directives in its own config file otherwise it'll close them (because it assumes the user no longer wants them on upgrade) and also to change socket options if there are any. You'll still get transparent restarts because the listeners will be owned by daemontools/upstart and the queued listeners will be held there. Unicorn doesn't need to be used with upstart/daemontools, the master process should be just as robust as them. The only possible issue is during HUP/USR2 where a bad upgrade has an (unlikely) chance of killing the master, but if you're issuing HUP/USR2, you're paying attention to the machine anyways. If you want auto-startup, consider having a startup task in the @reboot line in a crontab. You can even put it in a regular user's crontab to avoid needing to switch users. Everything about the Unicorn process model with upstart/daemontools applies to nginx upgrades, too. -- Eric Wong From jason at lookbook.nu Thu May 19 16:26:38 2011 From: jason at lookbook.nu (Jason Su) Date: Thu, 19 May 2011 13:26:38 -0700 Subject: unicorn doesn't restart properly after cap deploy (not using Bundler) In-Reply-To: <20110519092759.GA727@dcvr.yhbt.net> References: <20110519092759.GA727@dcvr.yhbt.net> Message-ID: You were right, the socket was not in a shared path... D'oh! Thanks so much~ On Thu, May 19, 2011 at 2:27 AM, Eric Wong wrote: > Jason Su wrote: >> Hey guys, >> >> I'm sending USR2 to unicorn after cap deploy, and the old master is >> getting replaced by a new master that doesn't work. > > Can you expand on "doesn't work"? > >> Here are some similar threads I found ... >> http://rubyforge.org/pipermail/mongrel-unicorn/2010-October/000733.html >> http://rubyforge.org/pipermail/mongrel-unicorn/2010-October/000717.html >> >> I'm not using Bundler, and I have working_directory set in my unicorn config: > > I don't see where you have working_directory set below > >> Unicorn::HttpServer::START_CTX[0] = >> "/opt/ruby-enterprise-1.8.7-2010.02/bin/unicorn_rails" > > You shouldn't need to touch START_CTX unless you're switching Ruby > installations. ?It's rope to hang yourself with. > > I would simplify the config file as much as possible if you're > debugging a problem. > >> pid "/var/www/lookbook/shared/pids/unicorn.pid" >> stderr_path "/var/www/lookbook/shared/log/unicorn.stderr.log" >> stdout_path "/var/www/lookbook/shared/log/unicorn.stdout.log" >> preload_app true >> if GC.respond_to?(:copy_on_write_friendly=) >> ? GC.copy_on_write_friendly = true >> end >> before_fork do |server, worker| >> ? STDERR.puts "BEFORE FORK:" >> ? STDERR.puts ENV.inspect >> ? defined?(ActiveRecord::Base) and >> ? ? ActiveRecord::Base.connection.disconnect! > > The auto-killing old workers bit is fragile and you shouldn't need > it unless you're very low on memory. > >> ? if old_pid != server.pid >> ? ? begin >> ? ? ? sig = (worker.nr?+ 1) >= server.worker_processes ? :QUIT : :TTOU >> ? ? ? Process.kill(sig, File.read(old_pid).to_i) >> ? ? rescue Errno::ENOENT, Errno::ESRCH >> ? ? end >> ? end >> >> end >> after_fork do |server, worker| >> ? STDERR.puts "AFTER FORK:" >> ? STDERR.puts ENV.inspect >> >> ? defined?(ActiveRecord::Base) and >> ? ? ActiveRecord::Base.establish_connection >> ? begin > > If you want to use user switching, the "user" directive which > appeared a while back is much simpler and less error prone. > >> ? ? uid, gid = Process.euid, Process.egid >> ? ? user, group = 'apache', 'apache' >> ? ? target_uid = Etc.getpwnam(user).uid >> ? ? target_gid = Etc.getgrnam(group).gid >> ? ? worker.tmp.chown(target_uid, target_gid) >> ? ? if uid != target_uid || gid != target_gid >> ? ? ? Process.initgroups(user, target_gid) >> ? ? ? Process::GID.change_privilege(target_gid) >> ? ? ? Process::UID.change_privilege(target_uid) >> ? ? end > > > >> Below is the output from unicorn.stderr.log.. I'm not sure if >> UNICORN_FD has something to do with it? > > UNICORN_FD is absolutely for the old master tells the new master about > the listener sockets to inherit. ?Don't touch it. > > > >> 3) cap deploy with symlinks + restart unicorn (kill -USR2) > > > >> addr=/var/www/lookbook/current/tmp/sockets/unicorn.sock fd=3 > > You should make sure your socket is in a shared path, not current. > > Whatever's in current gets replaced by Capistrano, right? ?I'm not sure > if tmp is a symlink that's relinked on a new deploy, but there could be > a race condition where the path to the socket is unreachable and > nginx can't see it. > > -- > Eric Wong > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > From normalperson at yhbt.net Fri May 20 23:05:50 2011 From: normalperson at yhbt.net (Eric Wong) Date: Fri, 20 May 2011 20:05:50 -0700 Subject: leading/trailing linear whitespace in headers Message-ID: <20110521030550.GA20008@dcvr.yhbt.net> I thought I posted this here, but apparently not :x There's an bug in how we preserve trailing whitespace in headers that'll be fixed in the next release (probably 3.7.0 next week). This may break some applications that rely on the current buggy behavior, but I haven't heard of it and I'm a bit surprised I'm the first one to notice it after all this time. My original post to the mongrel-development mailing list is here: http://mid.gmane.org/20110518211349.GA677 at dcvr.yhbt.net -- Eric Wong From lawrence.pit at gmail.com Sat May 21 01:14:11 2011 From: lawrence.pit at gmail.com (Lawrence Pit) Date: Sat, 21 May 2011 15:14:11 +1000 Subject: leading/trailing linear whitespace in headers In-Reply-To: <20110521030550.GA20008@dcvr.yhbt.net> References: <20110521030550.GA20008@dcvr.yhbt.net> Message-ID: <4DD74A23.5060309@gmail.com> Hi Eric, Since I upgraded from unicorn 1 to 3, Unicorn will freeze for 60 seconds at random moments, and then restart. Only on my dev machine. Not in 1 project, but in all my projects that use unicorn. I get no log output, it just freezes for 60 seconds. Strangely this happens significantly more often with using Chrome as a client than with Firefox. So I hope this will fix that, though I have no idea if it's related in any way. I was thinking it may also have to do with unicorn not officially supporting Mac OS X. Cheers, Lawrence > I thought I posted this here, but apparently not :x > > There's an bug in how we preserve trailing whitespace in headers > that'll be fixed in the next release (probably 3.7.0 next week). > > This may break some applications that rely on the current buggy > behavior, but I haven't heard of it and I'm a bit surprised I'm the > first one to notice it after all this time. > > My original post to the mongrel-development mailing list is here: > > http://mid.gmane.org/20110518211349.GA677 at dcvr.yhbt.net > From normalperson at yhbt.net Sat May 21 01:57:19 2011 From: normalperson at yhbt.net (Eric Wong) Date: Sat, 21 May 2011 05:57:19 +0000 Subject: leading/trailing linear whitespace in headers In-Reply-To: <4DD74A23.5060309@gmail.com> References: <20110521030550.GA20008@dcvr.yhbt.net> <4DD74A23.5060309@gmail.com> Message-ID: <20110521055719.GA29110@dcvr.yhbt.net> Lawrence Pit wrote: > Hi Eric, > > Since I upgraded from unicorn 1 to 3, Unicorn will freeze for 60 > seconds at random moments, and then restart. Only on my dev machine. > Not in 1 project, but in all my projects that use unicorn. I get no > log output, it just freezes for 60 seconds. Strangely this happens > significantly more often with using Chrome as a client than with > Firefox. Even through nginx? Which Ruby version is it? The bug I'm referring to in this thread is only for /request/ headers, and I don't think any common HTTP clients send trailing whitespace. > So I hope this will fix that, though I have no idea if it's related > in any way. I was thinking it may also have to do with unicorn not > officially supporting Mac OS X. I'm sure you're not the only OS X Unicorn user, perhaps somebody else knows what's going on... If it's kgio-related, but I think Jeremy fixed all the issues under OpenBSD with kgio 2.4.0 and some of that probably helped other *BSD-based systems. I've been meaning to setup a VM on FreeBSD again but haven't had the time. -- Eric Wong From normalperson at yhbt.net Mon May 23 14:37:04 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 23 May 2011 18:37:04 +0000 Subject: [PATCH] doc: add Links page to help folks find relevant info Message-ID: <20110523183704.GA8363@dcvr.yhbt.net> Older announcements on our mailing list could be harder to find. --- I just pushed this out to unicorn.git and http://unicorn.bogomips.org/Links.html If there are any other project announcements I missed here, please let us know, thanks! .document | 1 + Links | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 Links diff --git a/.document b/.document index 317e36b..8c7b7cb 100644 --- a/.document +++ b/.document @@ -17,3 +17,4 @@ unicorn_1 unicorn_rails_1 ISSUES Sandbox +Links diff --git a/Links b/Links new file mode 100644 index 0000000..e7f5e60 --- /dev/null +++ b/Links @@ -0,0 +1,53 @@ += Related Projects + +If you're interested in \Unicorn, you may be interested in some of the projects +listed below. If you have any links to add/change/remove, please tell us at +mailto:mongrel-unicorn at rubyforge.org! + +== Disclaimer + +The \Unicorn project is not responsible for the content in these links. +Furthermore, the \Unicorn project has never, does not and will never endorse: + +* any for-profit entities or services +* any non-{Free Software}[http://www.gnu.org/philosophy/free-sw.html] + +The existence of these links does not imply endorsement of any entities +or services behind them. + +=== For use with \Unicorn + +* {Bluepill}[https://github.com/arya/bluepill] - + a simple process monitoring tool written in Ruby + +* {golden_brindle}[https://github.com/simonoff/golden_brindle] - tool to + manage multiple \Unicorn instances/applications on a single server + +* {raindrops}[http://raindrops.bogomips.org/] - real-time stats for + preforking Rack servers + +=== \Unicorn is written to work with + +* {Rack}[http://rack.rubyforge.org/] - a minimal interface between webservers + supporting Ruby and Ruby frameworks + +* {Ruby}[http://ruby-lang.org/] - the programming language of Rack and \Unicorn + +* {nginx}[http://nginx.org/] - the reverse proxy for use with \Unicorn + +* {kgio}[http://bogomips.org/kgio/] - the I/O library written for \Unicorn + +=== Derivatives + +* {Green Unicorn}[http://gunicorn.org/] - a Python version of \Unicorn + +* {Rainbows!}[http://rainbows.rubyforge.org/] - \Unicorn for sleepy + apps and slow clients. + +=== Prior Work + +* {Mongrel}[http://mongrel.rubyforge.org/] - the awesome webserver \Unicorn is + based on + +* {david}[http://bogomips.org/david.git] - a tool to explain why you need + nginx in front of \Unicorn -- Eric Wong From lawrence.pit at gmail.com Fri May 27 03:32:52 2011 From: lawrence.pit at gmail.com (Lawrence Pit) Date: Fri, 27 May 2011 17:32:52 +1000 Subject: leading/trailing linear whitespace in headers In-Reply-To: <20110521055719.GA29110@dcvr.yhbt.net> References: <20110521030550.GA20008@dcvr.yhbt.net> <4DD74A23.5060309@gmail.com> <20110521055719.GA29110@dcvr.yhbt.net> Message-ID: <4DDF53A4.6090107@gmail.com> Hi Eric, I thought I'll wait a few days before replying just to make sure: believe it or not, since I upgraded 4 days ago to kgio 2.4.1 not once did I run into this issue. While before that unicorn would timeout at least once every hour, sometimes a dozen times in a row. I don't run through nginx on my dev machine, just straight into unicorn_rails using mostly Chrome 11 and FF 4. I use: ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02 Cheers, Lawrence > Hi Eric, >> Since I upgraded from unicorn 1 to 3, Unicorn will freeze for 60 >> seconds at random moments, and then restart. Only on my dev machine. >> Not in 1 project, but in all my projects that use unicorn. I get no >> log output, it just freezes for 60 seconds. Strangely this happens >> significantly more often with using Chrome as a client than with >> Firefox. > Even through nginx? Which Ruby version is it? > > The bug I'm referring to in this thread is only for /request/ headers, > and I don't think any common HTTP clients send trailing whitespace. > >> So I hope this will fix that, though I have no idea if it's related >> in any way. I was thinking it may also have to do with unicorn not >> officially supporting Mac OS X. > I'm sure you're not the only OS X Unicorn user, perhaps somebody else > knows what's going on... > > If it's kgio-related, but I think Jeremy fixed all the issues under > OpenBSD with kgio 2.4.0 and some of that probably helped other > *BSD-based systems. I've been meaning to setup a VM on FreeBSD > again but haven't had the time. > From lawrence.pit at gmail.com Mon May 30 03:02:50 2011 From: lawrence.pit at gmail.com (Lawrence Pit) Date: Mon, 30 May 2011 17:02:50 +1000 Subject: leading/trailing linear whitespace in headers In-Reply-To: <4DDF53A4.6090107@gmail.com> References: <20110521030550.GA20008@dcvr.yhbt.net> <4DD74A23.5060309@gmail.com> <20110521055719.GA29110@dcvr.yhbt.net> <4DDF53A4.6090107@gmail.com> Message-ID: <4DE3411A.7060009@gmail.com> Cheered too early after all, just got one again: E, [2011-05-30T16:59:36.005000 #7351] ERROR -- : worker=0 PID:7352 timeout (60.004931s > 60s), killing E, [2011-05-30T16:59:36.058276 #7351] ERROR -- : reaped # worker=0 I, [2011-05-30T16:59:36.059122 #7351] INFO -- : worker=0 spawning... I, [2011-05-30T16:59:36.062990 #8505] INFO -- : worker=0 spawned pid=8505 I, [2011-05-30T16:59:36.063395 #8505] INFO -- : Refreshing Gem list => ruby 1.8.7 (i686-darwin10.4.0) [2010-04-19] Ruby Enterprise Edition worker=0 ready Cheers, Lawrence > Hi Eric, > > I thought I'll wait a few days before replying just to make sure: > believe it or not, since I upgraded 4 days ago to kgio 2.4.1 not once > did I run into this issue. While before that unicorn would timeout at > least once every hour, sometimes a dozen times in a row. > > I don't run through nginx on my dev machine, just straight into > unicorn_rails using mostly Chrome 11 and FF 4. I use: > > ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI > 0x6770, Ruby Enterprise Edition 2010.02 > > > > Cheers, > Lawrence > >> Hi Eric, >>> Since I upgraded from unicorn 1 to 3, Unicorn will freeze for 60 >>> seconds at random moments, and then restart. Only on my dev machine. >>> Not in 1 project, but in all my projects that use unicorn. I get no >>> log output, it just freezes for 60 seconds. Strangely this happens >>> significantly more often with using Chrome as a client than with >>> Firefox. >> Even through nginx? Which Ruby version is it? >> >> The bug I'm referring to in this thread is only for /request/ headers, >> and I don't think any common HTTP clients send trailing whitespace. >> >>> So I hope this will fix that, though I have no idea if it's related >>> in any way. I was thinking it may also have to do with unicorn not >>> officially supporting Mac OS X. >> I'm sure you're not the only OS X Unicorn user, perhaps somebody else >> knows what's going on... >> >> If it's kgio-related, but I think Jeremy fixed all the issues under >> OpenBSD with kgio 2.4.0 and some of that probably helped other >> *BSD-based systems. I've been meaning to setup a VM on FreeBSD >> again but haven't had the time. >> > From normalperson at yhbt.net Tue May 31 00:49:43 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 31 May 2011 04:49:43 +0000 Subject: leading/trailing linear whitespace in headers In-Reply-To: <4DE3411A.7060009@gmail.com> References: <20110521030550.GA20008@dcvr.yhbt.net> <4DD74A23.5060309@gmail.com> <20110521055719.GA29110@dcvr.yhbt.net> <4DDF53A4.6090107@gmail.com> <4DE3411A.7060009@gmail.com> Message-ID: <20110531044943.GB12780@dcvr.yhbt.net> Lawrence Pit wrote: > Cheered too early after all, just got one again: Can you ever reproduce this with nginx in front? Does anybody else on any *BSD platform get this? Btw, please don't waste my bandwidth top posting, I'd rather people not quote at all than top post, thanks! -- Eric Wong From nate at pivotallabs.com Tue May 31 05:02:12 2011 From: nate at pivotallabs.com (Nate Clark) Date: Tue, 31 May 2011 17:02:12 +0800 Subject: workers not utilizing multiple CPUs Message-ID: We're using Unicorn to serve a Rails app on a few app servers built on Amazon EC2 instances. Each of the xlarge EC2 instances have the equivalent of 8 CPUs, but it seems like our Unicorn master and 8 workers are only utilizing the first CPU. We've been watching the CPU graphs from collectd data when the website is under load, and only cpu-0 shows any activity ... the others seem to be idle, or minimally used by other services. I had assumed that the OS would automatically allocate the Unicorn worker processes to use multiple CPUs, but now I'm not sure. I couldn't find anything about this in the Unicorn docs (except for the mention of the worker_processes configuration, which seems to imply that multiple CPUs would be used). Is there something that I'm not doing? Our EC2 instances are running Ubuntu 10.04 LTS with Linux kernel 2.6.32. Thanks in advance for any insights or suggestions. Nate Clark Pivotal Labs Singapore From deepfryed at gmail.com Tue May 31 08:02:28 2011 From: deepfryed at gmail.com (Bharanee Rathna) Date: Tue, 31 May 2011 22:02:28 +1000 Subject: unicorn stuck in sched_yield after ERESTARTNOHAND In-Reply-To: References: Message-ID: Hi, I'm encountering a weird error where the unicorn workers are stuck in a loop after hitting a 500 on the backend sinatra app. strace at the point where it starts to go into a loop of death select(7, [4 5], NULL, [3 6], {30, 0}) ?= 1 (in [5], left {27, 274382}) fchmod(8, 01) ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 fcntl(5, F_GETFL) ? ? ? ? ? ? ? ? ? ? ? = 0x802 (flags O_RDWR|O_NONBLOCK) accept4(5, {sa_family=AF_INET, sin_port=htons(56728), sin_addr=inet_addr("10.1.1.4")}, [16], SOCK_CLOEXEC) = 12 recvfrom(12, 0x1c99fb0, 16384, 64, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) select(13, [12], NULL, NULL, NULL) ? ? ?= ? ERESTARTNOHAND (To be restarted) --- SIGINT (Interrupt) @ 0 (0) --- rt_sigreturn(0x2) ? ? ? ? ? ? ? ? ? ? ? = -1 EINTR (Interrupted system call) sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 Longer ?strace outputs can be found over at https://gist.github.com/fe4e3172994e5de21317 I close any open db connections in before_fork and reopen connections in after_fork. A bit of research suggests that rb_thread_wait has issues when the select receives?ERESTARTNOHAND,?any ideas as to why this might be happening ? I'm running $ uname -a Linux bbox 2.6.38-02063806-generic #201105121509 SMP Thu May 12 15:14:14 UTC 2011 x86_64 GNU/Linux $ ruby -v ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux] Thanks From lawrence.pit at gmail.com Tue May 31 08:10:35 2011 From: lawrence.pit at gmail.com (Lawrence Pit) Date: Tue, 31 May 2011 22:10:35 +1000 Subject: workers not utilizing multiple CPUs In-Reply-To: References: Message-ID: <4DE4DABB.3070503@gmail.com> Hi Nate, > We've been watching the CPU > graphs from collectd data when the website is under load, and only > cpu-0 shows any activity ... the others seem to be idle, or minimally > used by other services. I don't think you can rely on the numbers collectd (nor top) gives you when measuring from within the hypervisor powering your EC2 instance. The only reliable source of CPU utilization is Cloudwatch, as that measures outside your instances. I've used an array of xlarge instances myself, each running 17 unicorn workers serving a rails app, consuming 4GB, leaving 3GB, no swap. Worked well for us under high load. It couldn't have handled that if all 17 unicorn workers would've been served by 1 of those 8 virtual cores. Cheers, Lawrence From nate at pivotallabs.com Tue May 31 08:20:14 2011 From: nate at pivotallabs.com (Nate Clark) Date: Tue, 31 May 2011 20:20:14 +0800 Subject: workers not utilizing multiple CPUs In-Reply-To: <4DE4DABB.3070503@gmail.com> References: <4DE4DABB.3070503@gmail.com> Message-ID: Lawrence, I've suspected that it may be a monitoring problem and not a Unicorn problem, but I'm not yet convinced either way. Our monitoring via collectd is done through Rightscale. They have a lot of experience with EC2, so I'd assume that it is monitoring properly. Also, our other services (mysql, for example) are showing activity on multiple cores under load, so that leads me to believe that the monitoring is working in at least some cases. I wasn't aware of the Cloudwatch service until now, that looks interesting ... I'll check it out. Anyone else experience a problem like this? Nate On Tue, May 31, 2011 at 8:10 PM, Lawrence Pit wrote: > Hi Nate, >> >> We've been watching the CPU >> graphs from collectd data when the website is under load, and only >> cpu-0 shows any activity ... the others seem to be idle, or minimally >> used by other services. > > I don't think you can rely on the numbers collectd (nor top) gives you when > measuring from within the hypervisor powering your EC2 instance. The only > reliable source of CPU utilization is Cloudwatch, as that measures outside > your instances. > > I've used an array of xlarge instances myself, each running 17 unicorn > workers serving a rails app, consuming 4GB, leaving 3GB, no swap. Worked > well for us under high load. It couldn't have handled that if all 17 unicorn > workers would've been served by 1 of those 8 virtual cores. > > > Cheers, > Lawrence > > From cliftonk at gmail.com Tue May 31 10:07:01 2011 From: cliftonk at gmail.com (Clifton King) Date: Tue, 31 May 2011 09:07:01 -0500 Subject: workers not utilizing multiple CPUs In-Reply-To: References: <4DE4DABB.3070503@gmail.com> Message-ID: <7E16F5B9-2C96-426F-BC75-670BEDD122A9@gmail.com> We experience the same problem. I believe the problem has more to do with the kernel CPU scheduler than anything else. If you figure put a reliable way to spread the load, I'd like to hear it. Clifton King Development clifton at orgsync.com 512-940-7744 Sent from my phone. On May 31, 2011, at 7:20 AM, Nate Clark wrote: > Lawrence, > > I've suspected that it may be a monitoring problem and not a Unicorn > problem, but I'm not yet convinced either way. Our monitoring via > collectd is done through Rightscale. They have a lot of experience > with EC2, so I'd assume that it is monitoring properly. Also, our > other services (mysql, for example) are showing activity on multiple > cores under load, so that leads me to believe that the monitoring is > working in at least some cases. > > I wasn't aware of the Cloudwatch service until now, that looks > interesting ... I'll check it out. > > Anyone else experience a problem like this? > > Nate > > On Tue, May 31, 2011 at 8:10 PM, Lawrence Pit wrote: >> Hi Nate, >>> >>> We've been watching the CPU >>> graphs from collectd data when the website is under load, and only >>> cpu-0 shows any activity ... the others seem to be idle, or minimally >>> used by other services. >> >> I don't think you can rely on the numbers collectd (nor top) gives you when >> measuring from within the hypervisor powering your EC2 instance. The only >> reliable source of CPU utilization is Cloudwatch, as that measures outside >> your instances. >> >> I've used an array of xlarge instances myself, each running 17 unicorn >> workers serving a rails app, consuming 4GB, leaving 3GB, no swap. Worked >> well for us under high load. It couldn't have handled that if all 17 unicorn >> workers would've been served by 1 of those 8 virtual cores. >> >> >> Cheers, >> Lawrence >> >> > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying From normalperson at yhbt.net Tue May 31 11:17:37 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 31 May 2011 08:17:37 -0700 Subject: unicorn stuck in sched_yield after ERESTARTNOHAND In-Reply-To: References: Message-ID: <20110531151737.GA10313@dcvr.yhbt.net> Bharanee Rathna wrote: > A bit of research suggestsi that rb_thread_wait has > issues when the select receives?ERESTARTNOHAND,?any ideas as to why > this might be happening ? Not sure, could be a bug in Ruby itself, kernel, or glibc. I've seen similar reports of this in the past outside of Unicorn but don't recall ever finding a satisfactory explanation. > I'm running > > $ uname -a > Linux bbox 2.6.38-02063806-generic #201105121509 SMP Thu May 12 > 15:14:14 UTC 2011 x86_64 GNU/Linux > > $ ruby -v > ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux] Can you try 1.9.2-p180 or Ruby trunk? Or maybe a different version of glibc, too. Do you have any non-standard kernel patches/scheduler configs? -- Eric Wong From normalperson at yhbt.net Tue May 31 11:27:02 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 31 May 2011 08:27:02 -0700 Subject: workers not utilizing multiple CPUs In-Reply-To: References: Message-ID: <20110531152702.GB10313@dcvr.yhbt.net> Nate Clark wrote: > We're using Unicorn to serve a Rails app on a few app servers built on > Amazon EC2 instances. Each of the xlarge EC2 instances have the > equivalent of 8 CPUs, but it seems like our Unicorn master and 8 > workers are only utilizing the first CPU. We've been watching the CPU > graphs from collectd data when the website is under load, and only > cpu-0 shows any activity ... the others seem to be idle, or minimally > used by other services. What is your request rate and average response time for the application? If requests come in more quickly than one worker can respond, /then/ the kernel may start using more workers. However, it looks like your application is just responding faster and can keep up with requests coming in. > I had assumed that the OS would automatically allocate the Unicorn > worker processes to use multiple CPUs, but now I'm not sure. The kernel does all the work for balancing. -- Eric Wong From normalperson at yhbt.net Tue May 31 11:48:03 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 31 May 2011 08:48:03 -0700 Subject: workers not utilizing multiple CPUs In-Reply-To: <7E16F5B9-2C96-426F-BC75-670BEDD122A9@gmail.com> References: <4DE4DABB.3070503@gmail.com> <7E16F5B9-2C96-426F-BC75-670BEDD122A9@gmail.com> Message-ID: <20110531154803.GC10313@dcvr.yhbt.net> Clifton King wrote: > We experience the same problem. I believe the problem has more to do > with the kernel CPU scheduler than anything else. If you figure put a > reliable way to spread the load, I'd like to hear it. Load not being spread is /not/ a problem unless there are requests that get stuck in the listen queue. If no requests are actually stuck in the queue (light load), the kernel is right to put requests into the most recently used worker since it can get better CPU cache behavior this way. == The real problem Under high loads (many cores, fast responses), Unicorn currently uses more resources because of non-blocking accept() + select(). This isn't a noticeable problem for most machines (1-16 cores). Future versions of Unicorn may take advantage of /blocking/ accept() optimizations under Linux. Rainbows! already lets you take advantage of this behavior if you meet the following requirements: * Ruby 1.9.x under Linux * only one listen socket (if worker_connections == 1 under Rainbows!) * use ThreadPool|XEpollThreadPool|XEpollThreadSpawn|XEpoll I haven't had a chance to benchmark any of this on very big machines so I have no idea how well it actually works compared to Unicorn, only how well it works in theory :) Blocking accept() under Ruby 1.9.x + Linux should distribute load evenly across workers in all situations, even in the non-busy cases where load distribution doesn't matter (your case :). [1] - http://rainbows.rubyforge.org/Rainbows/XEpollThreadPool.html -- Eric Wong From cliftonk at gmail.com Tue May 31 11:55:01 2011 From: cliftonk at gmail.com (Clifton King) Date: Tue, 31 May 2011 10:55:01 -0500 Subject: workers not utilizing multiple CPUs In-Reply-To: <20110531154803.GC10313@dcvr.yhbt.net> References: <4DE4DABB.3070503@gmail.com> <7E16F5B9-2C96-426F-BC75-670BEDD122A9@gmail.com> <20110531154803.GC10313@dcvr.yhbt.net> Message-ID: Thanks Eric, I had expected that to be the case (we are under light load as of now). On Tue, May 31, 2011 at 10:48 AM, Eric Wong wrote: > Clifton King wrote: >> We experience the same problem. I believe the problem has more to do >> with the kernel CPU scheduler than anything else. If you figure put a >> reliable way to spread the load, I'd like to hear it. > > Load not being spread is /not/ a problem unless there are requests that > get stuck in the listen queue. > > If no requests are actually stuck in the queue (light load), the kernel > is right to put requests into the most recently used worker since it can > get better CPU cache behavior this way. > > > == The real problem > > Under high loads (many cores, fast responses), Unicorn currently uses > more resources because of non-blocking accept() + select(). ?This isn't > a noticeable problem for most machines (1-16 cores). > > Future versions of Unicorn may take advantage of /blocking/ accept() > optimizations under Linux. ?Rainbows! already lets you take advantage > of this behavior if you meet the following requirements: > > * Ruby 1.9.x under Linux > * only one listen socket (if worker_connections == 1 under Rainbows!) > * use ThreadPool|XEpollThreadPool|XEpollThreadSpawn|XEpoll > > I haven't had a chance to benchmark any of this on very big machines so > I have no idea how well it actually works compared to Unicorn, only how > well it works in theory :) > > > Blocking accept() under Ruby 1.9.x + Linux should distribute load evenly > across workers in all situations, even in the non-busy cases where load > distribution doesn't matter (your case :). > > [1] - http://rainbows.rubyforge.org/Rainbows/XEpollThreadPool.html > > -- > Eric Wong > _______________________________________________ > Unicorn mailing list - mongrel-unicorn at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-unicorn > Do not quote signatures (like this one) or top post when replying > From deepfryed at gmail.com Tue May 31 18:28:41 2011 From: deepfryed at gmail.com (Bharanee Rathna) Date: Wed, 1 Jun 2011 08:28:41 +1000 Subject: unicorn stuck in sched_yield after ERESTARTNOHAND In-Reply-To: <20110531151737.GA10313@dcvr.yhbt.net> References: <20110531151737.GA10313@dcvr.yhbt.net> Message-ID: > Can you try 1.9.2-p180 or Ruby trunk? ?Or maybe a different version of > glibc, too. upgraded libc6 & ruby and was able to replicate it under libc6 2.12.1-0ubuntu10.2 $ ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux] >?Do you have any non-standard kernel patches/scheduler > configs? No From normalperson at yhbt.net Tue May 31 19:48:29 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 31 May 2011 23:48:29 +0000 Subject: unicorn stuck in sched_yield after ERESTARTNOHAND In-Reply-To: References: Message-ID: <20110531234829.GA9815@dcvr.yhbt.net> Bharanee Rathna wrote: > I'm encountering a weird error where the unicorn workers are stuck in > a loop after hitting a 500 on the backend sinatra app. Also, what extensions are you using in your app? > strace at the point where it starts to go into a loop of death > select(7, [4 5], NULL, [3 6], {30, 0}) ?= 1 (in [5], left {27, 274382}) > fchmod(8, 01) ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 > fcntl(5, F_GETFL) ? ? ? ? ? ? ? ? ? ? ? = 0x802 (flags O_RDWR|O_NONBLOCK) > accept4(5, {sa_family=AF_INET, sin_port=htons(56728), > sin_addr=inet_addr("10.1.1.4")}, [16], SOCK_CLOEXEC) = 12 > recvfrom(12, 0x1c99fb0, 16384, 64, 0, 0) = -1 EAGAIN (Resource > temporarily unavailable) (I'm somewhat more awake, now, haven't been sleeping much) Two things look off in the line above: 1) recvfrom() isn't using the MSG_DONTWAIT flag. I know you're using Linux, so kgio should be using MSG_DONTWAIT to do non-blocking recv... Which versions of unicorn/kgio are you using? 2) TCP_DEFER_ACCEPT should prevent recvfrom() from hitting EAGAIN in the common case under Linux. > select(13, [12], NULL, NULL, NULL) ? ? ?= ? ERESTARTNOHAND (To be restarted) > --- SIGINT (Interrupt) @ 0 (0) --- > rt_sigreturn(0x2) ? ? ? ? ? ? ? ? ? ? ? = -1 EINTR (Interrupted system call) What triggered SIGINT? > sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 > sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 > sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 > sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 > sched_yield() ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 > > Longer ?strace outputs can be found over at > https://gist.github.com/fe4e3172994e5de21317 Actually, after many lines of sched_yield() in your gist, I can see it does actually exit the process. Did you kill it with SIGINT? If so, I see nothing wrong... Ruby 1.9 seems to sched_yield a lot during shutdown, but it does eventually finish. -- Eric Wong From deepfryed at gmail.com Tue May 31 20:31:22 2011 From: deepfryed at gmail.com (Bharanee Rathna) Date: Wed, 1 Jun 2011 10:31:22 +1000 Subject: unicorn stuck in sched_yield after ERESTARTNOHAND In-Reply-To: <20110531234829.GA9815@dcvr.yhbt.net> References: <20110531234829.GA9815@dcvr.yhbt.net> Message-ID: thanks for the quick response eric, On Wed, Jun 1, 2011 at 9:48 AM, Eric Wong wrote: > Bharanee Rathna wrote: >> I'm encountering a weird error where the unicorn workers are stuck in >> a loop after hitting a 500 on the backend sinatra app. > > Also, what extensions are you using in your app? heaps of em. yajl, swift, rmagick, fastcaptcha, flock, nokogiri & curb. except swift and curb none of the others would be touching the network. >> strace at the point where it starts to go into a loop of death > >> select(7, [4 5], NULL, [3 6], {30, 0}) ?= 1 (in [5], left {27, 274382}) >> fchmod(8, 01) ? ? ? ? ? ? ? ? ? ? ? ? ? = 0 >> fcntl(5, F_GETFL) ? ? ? ? ? ? ? ? ? ? ? = 0x802 (flags O_RDWR|O_NONBLOCK) >> accept4(5, {sa_family=AF_INET, sin_port=htons(56728), >> sin_addr=inet_addr("10.1.1.4")}, [16], SOCK_CLOEXEC) = 12 >> recvfrom(12, 0x1c99fb0, 16384, 64, 0, 0) = -1 EAGAIN (Resource >> temporarily unavailable) > > (I'm somewhat more awake, now, haven't been sleeping much) > > Two things look off in the line above: > > 1) recvfrom() isn't using the MSG_DONTWAIT flag. ?I know you're using > ? Linux, so kgio should be using MSG_DONTWAIT to do non-blocking > ? recv... ?Which versions of unicorn/kgio are you using? using kgio 2.3.2, i'll upgrade it and give it another try > > 2) TCP_DEFER_ACCEPT should prevent recvfrom() from hitting EAGAIN > ? in the common case under Linux. > >> select(13, [12], NULL, NULL, NULL) ? ? ?= ? ERESTARTNOHAND (To be restarted) >> --- SIGINT (Interrupt) @ 0 (0) --- >> rt_sigreturn(0x2) ? ? ? ? ? ? ? ? ? ? ? = -1 EINTR (Interrupted system call) > > What triggered SIGINT? not sure > > Actually, after many lines of sched_yield() in your gist, I can see it > does actually exit the process. ?Did you kill it with SIGINT? ?If so, I > see nothing wrong... yes i killed it after the worker looked stuck and wasn't responding for 30s From deepfryed at gmail.com Tue May 31 20:44:44 2011 From: deepfryed at gmail.com (Bharanee Rathna) Date: Wed, 1 Jun 2011 10:44:44 +1000 Subject: unicorn stuck in sched_yield after ERESTARTNOHAND In-Reply-To: References: <20110531234829.GA9815@dcvr.yhbt.net> Message-ID: >> 1) recvfrom() isn't using the MSG_DONTWAIT flag. ?I know you're using >> ? Linux, so kgio should be using MSG_DONTWAIT to do non-blocking >> ? recv... ?Which versions of unicorn/kgio are you using? > > using kgio 2.3.2, i'll upgrade it and give it another try repeatable with kgio 2.4.1