activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonm <>
Subject STOMP latency vs other protocols
Date Thu, 12 Apr 2007 17:10:01 GMT

I'm experimenting with the STOMP broker feature of activeMQ with PHP.  I've
written publishers and consumers using STOMP and everything works, but with
a latency that is a little too high for my needs. Not being a java person I
haven't setup tests using java clients to do comparative benchmarking
against the PHP implementation (which is of course a particular angle at
answering my question here, but I thought i'd ask the group before diving
into figuring that out and if anyone has had lower latency with STOMP via

Basically, I've got the queue running on the same machine as 2 clients (one
publisher, one consumer). When I send 1 message to a queue via STOMP i add
an extra header called 'microtime' and just before sending the message I set
that microtime header to the current time with millisecond precision. 
ActiveMQ then adds it's own timestamp to the message (i assume on receipt).
The activeMQ timestamp is often about 20ms after my added header.   I know
that the PHP function that sends the STOMP frame takes less than 1ms (so
significant latency should not be introduced via that send call. I also know
that after the queue gets the message and after the MQ timestamp is added to
the headers by MQ, it takes less than 3ms to deliver it to the subscriber. 
Using persistence vs non-persistence and async send to subscribers vs sync
does not significantly affect the latency (speeds up by a few ms on

So it seems like MQ is taking upwards of 20ms (on my hardware which is an
IBM x306 series server pentium 4 3GHz machine) to take a STOMP frame and
process it to the point of stamping the message with the timestamp header.
On my lowly Dell Precision workstation it takes about 35-40ms.

Anyone have better STOMP performance or is STOMP performance known to be
slow due to the nature of MQ's STOMP broker having to do the STOMP

Would writing a C extension for PHP that implements the OpenWire protocol
speed things up? (Not that I'm ready to do that, but maybe!)


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message