[rabbitmq-discuss] RabbitMQ running at 100% CPU.
Matthias Radestock
matthias at lshift.net
Wed Apr 16 07:50:29 BST 2008
Michael, and anybody else who can spare a couple of minutes,
Matthias Radestock wrote:
> Michael Arnoldus wrote:
>> Since we are running on Intel HW, let me know if I can help by running
>> stuff or reproduce the problem.
>
> Thanks for the offer. I might take you up on it once I have a simple
> test case ready.
...which I now have. See attached.
To run this,
1) save the attached file in some directory
2) cd to that directory
3) run the erlang shell, i.e. 'erl'
4) monitor the CPU consumption of the erlang process (usually called
'beam' or 'beam.smp') with a program like 'top'
5) at the Erlang prompt, compile the program with
c(sock_spin).
which should return
{ok,sock_spin}
6) still at the Erlang prompt, pick a port (e.g. 5678) and run
sock_spin:working(5678).
7) connect to the chosen port with, say, netcat (telnet should work too,
but seems to be harder to kill; see next step), e.g.
nc localhost 5678 > /dev/null
8) terminate the connection, e.g. by ^C-ing netcat or killing the process.
9) At this point (it may take a few seconds) the Erlang shell should
return something like {error, closed} or {error, einval}. Check the CPU
usage of the Erlang process.
Now repeat steps 6-9 but call
sock_spin:broken(5678).
instead.
Finally, to quit the Erlang shell just type
q().
at the prompt.
The CPU consumption of the Erlang process reported in step 9 should be
near 0% at the end of both tests. However, on some systems the second
test leaves the Erlang process consuming 100% CPU, though the Erlang
shell remains responsive. I am interested in finding out which systems
exhibit this behaviour and which don't.
When reporting your results please include information about your system
(if you are on Unix just run 'uname -a') and Erlang version (the version
number displayed when starting the Erlang shell will do just fine).
Regards,
Matthias.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sock_spin.erl
Type: text/x-erlang
Size: 463 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080416/97ffe24c/attachment.bin
More information about the rabbitmq-discuss
mailing list