[rabbitmq-discuss] Steady performance degradation
Philippe Kirsanov
pkirsanov at 38studios.com
Fri Sep 25 22:29:25 BST 2009
The jar includes all dependencies.
I can't send source code, only jar. But this is a code:
Publisher:
messageProperties.messageId = utils.generateUUIDasBase64 //random
UUID
messageProperties.expiration = System.currentTimeMillis.toString
channel.basicPublish ( exchName, routingKey, messageProperties , msg )
Consumer:
private val tag = channel.basicConsume ( queueName, noAck,
new DefaultConsumer ( channel ) {
override def handleDelivery ( tag : String, env :
Envelope, props : AMQP.BasicProperties, body : Array [ Byte ] ) = {
if ( brokerConfig.trackMsg ) {
val now = System.currentTimeMillis
val than = props.expiration.toLong
actor {
statTracker.update ( now - than
)
}
}
cons ! newMessage ( body, env, props )
}
}
)
Ack happens in the Actor that handles message before message is
processed
This Actor Ack message and send it for processing to another Actor
react {
case msg @ newMessage ( m, e, p ) => {
a ! msg // send message for processing in different
Actor(Thread)
try {
channel.basicAck ( e.getDeliveryTag, false )
}
catch
{
case e : AlreadyClosedException => exit
case e : java.net.SocketException => exit
}
act
}
}
And this is actual worker that handles message, message should be
already ack by this time:
receive {
case msg @ newMessage ( m, e, p ) => handler ( m, e, p )
}
I will send jar directly
-----Original Message-----
From: Matthias Radestock [mailto:matthias at lshift.net]
Sent: Friday, September 25, 2009 15:21
To: Philippe Kirsanov
Cc: rabbitmq-discuss at lists.rabbitmq.com
Subject: Re: [rabbitmq-discuss] Steady performance degradation
Philippe,
Philippe Kirsanov wrote:
> One of the test was to run steady load (about 500 messages per second)
> over long period of time.
>
> I noticed that performance steadily going down to 100-200
messages/sec,
> resetting client (kill/start process) restores performance.
can you post your code so we can try to reproduce this?
Regards,
Matthias.
More information about the rabbitmq-discuss
mailing list