[rabbitmq-discuss] erlang-client problem on OS X (empty_rpc_bottom_half)

Matt Stancliff sysop at mindspring.com
Sat Dec 13 03:39:46 GMT 2008


Matthias,


>> I ended up writing a  rabbit_memsup_darwin.erl to take into account  
>> cache and buffers,
> We contemplated doing exactly that two days ago. How did you go  
> about it? AFAIK there is no /proc/meminfo on OS X :(

   My attempt (attached) involved:
     - scrape vm_stat output
     - use total = free + active + inactive + wired
     - use total free = free + inactive
     - run broker with rabbit_memsup_darwin
     - launch MulticastMain (on Linux) against the broker (on OS X).
     - watching the OS X machine reach 8M free (reported) memory and  
start swapping madly.

   After testing and further investigation, it turns out FreeBSD and  
Darwin use a unified buffer cache not kind enough to expose usage  
statistics[1].

>> but it looks like memsup reports correctly enough.
> Are you saying that Erlang's standard memsup takes into account  
> cache and buffers already on OS X? That would be a pleasant surprise.

   Nothing currently includes buffer/page cache statistics.  They are  
opaque, hidden, out of reach, verboten.  The value of free memory is  
the best we have.

>> Lesson learned.  When developing with unpredictable memory usage*,   
>> manually increase the memory threshold:   
>> memsup:set_sysmem_high_watermark(0.99).
> In the upcoming 1.5.0 release there will also be a flag to disable  
> memsup completely.

   Good idea.

[1]: http://www.wagerlabs.com/blog/2008/03/hacking-the-uni.html and http://black-chair.livejournal.com/11395.html


-Matt
-- 
Matt Stancliff                    San Jose, CA
AIM: seijimr              iPhone: 678-591-9337
"The best way to predict the future is to invent it." --Alan Kay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: osx_memsup_attempt.patch.gz
Type: application/x-gzip
Size: 2319 bytes
Desc: not available
Url : http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20081212/d705562f/attachment.bin 


More information about the rabbitmq-discuss mailing list