[rabbitmq-discuss] RabbitMQ running at 100% CPU.

Michael Arnoldus chime at mu.dk
Wed Apr 16 09:51:06 BST 2008


Matthias,

Nice work!!!

As expected I get 100% CPU wit sock_spin:broken().

uname -a:
Darwin Hobbes.local 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar  4  
21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386

erlang version:
Erlang (BEAM) emulator version 5.6.1 [source] [smp:2] [async-threads: 
0] [kernel-poll:false]

I'll be happy to try it on other HW and/or other versions if you think  
you need this.

Regards,

Michael

On Apr 16, 2008, at 8:50 , Matthias Radestock wrote:

> 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.
> -module(sock_spin).
>
> -compile(export_all).
>
> working(Port) ->
>    spin(Port, []).
>
> broken(Port) ->
>    spin(Port, [{active, false}]).
>
> spin(Port, Opts) ->
>    {ok, LSock} = gen_tcp:listen(Port, Opts),
>    {ok, Sock} = gen_tcp:accept(LSock),
>    Res = send(Sock, list_to_binary(lists:duplicate(10000, $A))),
>    ok = gen_tcp:close(LSock),
>    Res.
>
> send(Sock, B) ->
>    case gen_tcp:send(Sock, B) of
>        ok    -> send(Sock, B);
>        Other -> Other
>    end.
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1912 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20080416/0084c842/attachment.bin 


More information about the rabbitmq-discuss mailing list