M
MiG
I have more than 10 ruby programs running on server. They sleep for the
most of time but each of them consumes 2MB of memory.
I have an idea of client-server Ruby interpreter. There will be only one
running interpreter as a daemon (but not detached, I'm D.J.
Bernstein's daemontools fan ))
Everything what will change will be the header of scripts:
#!/usr/bin/ruby-client
The ruby-client would send it's stdin to server and get output back.
I've tried to write this server in Ruby as UNIXServer using "load"
method to run scripts, but I don't know how to redirect stdin/stdout.
I wrote $stdin/$stdout wrapper but it globally changes every
puts/gets/read/write/etc. I need to buffer it separately in each server
thread (for each client).
I think it should be useful:
1. less memory usage when many scripts are running at once
2. fast - no starting time of interpreter
3. can use ruby in chroot
Is it possible to write it in Ruby or should it be a low-level feature?
thx for ideas!
Jan Molic
most of time but each of them consumes 2MB of memory.
I have an idea of client-server Ruby interpreter. There will be only one
running interpreter as a daemon (but not detached, I'm D.J.
Bernstein's daemontools fan ))
Everything what will change will be the header of scripts:
#!/usr/bin/ruby-client
The ruby-client would send it's stdin to server and get output back.
I've tried to write this server in Ruby as UNIXServer using "load"
method to run scripts, but I don't know how to redirect stdin/stdout.
I wrote $stdin/$stdout wrapper but it globally changes every
puts/gets/read/write/etc. I need to buffer it separately in each server
thread (for each client).
I think it should be useful:
1. less memory usage when many scripts are running at once
2. fast - no starting time of interpreter
3. can use ruby in chroot
Is it possible to write it in Ruby or should it be a low-level feature?
thx for ideas!
Jan Molic