<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">We are new to rabbitMQ. We use rabbitmq 3.1.5 in our test environment.�This is installed on a red hat linux server (6.4), the same server where our application is also running. The database (postgresql) is on a separate server. </font></font></p>

<div style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">We are using rabbitMQ default configuration. </font></font></div>
<div style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">I ran a test where concurrent users post to a rest service (say R). This service basically expects <span style>�</span>two UUIDs (UUID_A and UUID_B), that identify two database entities <span style>�</span>A and B. Once the service is called with these two values, it publishes to the default exchange. </font></font></div>

<div style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">There are two durable queues bound to this exchange. QueueA and QueueB. Two services,<span style>� </span>Service A and Service B, each listen on QueueA and QueueB respectively.<span style>� </span>There are no other consumers to these queues. Service A picks up the message and validates<span style>� </span>UUID_A exists in the database. Service B validates UUID_B exists. If they are both valid, an entry is made to the db, mapping these two values. So each valid post results in an entry in a table in the db.</font></font></div>

<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">I find as the test progresses, response <span style>�</span>time of this post increases.<span style>� </span>A lot of the time is being spent in<span style>� </span>Unsafe.park (boolean,long)<span style>� </span>in sun.misc package. </font></font></p>

<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">Here is the call stack that shows classes where this Unsafe.park() is being involved from. It appears to be called from spring framework�s RabbitTemplate class.</font></font></p>

<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">Unsafe.park</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style>�</span>LockSupportparkNanos(Object,Long)</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style>��<strong> </strong></span><strong>AbstractQueuedSynchronizer$ConditionObject.awaitNanos(long)</strong></font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style>���� </span>ArrayBlockingQueue.poll(long, TimeUnit)</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style>������� </span>RabbitTemplate$3.doInRabbit(Channel)</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style>���������� </span>RabbitTemplate$3.doInRabbit(Channel)</font></font></p>
<p style="MARGIN:0in 0in 0pt 0.5in" class="MsoListParagraphCxSpFirst"><font size="3"><font face="Calibri">RabbitTemplate.execute(ChannelCallback)</font></font></p>
<p style="MARGIN:0in 0in 0pt 0.5in" class="MsoListParagraphCxSpMiddle"><font size="3"><font face="Calibri"><span style>��<strong> </strong></span><strong>RabbitTemplate.doSendAndReceiveWithTemporary(String,String,Message)</strong></font></font></p>

<p style="MARGIN:0in 0in 0pt 0.5in" class="MsoListParagraphCxSpMiddle"><font size="3"><font face="Calibri"><span style>����� </span>RabbitTemplate.doSendAndReceive(String,String,Message)</font></font></p>
<p style="MARGIN:0in 0in 10pt 0.5in" class="MsoListParagraphCxSpLast"><font size="3"><font face="Calibri"><span style>�������� </span>RabbitTemplate.convertSendAndReceive(String,String,Object, MessagePostProcessor)</font></font></p>

<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"><span style>��������������������������� </span>RabbitTemplate.convertSendAndReceive(String,Object)</font></font></p>
<p style="TEXT-INDENT:0.25in;MARGIN:0in 0in 10pt 0.75in" class="MsoNormal"><font size="3"><font face="Calibri">�</font></font></p>
<p style="TEXT-INDENT:0.5in;MARGIN:0in 0in 10pt 0.25in" class="MsoNormal"><font size="3"><font face="Calibri"><span style>���������� </span>�</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><span style></span></p>
<div style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">As the test progresses where the load increases from 50 users to 200 users over a period of 20 mins, this response time increases from 50 ms to almost 2 seconds. 99% of the response time is spent in Unsafe.park (waiting).� At the end of 20 mins, roughly 100,000 entries are made into the db.That is roughly�83 Posts (i.e messages) per second. Each message contains a couple of UUIDs and a couple of dates. There is no other activity on this server.</font></font></div>

<div style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri"></font></font><font size="3"><font face="Calibri">Why is there so mcuh time being spent in Unsafe.park() ? It looks like there is a wait for some resource lock. How can we reduce this wait ?� Overall CPU is about 40-45% on this box (a 12 core server). 2/3rds of this time is being spent in the rabbitMQ server.</font></font></div>

<div style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">Is there a�plug-in to monitor cpu usage on the server? How can�we determine where time is being spent within the�broker ?</font></font></div>

<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">Thanks,</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3"><font face="Calibri">tgv</font></font></p>
<p style="MARGIN:0in 0in 10pt" class="MsoNormal"><font size="3" face="Calibri">�</font></p>