Ruby 2.0 Fiber stack size is adjustable!

271 views
Skip to first unread message

Tony Arcieri

unread,
May 16, 2013, 7:32:29 PM5/16/13
to cellulo...@googlegroups.com, Mike Perham
Hey there Celluloids,

I know lots of people have had trouble with the meager 4kB stack sizes that Fibers afford. One solution is to use TaskThreads instead of TaskFibers now that they're (mostly) stable.

There's another option on Ruby 2.0: you can actually adjust the fiber stack size at the time the VM is booted. Unfortunately it's not particularly well documented:


Thanks to Schmurfy for pointing this out. We'll try to get this info into the Celluloid Wiki!

--
Tony Arcieri

AJ Christensen

unread,
May 16, 2013, 7:34:56 PM5/16/13
to cellulo...@googlegroups.com, Mike Perham
Yay! I'll have to test this. I was running some stack-heavy code
yesterday that was plagued with this, and changing to a TaskThread
skill kind of feels like a hack.

Cheers,

AJ
> --
> You received this message because you are subscribed to the Google Groups
> "Celluloid" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to celluloid-rub...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Ben Langfeld

unread,
May 16, 2013, 10:13:45 PM5/16/13
to cellulo...@googlegroups.com, Mike Perham
fbernier highlighted this on IRC a couple'a days ago: http://irclogger.com/.celluloid/2013-05-14#1368553166

Regards,
Ben Langfeld

Julien Ammous

unread,
May 17, 2013, 10:48:35 AM5/17/13
to cellulo...@googlegroups.com, Mike Perham, tony.a...@gmail.com
Thats' something which should have been mentioned in the changelog but was not :/
There are two set of environment variables "MACHINE" and "VM", after some researches it seems they are both the same but some
oses use the first while others use the last one.

Ben Langfeld

unread,
May 17, 2013, 11:15:03 AM5/17/13
to cellulo...@googlegroups.com, Mike Perham, Tony Arcieri
It was listed in both the changelog (https://github.com/ruby/ruby/blob/ruby_2_0_0/ChangeLog#L4122) and NEWS (https://github.com/ruby/ruby/blob/ruby_2_0_0/NEWS#L168). I'm afraid in this instance, it was only us at fault for not seeing it.

Regards,
Ben Langfeld


--

Ben Langfeld

unread,
May 17, 2013, 11:21:26 AM5/17/13
to cellulo...@googlegroups.com, Mike Perham, Tony Arcieri

Tim Carey-Smith

unread,
May 18, 2013, 4:14:57 AM5/18/13
to cellulo...@googlegroups.com
On May 16, 2013, at 4:32 PM, Tony Arcieri <tony.a...@gmail.com> wrote:

> Hey there Celluloids,
>
> I know lots of people have had trouble with the meager 4kB stack sizes that
> Fibers afford. One solution is to use TaskThreads instead of TaskFibers now
> that they're (mostly) stable.

There are still some issues with TaskThread with celluloid-io.
I have not been able to track them down or really reproduce.

I'd be interested in anyone who has a large-ish use of celluloid-io or reel to try TaskThread and report any issues they have.

If this is something you'd like to help with, ping me at @Cellubeard on twitter. :P

Ciao,
Tim

P.S. Or @halorgium :)


> There's another option on Ruby 2.0: you can actually adjust the fiber stack
> size at the time the VM is booted. Unfortunately it's not particularly well
> documented:
>
> https://github.com/ruby/ruby/blob/ruby_2_0_0/vm.c#L1702
>
> Thanks to Schmurfy for pointing this out. We'll try to get this info into
> the Celluloid Wiki!
>
> --
> Tony Arcieri
>

Schmurfy

unread,
May 18, 2013, 5:41:55 AM5/18/13
to cellulo...@googlegroups.com
When I said changelog I was thinking about the short version, that's an area we can surely widely disagree on but while I like DTrace support this is a far more obscure additions to most people than the fact that they greatly increased the default fiber stack size and even add a way to let us configure that and yet DTrace was on the release news ;)


You received this message because you are subscribed to a topic in the Google Groups "Celluloid" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/celluloid-ruby/jrFL1i-TeMc/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to celluloid-rub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages