My entry in the "Least Used Software EVAH" competition
Posted: Wed, 15 October 2014 | permalink | 2 Comments
For some reason, I seem to end up writing software for very esoteric use-cases. Today, though, I think I’ve outdone myself: I sat down and wrote a Ruby library to get and set process resource limits – those things that nobody ever thinks about except when they run out of file descriptors.
I didn’t even have a direct need for it. Recently I was grovelling through the EventMachine codebase, looking at the filehandle limit code, and noticed that the pure-ruby implementation didn’t manipulate filehandle limits. I considered adding it, then realised that there wasn’t a library available to do it. Since I haven’t berked around with FFI for a while, I decided to write rlimit. Now to find the time to write that patch for EventMachine…
Since I doubt there are many people who have a burning need to manipulate rlimits in Ruby, this gem will no doubt sit quiet and undisturbed in the dark, dusty corners of rubygems.org. However, for the three people on earth who find this useful: you’re welcome.
From: Christian Neukirchen
So, what’s the difference to the core Process.setrlimit function?
From: Matt Palmer
Uhm… I know my gem exists? (grin) When I was researching the original EM bug that led down this road, I found no indication that
One thing that the
rlimitgem does that I don’t think the built-in code does is allow you to determine at runtime whether a given limit is available.
Post a comment
All comments are held for moderation; markdown formatting accepted.