From list at mrtech.ru Tue Nov 1 06:03:28 2011 From: list at mrtech.ru (Troex Nevelin) Date: Tue, 01 Nov 2011 12:03:28 +0200 Subject: Wanted: OobGC testers on Ruby 1.9.3 In-Reply-To: <20111031222437.GA32156@dcvr.yhbt.net> References: <20111031222437.GA32156@dcvr.yhbt.net> Message-ID: <4EAFC3F0.50804@mrtech.ru> On 01/11/11 00:24, Eric Wong wrote: > Now Ruby 1.9.3-p0 is officially released, I'm (still) curious to know if > OobGC still helps *your* *application(s)* given the new lazy-sweep GC in > Ruby 1.9.3. We are about to deploy heavy loaded application in a few weeks on 1.9.3. Actually this will be upgrade from REE 1.8.7 so I think it will be hard to compare due to a big differences. Is there a way to see "lazy-sweep GC" in action? From cliftonk at gmail.com Tue Nov 1 11:36:11 2011 From: cliftonk at gmail.com (cliftonk at gmail.com) Date: Tue, 1 Nov 2011 10:36:11 -0500 Subject: Wanted: OobGC testers on Ruby 1.9.3 In-Reply-To: <4EAFC3F0.50804@mrtech.ru> References: <20111031222437.GA32156@dcvr.yhbt.net> <4EAFC3F0.50804@mrtech.ru> Message-ID: <55DBD73A-D66E-43A7-B2D2-372AD145E2D2@gmail.com> On Nov 1, 2011, at 5:03 AM, Troex Nevelin wrote: > Is there a way to see "lazy-sweep GC" in action? You can try using Unicorn with and without OobGC enabled. I'm curious to see the results myself. Clifton From fxn at hashref.com Thu Nov 10 05:01:09 2011 From: fxn at hashref.com (Xavier Noria) Date: Thu, 10 Nov 2011 11:01:09 +0100 Subject: help with an init script Message-ID: Hey, I have this pretty standard init script for Unicorn http://pastie.org/2840779 where fxn at cohen:~$ ls -la /etc/init.d/unicorn_home lrwxrwxrwx 1 root root 32 2011-11-09 23:45 /etc/init.d/unicorn_home -> /home/fxn/home/config/unicorn.sh fxn at cohen:~$ ls -la $HOME/.rvm/bin/ruby -rwxrwxr-x 1 fxn sudo 265 2011-11-09 21:44 /home/fxn/.rvm/bin/ruby and $APP_ROOT/bin/unicorn_rails is a binstub created by bundler. The init script works like a charm if I run it with sudo, but for some reason the service is not launched if the machine is rebooted. Do you know what could happen or how could I debug it? dmesg | grep unicorn prints nothing. From normalperson at yhbt.net Thu Nov 10 06:20:14 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 10 Nov 2011 11:20:14 +0000 Subject: help with an init script In-Reply-To: References: Message-ID: <20111110112014.GA23753@dcvr.yhbt.net> Xavier Noria wrote: > Hey, I have this pretty standard init script for Unicorn > > http://pastie.org/2840779 > > where > > fxn at cohen:~$ ls -la /etc/init.d/unicorn_home > lrwxrwxrwx 1 root root 32 2011-11-09 23:45 /etc/init.d/unicorn_home > -> /home/fxn/home/config/unicorn.sh > > fxn at cohen:~$ ls -la $HOME/.rvm/bin/ruby > -rwxrwxr-x 1 fxn sudo 265 2011-11-09 21:44 /home/fxn/.rvm/bin/ruby > > and $APP_ROOT/bin/unicorn_rails is a binstub created by bundler. Is /home mounted later in the boot process than when the unicorn init script fires? unicorn should be one of the last things to start if you're putting it in init. > The init script works like a charm if I run it with sudo, but for some > reason the service is not launched if the machine is rebooted. > > Do you know what could happen or how could I debug it? dmesg | grep > unicorn prints nothing. You could put the following near the top of the init script (after "set -e"): # make sure the directory for this file is something that persists # throughout the boot process (isn't mounted-over by another dir): ERR=/var/tmp/unicorn.init.err rm -f "$ERR" exec 2>> "$ERR" # ... rest of the script All stderr output (before unicorn is started) will then go to whatever you set ERR to. If you got all the way to starting unicorn: does the stderr log of unicorn have anything interesting? (please configure stderr_path if you haven't already) You can also add "set -x" to the init script and things will get very verbose once you set it. Can't think of much else on my sleep-deprived brain... From fxn at hashref.com Thu Nov 10 08:28:27 2011 From: fxn at hashref.com (Xavier Noria) Date: Thu, 10 Nov 2011 14:28:27 +0100 Subject: help with an init script In-Reply-To: <20111110112014.GA23753@dcvr.yhbt.net> References: <20111110112014.GA23753@dcvr.yhbt.net> Message-ID: For the archives: I am sure I am missing something easy here, but anyway since I like to think about the app as something mostly local to the user running under the user's rvm, I launch Unicorn on reboot via the user's crontab: @reboot /home/fxn/home/config/unicorn.sh start That worked out of the box. Thanks Eric! From somers.ben at gmail.com Thu Nov 10 18:07:51 2011 From: somers.ben at gmail.com (Ben Somers) Date: Thu, 10 Nov 2011 15:07:51 -0800 Subject: Virtual Memory Usage Message-ID: Hi, I've been testing unicorn as a replacement for passenger in my company's Rails apps, and generally am very much liking it, and will probably go through with the switch (our deployment times are killing us). I've been running tests on with jmeter against a demo EC2 m1.xlarge running Ubuntu 9.10 (yes, we know it's out od date), with 15GB RAM, 4x2GHz CPU. The server is behaving fine, with most of the unicorn workers sitting at about 280MB resident memory, comparable to passenger's workers. But I've been testing how many workers to run with, and I've noticed that once I get above three workers, a couple of them get ballooning virtual memory, jumping up to a little over 2GB. I initially thought that the server was overloaded and swapping, but swap usage is still 0, and I get this behavior at over 50% free memory. It doesn't seem to be causing performance problems, but I was wondering if anyone else has observed this or similar behavior? I'm trying to decide if it's normal or an item for concern. -ben From normalperson at yhbt.net Thu Nov 10 18:50:35 2011 From: normalperson at yhbt.net (Eric Wong) Date: Thu, 10 Nov 2011 15:50:35 -0800 Subject: Virtual Memory Usage In-Reply-To: References: Message-ID: <20111110235034.GA13543@dcvr.yhbt.net> Ben Somers wrote: > m1.xlarge running Ubuntu 9.10 (yes, we know it's out od date), with > 15GB RAM, 4x2GHz CPU. > > The server is behaving fine, with most of the unicorn workers sitting > at about 280MB resident memory, comparable to passenger's workers. But > I've been testing how many workers to run with, and I've noticed that > once I get above three workers, a couple of them get ballooning > virtual memory, jumping up to a little over 2GB. I initially thought > that the server was overloaded and swapping, but swap usage is still > 0, and I get this behavior at over 50% free memory. It doesn't seem to > be causing performance problems, but I was wondering if anyone else > has observed this or similar behavior? I'm trying to decide if it's > normal or an item for concern. Since you're on Linux, you can run "pmap $PID" to see how chunks of virtual memory are used by any process. If a chunk is backed by a regular file, it hardly matters, the kernel will share that with other processes and won't swap that memory (since it's already backed by a regular file). Big "[ anon ]" chunks you see in pmap output are usually not shared, so potentially more problematic. It depends on your application and the libraries it uses, of course. Some libraries will share anonymous memory between processes (raindrops does this for example, but only for small integer counters). I've seen Unicorn processes using TokyoCabinet and TDB[1] with database files many gigabytes large with large VM sizes to match. I also know both of those database libraries cooperate with the VM subsystem so I had nothing to worry about as far as memory usage goes :) In case you (or somebody else) does notice high RSS and you're using the stock glibc malloc, try setting MALLOC_MMAP_THRESHOLD_=131072 or similar. The author of jemalloc once blogged about this behavior with glibc malloc, the title was "Mr. Malloc gets schooled" or something along those lines. Making the malloc implementation use mmap() more to reduce memory usage may hurt performance, though. I always do incremental processing on large datasets so that helps me avoid issues with unchecked/unpredictable memory growth due to malloc behavior. [1] http://bogomips.org/ruby-tdb/ From somers.ben at gmail.com Fri Nov 11 19:13:36 2011 From: somers.ben at gmail.com (Ben Somers) Date: Fri, 11 Nov 2011 16:13:36 -0800 Subject: Virtual Memory Usage In-Reply-To: <20111110235034.GA13543@dcvr.yhbt.net> References: <20111110235034.GA13543@dcvr.yhbt.net> Message-ID: Thank you! I did some pmapping, and it looks like they are grabbing a big [anon] chunk, but it's shared between all the workers for a given master (both the low- and high-memory workers). Still no swapping. I'll proceed with my live testing (we're going to run just one webserver on unicorn for a few weeks), and see how it goes. -ben On Thu, Nov 10, 2011 at 3:50 PM, Eric Wong wrote: > > Ben Somers wrote: > > m1.xlarge running Ubuntu 9.10 (yes, we know it's out od date), with > > 15GB RAM, 4x2GHz CPU. > > > > The server is behaving fine, with most of the unicorn workers sitting > > at about 280MB resident memory, comparable to passenger's workers. But > > I've been testing how many workers to run with, and I've noticed that > > once I get above three workers, a couple of them get ballooning > > virtual memory, jumping up to a little over 2GB. I initially thought > > that the server was overloaded and swapping, but swap usage is still > > 0, and I get this behavior at over 50% free memory. It doesn't seem to > > be causing performance problems, but I was wondering if anyone else > > has observed this or similar behavior? I'm trying to decide if it's > > normal or an item for concern. > > Since you're on Linux, you can run "pmap $PID" to see how chunks of > virtual memory are used by any process. > > If a chunk is backed by a regular file, it hardly matters, the kernel > will share that with other processes and won't swap that memory (since > it's already backed by a regular file). > > Big "[ anon ]" chunks you see in pmap output are usually not shared, so > potentially more problematic. ?It depends on your application and the > libraries it uses, of course. ?Some libraries will share anonymous > memory between processes (raindrops does this for example, but only for > small integer counters). > > I've seen Unicorn processes using TokyoCabinet and TDB[1] with database > files many gigabytes large with large VM sizes to match. ?I also know > both of those database libraries cooperate with the VM subsystem so I > had nothing to worry about as far as memory usage goes :) > > > > In case you (or somebody else) does notice high RSS and you're using the > stock glibc malloc, try setting MALLOC_MMAP_THRESHOLD_=131072 or > similar. ?The author of jemalloc once blogged about this behavior with > glibc malloc, the title was "Mr. ?Malloc gets schooled" or something > along those lines. ?Making the malloc implementation use mmap() more > to reduce memory usage may hurt performance, though. > > I always do incremental processing on large datasets so that helps > me avoid issues with unchecked/unpredictable memory growth due to > malloc behavior. > > > [1] http://bogomips.org/ruby-tdb/ > _______________________________________________ > 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 jeremyevans0 at gmail.com Mon Nov 14 14:33:06 2011 From: jeremyevans0 at gmail.com (Jeremy Evans) Date: Mon, 14 Nov 2011 20:33:06 +0100 Subject: Fix hang when running tests on OpenBSD by skipping two tests Message-ID: This skips two tests on OpenBSD when cause hangs when running the tests. This is obviously not a permanent fix, but I'm not sure why the tests are hanging, and hanging during a test is bad. I suppose you could also use a timeout, so the test fails instead of hangs. I'll be happy to test other patches to either the test suite or the library code (assuming the hang is fixable on OpenBSD). After this patch, the test suite passes fine on OpenBSD. Jeremy --- test/exec/test_exec.rb.orig Mon Nov 14 18:38:09 2011 +++ test/exec/test_exec.rb Mon Nov 14 18:38:37 2011 @@ -968,7 +968,7 @@ EOF assert_nothing_raised { Process.kill(:QUIT, daemon_pid) } wait_for_death(daemon_pid) end - end + end unless RUBY_PLATFORM =~ /openbsd/i def test_default_listen_upgrade_holds_listener default_listen_lock do @@ -998,7 +998,7 @@ EOF assert_nothing_raised { Process.kill(:QUIT, daemon_pid) } wait_for_death(daemon_pid) end - end + end unless RUBY_PLATFORM =~ /openbsd/i def default_listen_setup File.open("config.ru", "wb") { |fp| fp.syswrite(HI.gsub("HI", '#$$')) } From chengliaswe116guan at yahoo.de Mon Nov 14 12:29:04 2011 From: chengliaswe116guan at yahoo.de (Rick) Date: Tue, 15 Nov 2011 01:29:04 +0800 Subject: =?GB2312?B?RGlnaXRhbCBQaG90byBFZGl0aW5nIFNlcg==?= =?GB2312?B?dmljZXMgLSBQaG90byBDdXRvdXQgU2Vydg==?= =?GB2312?B?aWNl?= Message-ID: You are receiving this email because we wish you to use our digital photo editing services. Digital Photo Editing Services : We are a China based Imaging Professionals. We offer basic and advanced digital photo Editing services and solutions like photo Cutout, morphological photo Editing, photoshop photo Editing, satellite photo Editing, color photo Editing and vector photo Editing using latest techniques. Our strength in providing Editing solutions for digital images like photo masking, photo re-touching, back ground cleaning & cloning, sharpening & restoration of color, all this derive from our vast experience. Our dedicated team of highly skilled and experienced professionals serves the photo Editing requirements of our clients. An in house quality checking mechanism assures value addition and delivers perfect job. Our team can deliver your job overnight or in time bounded fashion irrespective of job size. Our mainly services are: 1. Photo Cutout 2. Photo Enhancement 3. Photo Retouching 4. Vector Conversion 5. Pop Art 6. Images Masking 7. Clipping Path 8. Photo Restoration 9. Web Design Photo Editing Services: Our Photo Editing services includes advanced photo cutouts/clippings, balancing brightness / contrast in an image, repair of minor scratches, creases, minor dust, and spot removal to removal of major scratches, cracks, creases, and stains in all areas. We also repair seriously faded/damaged photographs and make it print ready. Best regards, Rick Rocksanki Imaging Professionals Contact: ibwallace at yeah.net Send address to koremovereick at yeah.net for remove From normalperson at yhbt.net Mon Nov 14 15:54:29 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 14 Nov 2011 12:54:29 -0800 Subject: Fix hang when running tests on OpenBSD by skipping two tests In-Reply-To: References: Message-ID: <20111114205429.GA15731@dcvr.yhbt.net> Jeremy Evans wrote: > This is obviously not a permanent fix, but I'm not sure why the tests > are hanging, and hanging during a test is bad. I suppose you could > also use a timeout, so the test fails instead of hangs. I'll be happy > to test other patches to either the test suite or the library code > (assuming the hang is fixable on OpenBSD). I'd like to investigate why this fails. I've never been entirely happy with test_exec, so this would be a good reason to improve or start porting problematic tests over to the shell-based system under t/ > After this patch, the test suite passes fine on OpenBSD. So everything under t/ (gmake test-integration) works, too? I much prefer shell-based the test suite myself From normalperson at yhbt.net Mon Nov 14 16:56:24 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 14 Nov 2011 13:56:24 -0800 Subject: nginx + unicorn deployment survey Message-ID: <20111114215624.GB22715@dcvr.yhbt.net> Hello all, I'm wondering if you deploy nginx: 1) on the same machine that runs unicorn (exclusively proxying to that) 2) on a different machine that doesn't run unicorn 3) both, nginx could forward to either to localhost or another host on the same LAN And of course, the reason(s) you chose what you chose. I'm inclined to believe many folks are on 1) simply because they only have one machine. Thanks in advance for your replies, I'm always interested in hearing user experiences with unicorn. From jeremyevans0 at gmail.com Mon Nov 14 18:46:31 2011 From: jeremyevans0 at gmail.com (Jeremy Evans) Date: Tue, 15 Nov 2011 00:46:31 +0100 Subject: Fix hang when running tests on OpenBSD by skipping two tests In-Reply-To: <20111114205429.GA15731@dcvr.yhbt.net> References: <20111114205429.GA15731@dcvr.yhbt.net> Message-ID: On Mon, Nov 14, 2011 at 9:54 PM, Eric Wong wrote: > Jeremy Evans wrote: >> This is obviously not a permanent fix, but I'm not sure why the tests >> are hanging, and hanging during a test is bad. ?I suppose you could >> also use a timeout, so the test fails instead of hangs. ?I'll be happy >> to test other patches to either the test suite or the library code >> (assuming the hang is fixable on OpenBSD). > > I'd like to investigate why this fails. Makes sense. Is there something I can do to help debug? > So everything under t/ (gmake test-integration) works, too? > I much prefer shell-based the test suite myself I didn't even know about that test suite till now. :) I started running those tests on OpenBSD. With the way the test suite is currently setup, it's a bit of a pain to debug, as it stops at the first error. So I have to: 1) run the entire test suite 2) wait for it to halt/fail 3) skip the test that halts/fails 4) go to step 1 With some small changes, you can make it through the entire test suite even if there are errors. It would greatly speed up the debugging process, but it does require you read the logged output. See the patch below. With it, I determined the following integration tests hang/fail: ruby 1.8.7 and ruby 1.9.3 integration test failures: t0011-active-unix-socket.sh # fails: not ok 11 - no errors t0100-rack-input-tests.sh # hangs: requires kill to unicorn and kill -9 to sh in the 2nd test ruby 1.9.3 has a couple regular test failures (skipping the two hangs with the earlier patch): : 1) Error: : test_parse_error(HttpParserTest): : RuntimeError: can't set length of shared string : test/unit/test_http_parser.rb:350:in `headers' : test/unit/test_http_parser.rb:350:in `test_parse_error' : 1) Failure: : test_help(ExecTest) [test/exec/test_exec.rb:319]: : <0> expected but was : <158>. Thanks, Jeremy $OpenBSD$ --- GNUmakefile.orig Tue Nov 15 00:12:58 2011 +++ GNUmakefile Tue Nov 15 00:13:32 2011 @@ -124,14 +124,14 @@ run_test = $(quiet_pre) \ %.n: export PATH := $(test_prefix)/bin:$(PATH) %.n: export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS) %.n: $(test_prefix)/.stamp - $(run_test) + -$(run_test) $(T): arg = $@ $(T): t = $(subst .rb,$(log_suffix),$@) $(T): export PATH := $(test_prefix)/bin:$(PATH) $(T): export RUBYLIB := $(test_prefix):$(test_prefix)/lib:$(MYLIBS) $(T): $(test_prefix)/.stamp - $(run_test) + -$(run_test) install: $(bins) $(ext)/unicorn_http.c $(prep_setup_rb) @@ -221,7 +221,7 @@ $(T_r).%.r: export RUBYLIB := $(test_prefix):$(test_pr $(T_r).%.r: export UNICORN_RAILS_TEST_VERSION = $(rv) $(T_r).%.r: export RAILS_GIT_REPO = $(CURDIR)/$(rails_git) $(T_r).%.r: $(test_prefix)/.stamp $(rails_git)/info/v2.2.3-stamp - $(run_test) + -$(run_test) ifneq ($(VERSION),) rfproject := mongrel --- t/GNUmakefile.orig Tue Nov 15 00:12:39 2011 +++ t/GNUmakefile Tue Nov 15 00:12:50 2011 @@ -66,7 +66,7 @@ $(T): export RAKE := $(RAKE) $(T): export PATH := $(test_prefix)/bin:$(PATH) $(T): export RUBYLIB := $(test_prefix)/lib:$(MYLIBS) $(T): dep $(test_prefix)/.stamp trash/.gitignore - $(TRACER) $(SHELL) $(SH_TEST_OPTS) $@ $(TEST_OPTS) + -$(TRACER) $(SHELL) $(SH_TEST_OPTS) $@ $(TEST_OPTS) trash/.gitignore: mkdir -p $(@D) From jason at lookbook.nu Mon Nov 14 21:00:23 2011 From: jason at lookbook.nu (Jason Su) Date: Mon, 14 Nov 2011 18:00:23 -0800 Subject: nginx + unicorn deployment survey In-Reply-To: <20111114215624.GB22715@dcvr.yhbt.net> References: <20111114215624.GB22715@dcvr.yhbt.net> Message-ID: I have 9 machines each running nginx + unicorn. Maybe that's not the best setup.. On Mon, Nov 14, 2011 at 1:56 PM, Eric Wong wrote: > > Hello all, I'm wondering if you deploy nginx: > > 1) on the same machine that runs unicorn (exclusively proxying to that) > > 2) on a different machine that doesn't run unicorn > > 3) both, nginx could forward to either to localhost > ? or another host on the same LAN > > And of course, the reason(s) you chose what you chose. ?I'm inclined > to believe many folks are on 1) simply because they only have one > machine. > > Thanks in advance for your replies, I'm always interested in > hearing user experiences with unicorn. > _______________________________________________ > 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 Mon Nov 14 22:17:44 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 15 Nov 2011 03:17:44 +0000 Subject: Fix hang when running tests on OpenBSD by skipping two tests In-Reply-To: References: <20111114205429.GA15731@dcvr.yhbt.net> Message-ID: <20111115031744.GA3666@dcvr.yhbt.net> Jeremy Evans wrote: > On Mon, Nov 14, 2011 at 9:54 PM, Eric Wong wrote: > > Jeremy Evans wrote: > >> This is obviously not a permanent fix, but I'm not sure why the tests > >> are hanging, and hanging during a test is bad. ?I suppose you could > >> also use a timeout, so the test fails instead of hangs. ?I'll be happy > >> to test other patches to either the test suite or the library code > >> (assuming the hang is fixable on OpenBSD). > > > > I'd like to investigate why this fails. > > Makes sense. Is there something I can do to help debug? I normally use "set -x" (using the "V=2" env for gmake should enable it) or strace (or whatever the OpenBSD equivalent is). Syscall tracers are *much* easier to follow under MRI 1.9.3 than 1.9.2 due to the timer-thread being non-polling. I always use "-f" to strace nowadays to follow process/thread creations. > > So everything under t/ (gmake test-integration) works, too? > > I much prefer shell-based the test suite myself > > I didn't even know about that test suite till now. :) > > I started running those tests on OpenBSD. With the way the test suite > is currently setup, it's a bit of a pain to debug, as it stops at the > first error. So I have to: I usually prefer to work on each problem, one-at-a-time. However, GNU make already has a handy -k/--keep-going flag to ignore failures. I also use "set -e" in all my shell scripts to catch errors early on. > ruby 1.9.3 has a couple regular test failures (skipping the two hangs > with the earlier patch): > > : 1) Error: > : test_parse_error(HttpParserTest): > : RuntimeError: can't set length of shared string > : test/unit/test_http_parser.rb:350:in `headers' > : test/unit/test_http_parser.rb:350:in `test_parse_error' That's odd, is this with the latest version? (4.1.1) I thought I fixed all of those issues several months ago... > : 1) Failure: > : test_help(ExecTest) [test/exec/test_exec.rb:319]: > : <0> expected but was > : <158>. Can you dump out "test_stderr.#$$.log" just before that assertion? Thanks! From chris at cobaltedge.com Tue Nov 15 00:07:06 2011 From: chris at cobaltedge.com (Christopher Bailey) Date: Mon, 14 Nov 2011 21:07:06 -0800 Subject: nginx + unicorn deployment survey In-Reply-To: <20111114215624.GB22715@dcvr.yhbt.net> References: <20111114215624.GB22715@dcvr.yhbt.net> Message-ID: We run Nginx+Unicorn on each app server (we have several), and then have HAProxy in front of the whole thing. This is basically due to it being the setup for Engine Yard. On Mon, Nov 14, 2011 at 1:56 PM, Eric Wong wrote: > Hello all, I'm wondering if you deploy nginx: > > 1) on the same machine that runs unicorn (exclusively proxying to that) > > 2) on a different machine that doesn't run unicorn > > 3) both, nginx could forward to either to localhost > ? or another host on the same LAN > > And of course, the reason(s) you chose what you chose. ?I'm inclined > to believe many folks are on 1) simply because they only have one > machine. > > Thanks in advance for your replies, I'm always interested in > hearing user experiences with unicorn. > _______________________________________________ > 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 > -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com From ajsharp at gmail.com Tue Nov 15 12:47:05 2011 From: ajsharp at gmail.com (Alex Sharp) Date: Tue, 15 Nov 2011 09:47:05 -0800 Subject: nginx + unicorn deployment survey In-Reply-To: <20111114215624.GB22715@dcvr.yhbt.net> References: <20111114215624.GB22715@dcvr.yhbt.net> Message-ID: We run nginx and unicorn on the same instance, behind HAProxy. We run it this way because it means fewer instances, and the nginx processes don't seem to require many system resources, so we don't have a resource constraint problem by putting them on the same instance. -- Alex Sharp Zaarly, Inc. @ajsharp | github.com/ajsharp | alexjsharp.com On Monday, November 14, 2011 at 1:56 PM, Eric Wong wrote: > Hello all, I'm wondering if you deploy nginx: > > 1) on the same machine that runs unicorn (exclusively proxying to that) > > 2) on a different machine that doesn't run unicorn > > 3) both, nginx could forward to either to localhost > or another host on the same LAN > > And of course, the reason(s) you chose what you chose. I'm inclined > to believe many folks are on 1) simply because they only have one > machine. > > Thanks in advance for your replies, I'm always interested in > hearing user experiences with unicorn. From jeremyevans0 at gmail.com Tue Nov 15 15:03:49 2011 From: jeremyevans0 at gmail.com (Jeremy Evans) Date: Tue, 15 Nov 2011 21:03:49 +0100 Subject: Fix hang when running tests on OpenBSD by skipping two tests In-Reply-To: <20111115031744.GA3666@dcvr.yhbt.net> References: <20111114205429.GA15731@dcvr.yhbt.net> <20111115031744.GA3666@dcvr.yhbt.net> Message-ID: On Tue, Nov 15, 2011 at 4:17 AM, Eric Wong wrote: > I usually prefer to work on each problem, one-at-a-time. ?However, > GNU make already has a handy -k/--keep-going flag to ignore failures. Thanks, I didn't know about that, and it is much easier than patching make files. I think I've fixed all the issues that caused test failures on OpenBSD. All changes are in the test code itself. Hope this helps. Sorry if gmail mangles these diffs. Thanks, Jeremy expr on OpenBSD uses a basic regular expression (according to re_format(7)), which doesn't support +, only *. --- t/t0011-active-unix-socket.sh.orig Tue Nov 15 20:28:37 2011 +++ t/t0011-active-unix-socket.sh Tue Nov 15 20:28:54 2011 @@ -7,7 +7,7 @@ read_pid_unix () { socat - UNIX:$unix_socket | \ tail -1) test -n "$x" - y="$(expr "$x" : '\([0-9]\+\)')" + y="$(expr "$x" : '\([0-9][0-9]*\)')" test x"$x" = x"$y" test -n "$y" echo "$y" I assume you aren't purposely testing a large timeout here, so hopefully this change is fine. The original code caused an infinite loop on OpenBSD, and also taking up all available space on the file system if you let it run long enough because it wrote to the log inside the loop. On 1.8.7: E, [2011-11-15T18:55:34.616397 #11092] ERROR -- : master loop error: time + 2147483646.000000 out of Time range (RangeError) E, [2011-11-15T18:55:34.616538 #11092] ERROR -- : /usr/obj/ports/unicorn-4.1.1/unicorn-4.1.1/t/../test/ruby-1.8.7/lib/unicorn/http_server.rb:264:in `+' E, [2011-11-15T18:55:34.616611 #11092] ERROR -- : /usr/obj/ports/unicorn-4.1.1/unicorn-4.1.1/t/../test/ruby-1.8.7/lib/unicorn/http_server.rb:264:in `join' E, [2011-11-15T18:55:34.616686 #11092] ERROR -- : /usr/obj/ports/unicorn-4.1.1/unicorn-4.1.1/t/../test/ruby-1.8.7/bin/unicorn:121 On 1.9.3: E, [2011-11-15T19:00:20.464234 #13442] ERROR -- : listen loop error: Invalid argument (Errno::EINVAL) E, [2011-11-15T19:00:20.464327 #13442] ERROR -- : /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:620:in `select' E, [2011-11-15T19:00:20.464399 #13442] ERROR -- : /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:620:in `worker_loop' E, [2011-11-15T19:00:20.464457 #13442] ERROR -- : /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:485:in `spawn_missing_workers' E, [2011-11-15T19:00:20.464514 #13442] ERROR -- : /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:135:in `start' E, [2011-11-15T19:00:20.464570 #13442] ERROR -- : /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/bin/unicorn:121 E, [2011-11-15T19:00:20.464626 #13442] ERROR -- : /usr/local/bin/unicorn:19:in `load' E, [2011-11-15T19:00:20.464681 #13442] ERROR -- : /usr/local/bin/unicorn:19 --- t/t0012-reload-empty-config.sh.orig Tue Nov 15 20:05:13 2011 +++ t/t0012-reload-empty-config.sh Tue Nov 15 20:05:37 2011 @@ -9,7 +9,7 @@ t_begin "setup and start" && { cat >> $unicorn_config < References: <20111114205429.GA15731@dcvr.yhbt.net> <20111115031744.GA3666@dcvr.yhbt.net> Message-ID: On Tue, Nov 15, 2011 at 9:03 PM, Jeremy Evans wrote: > openssl sha1 on OpenBSD doesn't just spit out the hash: > > $ openssl sha1 mocha.diff > SHA1(mocha.diff)= 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5 > $ sha1 -q mocha.diff > 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5 Here's a fix for t/test-lib.sh that handles unix socket paths where you are running the regression tests for a long directory name. I didn't catch this earlier because the unix socket test only fails on ruby 1.9 port on my system, since the path name is a little longer for the ruby19 flavor than the unflavored ruby 1.8 port. You probably want to use more robust name mangling if you choose to fix this, my fix is simple but has corner cases where it breaks that could be problematic. Jeremy --- t/test-lib.sh.orig Thu Jan 1 01:00:00 1970 +++ t/test-lib.sh Tue Nov 15 22:02:59 2011 @@ -38,20 +38,24 @@ rtmpfiles () { for id in "$@" do name=$id - _tmp=$t_pfx.$id - eval "$id=$_tmp" case $name in *fifo) + _tmp=$t_pfx.$id + eval "$id=$_tmp" rm -f $_tmp mkfifo $_tmp T_RM_LIST="$T_RM_LIST $_tmp" ;; *socket) + _tmp=$(echo "$t_pfx.$id" | $RUBY -e 'print $stdin.read(103)') + eval "$id=$_tmp" rm -f $_tmp T_RM_LIST="$T_RM_LIST $_tmp" ;; *) + _tmp=$t_pfx.$id + eval "$id=$_tmp" > $_tmp T_OK_RM_LIST="$T_OK_RM_LIST $_tmp" ;; @@ -101,6 +105,7 @@ unicorn_wait_start () { rsha1 () { _cmd="$(which sha1sum 2>/dev/null || :)" + test -n "$_cmd" || _cmd="$(which sha1 2>/dev/null || :) -q" test -n "$_cmd" || _cmd="$(which openssl 2>/dev/null || :) sha1" test "$_cmd" != " sha1" || _cmd="$(which gsha1sum 2>/dev/null || :)" From normalperson at yhbt.net Tue Nov 15 17:36:19 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 15 Nov 2011 14:36:19 -0800 Subject: Fix hang when running tests on OpenBSD by skipping two tests In-Reply-To: References: <20111114205429.GA15731@dcvr.yhbt.net> <20111115031744.GA3666@dcvr.yhbt.net> Message-ID: <20111115223619.GA689@dcvr.yhbt.net> Jeremy Evans wrote: > I assume you aren't purposely testing a large timeout here, so > hopefully this change is fine. The original code caused an infinite > loop on OpenBSD, and also taking up all available space on the file > system if you let it run long enough because it wrote to the log > inside the loop. On 1.8.7: I expected "timeout 0x7fffffff" to be fine (I sometimes use it :x)... > E, [2011-11-15T18:55:34.616397 #11092] ERROR -- : master loop error: > time + 2147483646.000000 out of Time range (RangeError) > E, [2011-11-15T18:55:34.616538 #11092] ERROR -- : > /usr/obj/ports/unicorn-4.1.1/unicorn-4.1.1/t/../test/ruby-1.8.7/lib/unicorn/http_server.rb:264:in Odd, which patchlevel of 1.8.7 is this? (more of a curiosity at this point, see below) > On 1.9.3: > > E, [2011-11-15T19:00:20.464234 #13442] ERROR -- : listen loop error: > Invalid argument (Errno::EINVAL) > E, [2011-11-15T19:00:20.464327 #13442] ERROR -- : > /usr/local/lib/ruby/gems/1.8/gems/unicorn-4.1.1/lib/unicorn/http_server.rb:620:in > `select' OK, I need to read POSIX manpages more often, not just the Linux ones. >From the select() POSIX manpage: All implementations shall support a maximum timeout interval of at least 31 days. I think I'll just force Unicorn::Configurator to limit that to 30 days. But, the POSIX manpage also states: If the timeout argument specifies a timeout interval greater than the implementation-defined maximum value, the maximum value shall be used as the actual timeout value. So isn't OpenBSD wrong in giving EINVAL here? Unless somehow the large time_t was interpreted as a negative value... > openssl sha1 on OpenBSD doesn't just spit out the hash: > > $ openssl sha1 mocha.diff > SHA1(mocha.diff)= 4ea47d3cf9e4f1858a298a8a9f5a5671422971d5 This happens on newer openssl under Debian, too. Maybe just switch to sha1sum.rb since I'm more comfortable with Ruby 1.9 now than I was in 2009. From normalperson at yhbt.net Tue Nov 15 20:18:56 2011 From: normalperson at yhbt.net (Eric Wong) Date: Tue, 15 Nov 2011 17:18:56 -0800 Subject: Fix hang when running tests on OpenBSD by skipping two tests In-Reply-To: References: <20111114205429.GA15731@dcvr.yhbt.net> <20111115031744.GA3666@dcvr.yhbt.net> Message-ID: <20111116011856.GA8369@dcvr.yhbt.net> Jeremy Evans wrote: > On Tue, Nov 15, 2011 at 4:17 AM, Eric Wong wrote: > > I usually prefer to work on each problem, one-at-a-time. ?However, > > GNU make already has a handy -k/--keep-going flag to ignore failures. > > Thanks, I didn't know about that, and it is much easier than patching > make files. > > I think I've fixed all the issues that caused test failures on > OpenBSD. All changes are in the test code itself. Hope this helps. OK, I think I've pushed relevant fixes up to master of unicorn.git (commit fbcf6aa641e5827da48a3b6776c9897de123b405) Eric Wong (3): configurator: limit timeout to 30 days tests: just use the sha1sum implemented in Ruby tests: try to set a shorter path for Unix domain sockets Jeremy Evans (2): t0011: fix test under OpenBSD test_helper: ensure test client connects to valid address > Sorry if gmail mangles these diffs. No worries, patch(1) is very lenient. Just wondering, do most folks have/lack decent SMTP setups nowadays? (especially on servers they don't usually work from) When working without a VCS repo (live fixes on servers :x), I'll sometimes just send a patch out like this: diff -u a b | mail -s diff-a-b a at example.com This is a big reason I prefer no-subscription-required mailing lists. If it's to a public mailing list, I'll always email myself first to cleanup the Received: trail and also to rewrite my email address so it doesn't have @evil-corporation.com in it :) From laurens.pit at mirror42.com Mon Nov 21 18:14:34 2011 From: laurens.pit at mirror42.com (Laurens Pit) Date: Tue, 22 Nov 2011 10:14:34 +1100 Subject: Should USR2 always work? Message-ID: Hi, When deploying new code we go through the USR2 QUIT sequence. This works very nicely and gives zero downtime. My question is whether there are instances when this sequence is known to not work, and instead you should really send QUIT first and then start all over? I didn't expect that to be the case, but in the past year occasionally I've experienced I had to resort to QUIT and start all over in order to get all components loaded correctly. Specifically: yesterday I upgraded several projects to rails 3.0.11 and added a new i18n .yml file in the config dir. After the USR2 QUIT sequence all new code seemed to work fine. Except the new .yml file wasn't loaded. Another run of USR2 and QUIT didn't resolve it. Only after QUIT and start of unicorn was the new .yml file loaded. This was not just on one machine, which might have been a fluke. This was on all machines for all projects, consistently. Any ideas? Cheers, Lawrence From normalperson at yhbt.net Mon Nov 21 20:16:31 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 21 Nov 2011 17:16:31 -0800 Subject: Should USR2 always work? In-Reply-To: References: Message-ID: <20111122011631.GA20110@dcvr.yhbt.net> Laurens Pit wrote: > I didn't expect that to be the case, but in the past year occasionally > I've experienced I had to resort to QUIT and start all over in order > to get all components loaded correctly. > > Specifically: yesterday I upgraded several projects to rails 3.0.11 > and added a new i18n .yml file in the config dir. After the USR2 QUIT > sequence all new code seemed to work fine. Except the new .yml file > wasn't loaded. Another run of USR2 and QUIT didn't resolve it. Only > after QUIT and start of unicorn was the new .yml file loaded. > > This was not just on one machine, which might have been a fluke. This > was on all machines for all projects, consistently. > > Any ideas? Anything from stderr log files? USR2 will fail if there's * compile/load error when loading the app (if preload_app=true) * unicorn/unicorn_rails executable script is missing (maybe Bundler is moving it?) * Ruby installation got moved/shifted/changed * Working directory got _moved_ (cap may cycle those out) You can set "working_directory" in your unicorn config to work around it. (and maybe other reasons I can't think of right now) Come to think of it, the missing working directory case could be the most common... But stderr log files (stderr_path) should always tell you what's going on. == Linux(-only?) tip: If the log files got deleted somehow, you may still be able to read it via: "cat /proc/$PID/fd/2" on either the PID of the master or _any_ worker process. To read some other log files, you can just replace the "2" with whatever file descriptor. Reading the symlinks ("ls -l /proc/$PID/fd/") will tell you where each descriptor is pointed to, even if it is a deleted file. From lawrence.pit at gmail.com Mon Nov 21 20:55:29 2011 From: lawrence.pit at gmail.com (Lawrence Pit) Date: Tue, 22 Nov 2011 12:55:29 +1100 Subject: Should USR2 always work? In-Reply-To: <20111122011631.GA20110@dcvr.yhbt.net> References: <20111122011631.GA20110@dcvr.yhbt.net> Message-ID: > Anything from stderr log files? USR2 will fail if there's Right: > ruby: no such file to load -- bundler/setup (LoadError) > * unicorn/unicorn_rails executable script is missing > (maybe Bundler is moving it?) Bundler has been updated several times this year, I guess every time that happens and a new version gets installed a complete restart of unicorn is required? Am I the only one seeing this? Perhaps I'm managing bundler wrong? Bundler and rake are the only two gems I install in the global gem space. With an update of bundler I do "gem uninstall bundler ; gem bundler install". Should I manage this differently? Cheers, Lawrence From normalperson at yhbt.net Mon Nov 21 22:00:38 2011 From: normalperson at yhbt.net (Eric Wong) Date: Mon, 21 Nov 2011 19:00:38 -0800 Subject: Should USR2 always work? In-Reply-To: References: <20111122011631.GA20110@dcvr.yhbt.net> Message-ID: <20111122030038.GA26218@dcvr.yhbt.net> Lawrence Pit wrote: > Bundler has been updated several times this year, I guess every time > that happens and a new version gets installed a complete restart of > unicorn is required? Am I the only one seeing this? Managing bunder has always been tricky, unfortunately. > Perhaps I'm managing bundler wrong? Bundler and rake are the only two > gems I install in the global gem space. With an update of bundler I do > "gem uninstall bundler ; gem bundler install". Should I manage this > differently? I brought up a "bring-your-own-executable" deployment a few months ago but haven't heard any feedback. Here it is for Bundler: http://mid.gmane.org/20110819022316.GA2951 at dcvr.yhbt.net I am also using something very similar with Isolate: ------------- /full/path/to/app_root/script/unicorn-byoe --------- #!/home/ew/ruby-1.9.3/bin/ruby # Unicorn: bring-your-own executable require "isolate/now" $LOAD_PATH << "./lib" load Gem.bin_path("unicorn", "unicorn") ------------------------------- 8< ------------------------------- I run the path using the full pathname, so there's less ambiguity as to what gets captured as $0 and executed on USR2. I don't know of anybody else doing/trying this, though. From lawrence.pit at gmail.com Wed Nov 23 00:31:24 2011 From: lawrence.pit at gmail.com (Lawrence Pit) Date: Wed, 23 Nov 2011 16:31:24 +1100 Subject: Should USR2 always work? In-Reply-To: <20111122030038.GA26218@dcvr.yhbt.net> References: <20111122011631.GA20110@dcvr.yhbt.net> <20111122030038.GA26218@dcvr.yhbt.net> Message-ID: <178B303D-5067-430E-BC7E-9C4C11442AD8@gmail.com> > I brought up a "bring-your-own-executable" deployment a few months ago > but haven't heard any feedback. Here it is for Bundler: > > http://mid.gmane.org/20110819022316.GA2951 at dcvr.yhbt.net I tried this out by going back to a previous version of bundler, then deployed, unfortunately doesn't seem to work for me: executing ["/srv/ec/current/script/unicorn_byoe", "-D", "-E", "staging", "-c", "/srv/ec/current/config/unicorn/staging.rb"] (in /srv/ec/releases/20111123052840) /opt/ree/bin/ruby: no such file to load -- bundler/setup (LoadError) Sending QUIT and then start anew works fine. Upgraded back to latest, tried again, and again no luck. QUIT + start is the only thing that works then. Tried a slightly modified version of unicorn_byoe, I'm using rails: #!/opt/ree/bin/ruby require File.expand_path("../../config/boot.rb", __FILE__) # Gem.bin_path(gem_name, executable_name, *version_requirements) load Gem.bin_path("unicorn", "unicorn_rails") Cheers, Lawrence From malausaauia59uisii at yahoo.de Fri Nov 25 00:36:54 2011 From: malausaauia59uisii at yahoo.de (Louis) Date: Fri, 25 Nov 2011 13:36:54 +0800 Subject: =?GB2312?B?QW5pbWF0ZWQgTW92aWUvVFYgU2VyaWVzIA==?= =?GB2312?B?LSBDYXJ0b29uIE1vdmllL1RWIFNlcmllcw==?= =?GB2312?B?IC0gM0QvMkQgQW5pbWF0aW9uIFNlcnZpYw==?= =?GB2312?B?ZXM=?= Message-ID: You are receiving this email because we wish you to use our 3D/2D Animated Movie/TV Series Services. We are a China based Animated Movie/TV Series Studio. with the technical, our studio is a animation studio with the technical, creative and production capabilities to create a new generation of animated feature films, merchandise and other related products. Our objective is to combine proprietary technology and world-class creative talent to develop computer-animated feature films with memorable characters and heartwarming stories that appeal to audiences of all ages. We utilize the finest equipment available in the industry, offer efficient data delivery and unrivaled quality and work until the client is fully satisfied with the end product. Core Offerings 2D Animation 3D Animation 4D Animation Cell Animation Cartoon Animation Animated Movies Animated TV Series Architecture Visualization Character Animation Animated Commercial Animated Presentation Walkthrough Animation Flash Presentation Logo Animation Animated Wallpapers Animated Graphics We are also looking for agents who can represent us in USA and Europe in order to gain more Animated Movie orders. Best regards, Louis Louisamosu Animation Services Contact: ibanicontact at yeah.net Pls send address to koremoveideite at yeah.net for remove From lofajany at live.com Mon Nov 21 09:14:13 2011 From: lofajany at live.com (Jany Lofa) Date: Mon, 21 Nov 2011 14:14:13 GMT Subject: From:Mrs. Jany Lofa Message-ID: <2Np0PrSpJjIGxkAW15xU9P0hSWjSSwOnRhkJxL2jGsvz@live.com> From:Mrs. Jany Lofa My Dearest one, I am the above named person. I am married to Mr.lofa who before his death was a wealthy cocoa Merchant here in Cote d'Ivoire. We were married for 25 years without a child. Before the death of my husband we were both born again Christians. My Husband left the sum of US$3.8million United States Dollars in a fix/suspense account in one of the prime bank here in Cote d'Ivoire. Recently, my Doctor told me that I would not exceed more than five more months due to cancer problem. The one that disturbs me most is my blood pressure sickness. Having known my condition I decided to seek for your kind assistance to transfer this fund into your account and you will use it to train my adopted daughter who is 16yrs. You will take her as your God child and brought her up in a good and decent manner with what my late husband left behind. I took this decision to contact because of my condition and for the facts that my husband relatives wants to size everything and throw my adopted daughter out of the inheritance. So I want to use this little time I have to achieve this arm before joining my ancestors. Please indicate your interest and willingness in this transaction by writing back to me through the above email address. I want your maximum cooperation and keep this as confidential for security reasons. I am sincerely waiting for your kind and urgent response as soon as your receive this mail. Thanks and God bless you. Sincerely Yours, Mrs. Jany Lofa From chibaoasdas53ouauni at yahoo.de Sat Nov 26 12:13:22 2011 From: chibaoasdas53ouauni at yahoo.de (Rick) Date: Sun, 27 Nov 2011 01:13:22 +0800 Subject: =?GB2312?B?RGlnaXRhbCBQaG90byBFZGl0aW5nIFNlcnZpY2VzIC0gUGhvdG8gQ3V0b3V0?= Message-ID: You are receiving this email because we wish you to use our digital photo editing services. Digital Photo Editing Services : We are a China based Imaging Professionals. We offer basic and advanced digital photo Editing services and solutions like photo Cutout, morphological photo Editing, photoshop photo Editing, satellite photo Editing, color photo Editing and vector photo Editing using latest techniques. Our strength in providing Editing solutions for digital images like photo masking, photo re-touching, back ground cleaning & cloning, sharpening & restoration of color, all this derive from our vast experience. Our dedicated team of highly skilled and experienced professionals serves the photo Editing requirements of our clients. An in house quality checking mechanism assures value addition and delivers perfect job. Our team can deliver your job overnight or in time bounded fashion irrespective of job size. Our mainly services are: 1. Photo Cutout 2. Photo Enhancement 3. Photo Retouching 4. Vector Conversion 5. Pop Art 6. Images Masking 7. Clipping Path 8. Photo Restoration 9. Web Design Photo Editing Services: Our Photo Editing services includes advanced photo cutouts/clippings, balancing brightness / contrast in an image, repair of minor scratches, creases, minor dust, and spot removal to removal of major scratches, cracks, creases, and stains in all areas. We also repair seriously faded/damaged photographs and make it print ready. Best regards, Rick Rondikeson Imaging Professionals Contact: contactrick at yeah.net Send address to koremoveideat at yeah.net for remove From laas.toom at eenet.ee Wed Nov 30 10:24:11 2011 From: laas.toom at eenet.ee (Laas Toom) Date: Wed, 30 Nov 2011 17:24:11 +0200 Subject: COW friendly GC and PostgreSQL Message-ID: Hello, I stumbled upon a weird issue when upgrading a Rails app and trying to run in on Unicorn!: http://stackoverflow.com/questions/8262803/unicorn-and-postgresql/ The problem manifested itself via a few different error messages as if garbage/nil was returned from database instead of actual data and it only happened with more than one concurrent request (i.e under load test). This turned out to be an issue with COW-friendly GC that I had enabled (taken from the example unicorn.conf). Removing this from unicorn.conf made the app run smooth again. Is this something known or did I do something wrong? Best regards, Laas From jeremyevans0 at gmail.com Wed Nov 30 15:54:37 2011 From: jeremyevans0 at gmail.com (Jeremy Evans) Date: Wed, 30 Nov 2011 12:54:37 -0800 Subject: COW friendly GC and PostgreSQL In-Reply-To: References: Message-ID: On Wed, Nov 30, 2011 at 7:24 AM, Laas Toom wrote: > Hello, > > I stumbled upon a weird issue when upgrading a Rails app and trying to run in on Unicorn!: > http://stackoverflow.com/questions/8262803/unicorn-and-postgresql/ > > The problem manifested itself via a few different error messages as if garbage/nil was returned from database instead of actual data and it only happened with more than one concurrent request (i.e under load test). > > This turned out to be an issue with COW-friendly GC that I had enabled (taken from the example unicorn.conf). Removing this from unicorn.conf made the app run smooth again. > > Is this something known or did I do something wrong? If you didn't disconnect the database connection before forking, that could be the cause of the problem, though you should have issues regardless of whether the GC is CoW or not. Did you just turn off CoW, or did you turn off preload_app as well? Looking at your config file, try adding a before_fork callback that disconnects the database connection and things may work fine. Jeremy From yirii.bolnoiy at mail.ru Wed Nov 30 22:44:43 2011 From: yirii.bolnoiy at mail.ru (=?Windows-1251?B?yO30byDk6/8g0c/ELCD3Le8sINRv7w==?=) Date: Thu, 01 Dec 2011 06:44:43 +0300 Subject: =?Windows-1251?B?xeTo7fvpIO3g62/j?= Message-ID: <8994787213.20100916297830@ftp.pruginamoi.com> ??? ???????? ??????????????? > ??????? ??????????????? ???????. > ?????????? ??????? ???????????????: > ????? ??????? ?????? ?? ?????? ??????. ??? ???????? ?? ?????????? ??????? ??????????????? ? ??? ?????????? ????? ??? ?????? ? ???????????? ???????????? ????????? ??? ???????. ??????? ???????????? ?8521 ??? ?????????????? ???????? ??????? ??? ???????? ?? ?????????? ??????? ???????????????. 2 ??????? 2011 ????, ?. ???? > ?????? ??????? ?????? ??????? - ???????-??????????? ?? ???????? ???????????????, ????? ???????????? ???? ?????????? ??????????? ????????. ???????? ?????????? ????????? ??????????????? ? ?????? ???????? ?? ????? ??????????? ? 2000 ????. ????????? * ??? ????? ???? ???????????? ??????? ??????? ????????? ?????? ????????????? ????? ???????????? ??????? ??????. ??????????? ???? ????????????, ??????????? ?? ???????, ??????????? ?????????? ??????? ?????????? ? ??????? ?????? ??????. * ???????? ????? ????????????, ??? ????????????? ??????? ????? ???? ???????????? ??????? ??????. ???????????? ???????????? ????? ???????????? ????. ?????????????? ??????, ?????, ??????????? ??????, ??????: ??? ?????????? ??? ?? ????? ???? ???????????? ??????? ??????? * ?????? ???????? ??????? ? ????? ?????? ??????: ??? ??? ?? ????? ?????????? ????? ?? ?????? 5%? ????????? ????? ?????????????. ?????????????? ??????????? ???????????? ???. * ?????? ??????? ??????: ??? ??????? ?? ?????? ?????? ??????????? ??????? ??????. ??? ??????? ?? ?????? ? ??????: ???????? ???????????. ???????? ?????? 15% ??? ???. ??? ? ??????? ?????? ??? ??. ???: ?????? ?????????!!! * ???? ?? ?????? ???? ???????????? ??????? ??????: ??? ????????? ??????? ? ????? ?? ?????? ? ? ??????? ?? ??????. ?????????? ????????? ? ?????????????? ??????????? ???????? ? ???????????? ? ??????? ??????????? ???????. ????????????? ?? ?????? ??????? ?????? ???? ?? ??? ?????????? ?????? * ???? ???????????? ??????? ?????? ?? ?????? ?? ?????????? ????????. ????????!!! ???????, ??? ??????? ?????????? ??????? ?????? ?????? ??????? ?? ?????? ?????? ???????. * ???????? ?? ?????????? ??????? ???????????????: * ??????????? ????????????????? ??????: ?????? ????? ?? ?????? ????????. * ??? ?????????? ?????????????? ?????? ????? ????? ??????? ? ???? ?????????, ?????????? ? ??????. ???????????? ????????????? ? ????????? ?????????? ??????. ???? ????????? ?????? * ?????? ??????, ?? ?????????? ? ?????: ???, ???, ???? - ?????? ? ????? ?? ??????????, ??????? ?? ????????? ? ????? ?????????? ?????????? ?????? ? ?????????. * ??? ?????????? ???????? ?? ????????? ?????????, ????????????? ?????????????? ? ?????????: ??? ????? ??? ??? ??????????? ? ???????? ???????? ? ???????. * ??????????????? ? ???????? ??????????? ? ?????? ?????????? ???????. ????? ??????????? ?? ?????????? ?????? ????? ? ??????? ??? ?? ?????? ?????????????????? * ??????? ????? ????????????? ??????? ??????: ????? ? ???? ????? ??? ????????? ????? ???????????? ??????? ??????. ??????? ?????, ???? ??????? ???????? ???????????? ???. ?????????? ? ??????? ? ?????????? ????????? ??????????. * ?????????????? ?????????? ? ????? ?????? ??????? ?????? * ???????? ? ????????????? ??????? ?????? * ?? ??????? ?????!!! ?? ????? ?????? * ????? ?????????? ? ????? ??????????????? ???????????? ?????? ?? ??????? ? ???????????? ??????? ??????. * ??? ????? ???????? ??????????? ???? ?? ????? ????????? ??????? ??? ??????? ??????? ??: ????? ?????????? ?????? ?????????? ?????? * ?????????? ?? ??????? ???????????? ????? ???????????? ? ?????? ?????????? ??? ??? ?? ????????? ??? * ???????, ??? ??????? ??, ???????????? ?????? ??????????? ???? ?????????? ? ???????? ?????????. ??? ???????? ?????????????? ??????? ??????????????? ??????????? ?? ?? ???. (044) 383-88-????-8 ????????? 9:00 ? ?????? ??????????? 9:30 ? ?????? ???????? ????????? 835.00 ?p?. ? ?a o??o?o ??ac????a, ?p? ???a?e ?a ???x ???c????o? ? ?????a.