Net::Stomp and the curious timing behaviour

Dirk Koopman djk at tobit.co.uk
Mon Jan 8 14:36:40 GMT 2007


On Mon, 2007-01-08 at 14:03 +0000, Simon Wistow wrote:
> Java has this messaging API called JMS and one of the implementations is 
> called ActiveMQ. ActiveMQ uses a binary protocol but can use a simpler 
> text protocol calle STOMP (Simple Text Orientated Messaging Protocol) 
> which in most cases is good enough. There are two implementations - one 
> which sucks and one which was written by our very own Mr Brocard. It 
> rocks.
> 

> However the Perl producer is rock solid at about 100 messages consumed a 
> second. This seems a little suspicious to me - like something is 
> wait()ing for 1/100th of a second somewhere deep down in the stack of 
> IO::Socket::INET but I'm damned if I can find it.
> 

Select timeouts and looping probably. Java will, almost certainly, be
using threads with blocking reads. The default non-zero minimum time you
can set in the timeval parameter of a select() call (in linux) is 10mS.
In theory, if a packet comes along in the meantime the select should
drop before the 10mS is up. Other work (in C not just in perl), is
starting to make me question whether it actually waits for 10mS
regardless. 

Oh and I would be looking at M. Brocard's stuff for a select statement
in there first.

Dirk 






More information about the london.pm mailing list