On Wed, Jun 11, 2008 at 3:07 AM, [email protected]
[email protected] wrote:
We’ve used BackgroundRb for our light-to-this-point asynchronous
processing needs. It was a pain in the butt to get working initially
(and we can still only run it on our Linux boxes, not on Windows), but
I’ve perceived it to be probably the most frequently used asynchronous
solution for Rails, so we’re going to go with it until we can’t.
Though it’s a memory and process hog, I don’t think there would be
trouble sending many mails with it, as long as its running on a
machine with a lot of memory, and as long as those mails aren’t spam
sent to me inbox.
I am afraid, that has changed unless you are running old svn version
of backgroundrb:
http://gnufied.org/2008/05/21/bleeding-edge-version-of-backgroundrb-for-better-memory-usage/
Many users have found git version to be quite stable and since now
bdrb uses fork and exec ( meaning it replaces old process image with
new one), there is no sharing of resources between workers, which used
to prevent garbage collection of objects, which were allocated before
fork. Its not a problem of bdrb per se, since Ruby interpretor is
known to be not COW(copy on write) friendly (for uninitiated, it means
that, in ruby, when you fork, all the objects in scope have a bit set
in them, so as they get copied in forked process. This is fine, but
this prevents, those objects from garbage collected. Ideally, it
should copy only when an object’s value is changed in child , hence
copy on write . But Ruby doesn’t do that. You will find plenty of
material about this on internet)
Github version of bdrb uses fork and exec, and hence it means that,
objects are no longer shared and hence garbage collection can work as
usual. In fact, if you want access to rails environment, this is as
much as lean and thin you can get. You can’t have your cake and eat it
too.
Bill
From google search I find only two options mentioned above. Please
tell me your experience with either of them. Is there any other
solution that I have overlooked ?
Thank you!
–
Let them talk of their oriental summer climes of everlasting
conservatories; give me the privilege of making my own summer with my
own coals.
http://gnufied.org