supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Lloyd Zusman <ljz@asfast.com>
Subject: When running ruby scripts, runsv tightly loops
Date: Sun, 07 Nov 2004 00:10:38 -0500	[thread overview]
Message-ID: <m3llde8cs1.fsf@asfast.com> (raw)

I'm successfully using runit for managing a number of daemons.  However,
I have encountered a problem when the daemon is a ruby script.

It seems like no matter what the script is doing, the runsv process that
is managing the script seems to be running in a tight loop and taking up
a high percentage of my cpu.  This even occurs during a do-nothing ruby
program, such as the following:

  #!/usr/bin/ruby
  while true
    sleep(10)
  end

Assuming that this is called '/usr/local/bin/myscript', the 'run'
script looks like this:

  #!/bin/sh

  exec 2>&1

  exec /usr/local/bin/myscript

  exit 1

The 'myscript' process itself takes up a miniscule amount of resources;
only the 'runit' script which is managing it seems to be looping.

Has anyone else run into this problem with ruby scripts and runit?

By the way, I don't see this problem with python or perl scripts.

Could there be something about the ruby interpreter itself which could
be causing runsv to behave this way?  If so, can anyone suggest a
fix for this?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.



             reply	other threads:[~2004-11-07  5:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-07  5:10 Lloyd Zusman [this message]
2004-11-07  5:32 ` Never mind ... (Was: When running ruby scripts, runsv tightly loops) Lloyd Zusman
2004-11-07 13:55   ` Gerrit Pape
2004-11-07 20:59     ` Never mind Lloyd Zusman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3llde8cs1.fsf@asfast.com \
    --to=ljz@asfast.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).