supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* supervise causes cpu spike
@ 2008-12-13 22:33 Count László de Almásy
  2008-12-13 23:49 ` OpenSim.exe causes cpu spike (Re: supervise causes cpu spike) Charlie Brady
  2008-12-16 10:48 ` supervise causes cpu spike Laurent Bercot
  0 siblings, 2 replies; 6+ messages in thread
From: Count László de Almásy @ 2008-12-13 22:33 UTC (permalink / raw)
  To: supervision

Hi,

I'm hoping someone can help me diagnose why supervising my OpenSim
process causes it to go up to 100% cpu, while when not supervised, I
have no such problems. This is on Debian/Linux amd64, with djb's
latest stock daemontools.

Here's my run script:

======
bee:/~# cat /service/opensim/run
#!/bin/sh
ulimit -s 262144
cd /home/opensim/opensim/bin
exec setuidgid opensim mono OpenSim.exe
======

stopping/restarting with svc works as expected. it's just, the cpu
goes right up to 100% with the supervised mono process. running strace
on the process shows what's happening:

read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0
read(0, ""..., 1024)                    = 0

[...]

over and over. it's like something is sending the process an empty
character repeatedly. Can someone tell me what I did wrong here, or
what is causing this?

-- 
Cheers, László


^ permalink raw reply	[flat|nested] 6+ messages in thread

* OpenSim.exe causes cpu spike (Re: supervise causes cpu spike)
  2008-12-13 22:33 supervise causes cpu spike Count László de Almásy
@ 2008-12-13 23:49 ` Charlie Brady
  2008-12-14  2:26   ` Count László de Almásy
  2008-12-16 10:48 ` supervise causes cpu spike Laurent Bercot
  1 sibling, 1 reply; 6+ messages in thread
From: Charlie Brady @ 2008-12-13 23:49 UTC (permalink / raw)
  To: Count László de Almásy; +Cc: supervision

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1235 bytes --]



On Sun, 14 Dec 2008, Count László de Almásy wrote:

> I'm hoping someone can help me diagnose why supervising my OpenSim
> process causes it to go up to 100% cpu, while when not supervised, I
> have no such problems. This is on Debian/Linux amd64, with djb's
> latest stock daemontools.
>
> Here's my run script:
>
> ======
> bee:/~# cat /service/opensim/run
> #!/bin/sh
> ulimit -s 262144
> cd /home/opensim/opensim/bin
> exec setuidgid opensim mono OpenSim.exe
> ======

Try:

exec setuidgid opensim mono OpenSim.exe </dev/null

or

exec </dev/null
exec setuidgid opensim mono OpenSim.exe

> stopping/restarting with svc works as expected. it's just, the cpu
> goes right up to 100% with the supervised mono process. running strace
> on the process shows what's happening:
>
> read(0, ""..., 1024)                    = 0
> read(0, ""..., 1024)                    = 0

> [...]
>
> over and over. it's like something is sending the process an empty
> character repeatedly.

No, it's that the process is repeatedly reading standard input in 
non-blocking mode, without first checking that there are any bytes to 
read.

That's a bug in OpenSim.exe (or in mono).

If it is a supervised daemon process, why is it reading standard input?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: OpenSim.exe causes cpu spike (Re: supervise causes cpu spike)
  2008-12-13 23:49 ` OpenSim.exe causes cpu spike (Re: supervise causes cpu spike) Charlie Brady
@ 2008-12-14  2:26   ` Count László de Almásy
  2008-12-14  6:04     ` Charlie Brady
  0 siblings, 1 reply; 6+ messages in thread
From: Count László de Almásy @ 2008-12-14  2:26 UTC (permalink / raw)
  To: Charlie Brady; +Cc: supervision

On Sun, Dec 14, 2008 at 4:49 AM, Charlie Brady
<charlieb-supervision@budge.apana.org.au> wrote:
> Try:
>
> exec setuidgid opensim mono OpenSim.exe </dev/null
>
> or
>
> exec </dev/null
> exec setuidgid opensim mono OpenSim.exe

I tried both to no avail. Behavior is the same. Any other suggestions?

> No, it's that the process is repeatedly reading standard input in
> non-blocking mode, without first checking that there are any bytes to read.
>
> That's a bug in OpenSim.exe (or in mono).
>
> If it is a supervised daemon process, why is it reading standard input?

I'll see about reporting this to the OpenSim dev team.

-- 
Cheers, László


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: OpenSim.exe causes cpu spike (Re: supervise causes cpu spike)
  2008-12-14  2:26   ` Count László de Almásy
@ 2008-12-14  6:04     ` Charlie Brady
  2008-12-14  6:18       ` Count László de Almásy
  0 siblings, 1 reply; 6+ messages in thread
From: Charlie Brady @ 2008-12-14  6:04 UTC (permalink / raw)
  To: Count László de Almásy; +Cc: supervision

[-- Attachment #1: Type: TEXT/PLAIN, Size: 437 bytes --]


On Sun, 14 Dec 2008, Count László de Almásy wrote:

> On Sun, Dec 14, 2008 at 4:49 AM, Charlie Brady
> <charlieb-supervision@budge.apana.org.au> wrote:
>> Try:
>>
>> exec setuidgid opensim mono OpenSim.exe </dev/null
>>
>> or
>>
>> exec </dev/null
>> exec setuidgid opensim mono OpenSim.exe
>
> I tried both to no avail. Behavior is the same. Any other suggestions?

Try:

exec 0<&-

How does the strace change with the various changes?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: OpenSim.exe causes cpu spike (Re: supervise causes cpu spike)
  2008-12-14  6:04     ` Charlie Brady
@ 2008-12-14  6:18       ` Count László de Almásy
  0 siblings, 0 replies; 6+ messages in thread
From: Count László de Almásy @ 2008-12-14  6:18 UTC (permalink / raw)
  To: Charlie Brady; +Cc: supervision

On Sun, Dec 14, 2008 at 11:04 AM, Charlie Brady
<charlieb-supervision@budge.apana.org.au> wrote:
> Try:
>
> exec 0<&-
>
> How does the strace change with the various changes?

Ok, tried that as well. The strace is the same with all of them. Just
the following over and over:

read(0, ""..., 1024)                    = 0

-- 
Cheers, László


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: supervise causes cpu spike
  2008-12-13 22:33 supervise causes cpu spike Count László de Almásy
  2008-12-13 23:49 ` OpenSim.exe causes cpu spike (Re: supervise causes cpu spike) Charlie Brady
@ 2008-12-16 10:48 ` Laurent Bercot
  1 sibling, 0 replies; 6+ messages in thread
From: Laurent Bercot @ 2008-12-16 10:48 UTC (permalink / raw)
  To: supervision

> I'm hoping someone can help me diagnose why supervising my OpenSim
> process causes it to go up to 100% cpu, while when not supervised, I
> have no such problems.

 This screams "different running environment".
 There's something different in the way you're launching your
unsupervised mono. You should closely examine the script you were
using before switching to daemontools.

 Maybe stdin should be connected to something else than /dev/null.
 Maybe there's an environment variable that must be set.
 Maybe it's something else.
 But it's there, and mono requires it to perform correctly.

-- 
 Laurent


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-12-16 10:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-13 22:33 supervise causes cpu spike Count László de Almásy
2008-12-13 23:49 ` OpenSim.exe causes cpu spike (Re: supervise causes cpu spike) Charlie Brady
2008-12-14  2:26   ` Count László de Almásy
2008-12-14  6:04     ` Charlie Brady
2008-12-14  6:18       ` Count László de Almásy
2008-12-16 10:48 ` supervise causes cpu spike Laurent Bercot

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).