You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Zigor Salvador <zi...@gmail.com> on 2011/10/20 15:37:34 UTC

Perfomance related question...

Hello everyone,

I'm benchmarking a distributed application developed with MINA 2.0.4.

I use a simple text protocol (TextLineCodecFactory over TCP) to transmit JSON formatted messages (Using Jackson 1.9.0) with a payload size of 472 bytes (that is the length of the String I write to the MINA session).

Two applications running on different machines that communicate with said protocol over Gigabit Ethernet achieve a maximum stable throughput of 36.000 events/second (measured by my benchmarking component).

Assuming 20 bytes for IP and another 20 bytes for TCP headers, that is 512 bytes per message so roughly 17.57 MBytes/second.

I was expecting *more* of our Gigabit switch (and this is without any other traffic in the network) so I'm looking for ways to improve performance. The machines have plenty of power (8 core Xeons) and RAM (24 Gb each).

I have used VisualVM to profile the applications and I see that most of the time is spent in NioProcessor.select() followed (quite far) by NioProcessor.write().

Should I understand that there's nothing left for me to do as MINA is taking most of the processing time?

I haven't customized any aspect of MINA (buffer size, thread pool, things like that...).

Any hints would be GREATLY appreciated.

I guess I'm using very small packages that have an impact in the maximum achieved bandwidth. Maybe using a message size closer to the MTU of 1500 bytes would bring total bandwidth up at the cost of a lowered throughput?

Zigor.

Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
Thanks Emmanuel, more comments below.

On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:

> On 10/20/11 3:37 PM, Zigor Salvador wrote:
>> Hello everyone,
>> 
>> I'm benchmarking a distributed application developed with MINA 2.0.4.
>> 
>> I use a simple text protocol (TextLineCodecFactory over TCP) to transmit JSON formatted messages (Using Jackson 1.9.0) with a payload size of 472 bytes (that is the length of the String I write to the MINA session).
>> 
>> Two applications running on different machines that communicate with said protocol over Gigabit Ethernet achieve a maximum stable throughput of 36.000 events/second (measured by my benchmarking component).
>> 
>> Assuming 20 bytes for IP and another 20 bytes for TCP headers, that is 512 bytes per message so roughly 17.57 MBytes/second.

Is the header size assumption correct? (20 bytes for TCP and 20 for IP)

>> 
>> I was expecting *more* of our Gigabit switch (and this is without any other traffic in the network) so I'm looking for ways to improve performance. The machines have plenty of power (8 core Xeons) and RAM (24 Gb each).
> 
> Is it a Linux OS, Windows or MacOS, or anything more exotic ?
> Which Linux flavor ?

Ubuntu 11.10 (64 bit).

>> 
>> I have used VisualVM to profile the applications and I see that most of the time is spent in NioProcessor.select() followed (quite far) by NioProcessor.write().
>> 
>> Should I understand that there's nothing left for me to do as MINA is taking most of the processing time?
>> 
>> I haven't customized any aspect of MINA (buffer size, thread pool, things like that...).
> Should not be necessary at this step.
> 
> What are the CPU metrics on your server ?
>> 
>> Any hints would be GREATLY appreciated.
>> 
>> I guess I'm using very small packages that have an impact in the maximum achieved bandwidth. Maybe using a message size closer to the MTU of 1500 bytes would bring total bandwidth up at the cost of a lowered throughput?
> 
> Each message sent and received on ethernet will use 1500 bytes, even if you transmit only one byte of data. That means for a message being send and a response being provided, you will eat 2 x 1500 bytes. With 36 000 messages sent per second, that is 36 000 x 2 x 1500 =  108 000 000 bytes per second. This will pretty much saturate your Gb ethernet network...

I thought MTU was actually the *maximum* size of the unit...

Anyhow, your calculations have made it clear that I was only taking into account one way throughput/bandwidth (silly me).

The good news is that If ethernet frames have a 1500 byte payload regardless of smaller TCP packets, throughput has already been maxed for this setup. Great!   :-D

> 
> Just try to send a 1500 bytes long messages (actually, less than 1500, I don't remember what is the size of the max payload you can store in a PDU), to see if you can still process 36 000 messages per second. The response must have the same size. If so, you should totally saturate your Gb ethernet, and have the same throughput.

I'll try this next...

Thank you so much!

Zigor.

Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
The number of MINA processors is the default.

Zigor.

On 21 Oct 2011, at 14:37, Emmanuel Lecharny wrote:

> On 10/21/11 2:28 PM, Zigor Salvador wrote:
>> Ok, now that I got the concepts right, I'll get back to testing.
>> 
>> I'll hopefully have data to share next monday.
> 
> I'd also like to know what are the default number of processors you are using (if it's the default, it's up to your nuber of CPU +1).
> FYI, we have as many selectors as the number of declared processors, and a selector is what does the select().
> 
> It should scale quite well. You can also increase the number of processor to see if the throughput is better.
> 
> 
> 
> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
> 


Re: Perfomance related question...

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 10/21/11 2:28 PM, Zigor Salvador wrote:
> Ok, now that I got the concepts right, I'll get back to testing.
>
> I'll hopefully have data to share next monday.

I'd also like to know what are the default number of processors you are 
using (if it's the default, it's up to your nuber of CPU +1).
FYI, we have as many selectors as the number of declared processors, and 
a selector is what does the select().

It should scale quite well. You can also increase the number of 
processor to see if the throughput is better.



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
Ok, now that I got the concepts right, I'll get back to testing.

I'll hopefully have data to share next monday.

THANKS!

Zigor.

On 21 Oct 2011, at 14:24, Emmanuel Lecharny wrote:

> On 10/21/11 12:56 PM, Zigor Salvador wrote:
>> Comments after using Wireshark to sniff on the packets being sent:
>> 
>> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
>> 
>>> Each message sent and received on ethernet will use 1500 bytes, even if you transmit only one byte of data.
>> This is not correct.
> 
> Hmmm, sorry, my bad. I was confused, as MTU where M means *maximum* does not mean the frame *has* to be 1500 bytes long.
> 
> Does it make any difference when you inject smaller messages ?
> 
> Also what's the CPU on your computer ? Does it top to 100% ?
> 
> -- 
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
> 


Re: Perfomance related question...

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 10/21/11 12:56 PM, Zigor Salvador wrote:
> Comments after using Wireshark to sniff on the packets being sent:
>
> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
>
>> Each message sent and received on ethernet will use 1500 bytes, even if you transmit only one byte of data.
> This is not correct.

Hmmm, sorry, my bad. I was confused, as MTU where M means *maximum* does 
not mean the frame *has* to be 1500 bytes long.

Does it make any difference when you inject smaller messages ?

Also what's the CPU on your computer ? Does it top to 100% ?

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
I think this is already taking place in the underlying layers.

In my system, with Nagle's algorithm enabled (default MINA configuration) several MINA messages (albeit small ones, of course) get packed into a single Ethernet frame.

Zigor.

On 21 Oct 2011, at 14:31, Alex Karasulu wrote:

> On Fri, Oct 21, 2011 at 2:12 PM, Emmanuel Lecharny <el...@gmail.com>wrote:
> 
>> On 10/21/11 12:56 PM, Zigor Salvador wrote:
>> 
>>> Comments after using Wireshark to sniff on the packets being sent:
>>> 
>>> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
>>> 
>>> Each message sent and received on ethernet will use 1500 bytes, even if
>>>> you transmit only one byte of data.
>>>> 
>>> This is not correct.
>>> 
>>> Using MINA's "no delay" option and sending around 439 bytes of data the
>>> Ethernet frame captured by Wireshark reports a total frame length of 505
>>> bytes.
>>> 
>> 
>> That does not change the fact that Ethernet frames are 1500 bytes long...
>> 
>> 
>>> (505 = 6 (MAC) + 6 (MAC) + 2 (Type) + 20 (IP header) + 32 (TCP header) +
>>> 439 (data))
>>> 
>>> If I enable Nagle's algorithm, several messages get crammed into a single
>>> ethernet frame (up to the aforementioned MTU value).
>>> 
>> Nagle algorithm is not a good idea for small messages, as you will have a
>> delay between each messages, the system waiting for some more bytes to fill
>> the PDU as much as it can before sending it to the client.
>> 
>> It's usefull when sending big data, though.
>> 
>> 
> Wondering if MINA can get a little smarter. Just a brain dump here .... what
> if you know according to the protocol that you're going to get a certain
> train of responses. Maybe there's a way to buffer and dump to fill to MTU
> capacity?
> 
> -- 
> Best Regards,
> -- Alex


Re: Perfomance related question...

Posted by Antonio Rodriges <an...@gmail.com>.
Hello,

Simple cacls for 1Gbit network yields about 131 KBytes/ms at max performance
while ping (our network) yields about 28KB/ms (our network) what is
4.6 times slower.

Seems that the most delays lie in untuned network itself rather than
Mina settings.

Re: Perfomance related question...

Posted by Emmanuel Lécharny <el...@apache.org>.
On 12/18/11 9:33 AM, Zigor Salvador wrote:
> Hi Emmanuel,
>
> On 17 Dec 2011, at 21:14, Emmanuel Lecharny wrote:
>
>> What about using more IoProcessor instead ?  Have you tried this approach ?If so, what was the result ?
> Well, I found this in the documentation of SimpleIoProcessorPool:
>
> "Most current transport implementations use this pool internally to perform better in a multi-core environment, and therefore, you won't need to use this pool directly unless you are running multiple IoServices in the same JVM."
>
> So I never gave it a try. Maybe if someone could point me to an example that shows the right way to increase the number of IoProcessors, I could give it a try.
If you use more than one Selector, what will happen is that the sessions 
will be spread over all the selectors, which means it might scale 
better, without having to use an executor higher in the chain (having an 
executor induces some complex issues with the session/thread affinity, 
like you may have one session being executed by more than one thread).

I don't know if it really impacts the performances though. Now, if your 
application is really CPU intensive, then having an executor is the 
guaranteed way to be able to process more sessions concurrently, except 
that up to a point, if you already have reached 100%CPU, there is 
nothing you can do to improve the performances :)

The only possible way to improve the throughput (not the performance) 
would be to be able to determinate which message will concume CU, and 
dedicate a pool of thread for them, and let the other messages being 
processed by some other threads (assuming there is a upper limit of 
thread you can create).

Bottom line : there is no rule here, it's all about tuning and 
experimenting :)


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
Hi Emmanuel,

On 17 Dec 2011, at 21:14, Emmanuel Lecharny wrote:

> What about using more IoProcessor instead ?  Have you tried this approach ?If so, what was the result ?

Well, I found this in the documentation of SimpleIoProcessorPool:

"Most current transport implementations use this pool internally to perform better in a multi-core environment, and therefore, you won't need to use this pool directly unless you are running multiple IoServices in the same JVM."

So I never gave it a try. Maybe if someone could point me to an example that shows the right way to increase the number of IoProcessors, I could give it a try.

Anyway, the number of cores in the system is used to determine the size of the standard thread pool, right?

Regards,

Zigor.

Re: Perfomance related question...

Posted by Emmanuel Lecharny <el...@gmail.com>.
Hi Zigor,

On 12/17/11 8:50 PM, Zigor Salvador wrote:
> Hi,
>
> On 17 Dec 2011, at 11:05, Antonio Rodriges wrote:
>
>> Hello, Zigor,
>>
>> It is interesting to know the end of the story :)
> The story never ends! Just kidding...
>
>> We also have application on Mina2.0.4
>> in the latest test we reached almost 100 Mbit output from a single
>> server on 1GBit network We transfer about 40KBytes per query and have
>> about 90 000 queries processed in 5 minutes However to execute the
>> query some data must be read from disk, so maybe that speed is ok
> Well, I have been using Mina to build an (experimental) publish/subscribe subscribe system. I have been measuring communication metrics (latency and throughput) with varying degrees of traffic and overall workload... You have to take into account that my numbers focus in the performance of our system under load (which I increase progressively in order to bring it down to its knees). Therefore, I'm not completely sure about the relevancy of my data for prospective Mina users.
>
> Anyway, the messages I exchange are pretty small (200-300 bytes) and they contain JSON text that is transported by the TextLineCodec over TCP. The system has been benchmarked in a cluster we have at our university, with pretty powerful machines over a very effective Cisco Gigabit switch. After several tweaks and corrections, the system manages to transfer up to 30K events from the client to the server and back. So that's some 60K * 250 = 15.000.000 bytes/sec or 14.3 MBytes/sec. That's with no background traffic and in "ideal" conditions from the point of view of the publish/subscribe application.

Interesting !
>
> Taking into account that I have the TCP "nodelay" flag enabled (which is not the best idea if you want to achieve high throughput) and that my messages are very small, I'm happy with the performance.
>
> BTW, adding an ExecutorFilter to the chain helped spread load over the many cores of the machines, as my application is pretty CPU bound.

What about using more IoProcessor instead ?  Have you tried this 
approach ?If so, what was the result ?


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
Hi,

On 17 Dec 2011, at 11:05, Antonio Rodriges wrote:

> Hello, Zigor,
> 
> It is interesting to know the end of the story :)

The story never ends! Just kidding...

> We also have application on Mina2.0.4
> in the latest test we reached almost 100 Mbit output from a single
> server on 1GBit network We transfer about 40KBytes per query and have
> about 90 000 queries processed in 5 minutes However to execute the
> query some data must be read from disk, so maybe that speed is ok

Well, I have been using Mina to build an (experimental) publish/subscribe subscribe system. I have been measuring communication metrics (latency and throughput) with varying degrees of traffic and overall workload... You have to take into account that my numbers focus in the performance of our system under load (which I increase progressively in order to bring it down to its knees). Therefore, I'm not completely sure about the relevancy of my data for prospective Mina users.

Anyway, the messages I exchange are pretty small (200-300 bytes) and they contain JSON text that is transported by the TextLineCodec over TCP. The system has been benchmarked in a cluster we have at our university, with pretty powerful machines over a very effective Cisco Gigabit switch. After several tweaks and corrections, the system manages to transfer up to 30K events from the client to the server and back. So that's some 60K * 250 = 15.000.000 bytes/sec or 14.3 MBytes/sec. That's with no background traffic and in "ideal" conditions from the point of view of the publish/subscribe application. 

Taking into account that I have the TCP "nodelay" flag enabled (which is not the best idea if you want to achieve high throughput) and that my messages are very small, I'm happy with the performance.

BTW, adding an ExecutorFilter to the chain helped spread load over the many cores of the machines, as my application is pretty CPU bound.

Zigor.


Re: Perfomance related question...

Posted by Antonio Rodriges <an...@gmail.com>.
Hello, Zigor,

It is interesting to know the end of the story :)

We also have application on Mina2.0.4
in the latest test we reached almost 100 Mbit output from a single
server on 1GBit network We transfer about 40KBytes per query and have
about 90 000 queries processed in 5 minutes However to execute the
query some data must be read from disk, so maybe that speed is ok

Re: Perfomance related question...

Posted by Alex Karasulu <ak...@apache.org>.
On Fri, Oct 21, 2011 at 4:16 PM, Julien Vermillard <jv...@gmail.com>wrote:

> On Fri, Oct 21, 2011 at 2:31 PM, Alex Karasulu <ak...@apache.org>
> wrote:
> > On Fri, Oct 21, 2011 at 2:12 PM, Emmanuel Lecharny <elecharny@gmail.com
> >wrote:
> >
> >> On 10/21/11 12:56 PM, Zigor Salvador wrote:
> >>
> >>> Comments after using Wireshark to sniff on the packets being sent:
> >>>
> >>> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
> >>>
> >>>  Each message sent and received on ethernet will use 1500 bytes, even
> if
> >>>> you transmit only one byte of data.
> >>>>
> >>> This is not correct.
> >>>
> >>> Using MINA's "no delay" option and sending around 439 bytes of data the
> >>> Ethernet frame captured by Wireshark reports a total frame length of
> 505
> >>> bytes.
> >>>
> >>
> >> That does not change the fact that Ethernet frames are 1500 bytes
> long...
> >>
> >>
> >>> (505 = 6 (MAC) + 6 (MAC) + 2 (Type) + 20 (IP header) + 32 (TCP header)
> +
> >>> 439 (data))
> >>>
> >>> If I enable Nagle's algorithm, several messages get crammed into a
> single
> >>> ethernet frame (up to the aforementioned MTU value).
> >>>
> >> Nagle algorithm is not a good idea for small messages, as you will have
> a
> >> delay between each messages, the system waiting for some more bytes to
> fill
> >> the PDU as much as it can before sending it to the client.
> >>
> >> It's usefull when sending big data, though.
> >>
> >>
> > Wondering if MINA can get a little smarter. Just a brain dump here ....
> what
> > if you know according to the protocol that you're going to get a certain
> > train of responses. Maybe there's a way to buffer and dump to fill to MTU
> > capacity?
> >
> > --
> > Best Regards,
> > -- Alex
> >
> It's not a kernel level matter ? to fill the packet to MTU limit using
> Naggle ?
>

Yes it is however if MINA at higher levels can pump more into the buffer
WITHOUT Naggle then you have a greater chance at filling to MTU.

Was just wondering if anticipating in advance what a response would look
like might help devise smarter buffering that leads to filling to MTU. I
might be pulling this out of my arse here .. as I said it's just a brain
dump. Maybe we're already doing as much as we possibly can.

-- 
Best Regards,
-- Alex

Re: Perfomance related question...

Posted by Julien Vermillard <jv...@gmail.com>.
On Fri, Oct 21, 2011 at 2:31 PM, Alex Karasulu <ak...@apache.org> wrote:
> On Fri, Oct 21, 2011 at 2:12 PM, Emmanuel Lecharny <el...@gmail.com>wrote:
>
>> On 10/21/11 12:56 PM, Zigor Salvador wrote:
>>
>>> Comments after using Wireshark to sniff on the packets being sent:
>>>
>>> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
>>>
>>>  Each message sent and received on ethernet will use 1500 bytes, even if
>>>> you transmit only one byte of data.
>>>>
>>> This is not correct.
>>>
>>> Using MINA's "no delay" option and sending around 439 bytes of data the
>>> Ethernet frame captured by Wireshark reports a total frame length of 505
>>> bytes.
>>>
>>
>> That does not change the fact that Ethernet frames are 1500 bytes long...
>>
>>
>>> (505 = 6 (MAC) + 6 (MAC) + 2 (Type) + 20 (IP header) + 32 (TCP header) +
>>> 439 (data))
>>>
>>> If I enable Nagle's algorithm, several messages get crammed into a single
>>> ethernet frame (up to the aforementioned MTU value).
>>>
>> Nagle algorithm is not a good idea for small messages, as you will have a
>> delay between each messages, the system waiting for some more bytes to fill
>> the PDU as much as it can before sending it to the client.
>>
>> It's usefull when sending big data, though.
>>
>>
> Wondering if MINA can get a little smarter. Just a brain dump here .... what
> if you know according to the protocol that you're going to get a certain
> train of responses. Maybe there's a way to buffer and dump to fill to MTU
> capacity?
>
> --
> Best Regards,
> -- Alex
>
It's not a kernel level matter ? to fill the packet to MTU limit using Naggle ?

Re: Perfomance related question...

Posted by Alex Karasulu <ak...@apache.org>.
On Fri, Oct 21, 2011 at 2:12 PM, Emmanuel Lecharny <el...@gmail.com>wrote:

> On 10/21/11 12:56 PM, Zigor Salvador wrote:
>
>> Comments after using Wireshark to sniff on the packets being sent:
>>
>> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
>>
>>  Each message sent and received on ethernet will use 1500 bytes, even if
>>> you transmit only one byte of data.
>>>
>> This is not correct.
>>
>> Using MINA's "no delay" option and sending around 439 bytes of data the
>> Ethernet frame captured by Wireshark reports a total frame length of 505
>> bytes.
>>
>
> That does not change the fact that Ethernet frames are 1500 bytes long...
>
>
>> (505 = 6 (MAC) + 6 (MAC) + 2 (Type) + 20 (IP header) + 32 (TCP header) +
>> 439 (data))
>>
>> If I enable Nagle's algorithm, several messages get crammed into a single
>> ethernet frame (up to the aforementioned MTU value).
>>
> Nagle algorithm is not a good idea for small messages, as you will have a
> delay between each messages, the system waiting for some more bytes to fill
> the PDU as much as it can before sending it to the client.
>
> It's usefull when sending big data, though.
>
>
Wondering if MINA can get a little smarter. Just a brain dump here .... what
if you know according to the protocol that you're going to get a certain
train of responses. Maybe there's a way to buffer and dump to fill to MTU
capacity?

-- 
Best Regards,
-- Alex

Re: Perfomance related question...

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 10/21/11 12:56 PM, Zigor Salvador wrote:
> Comments after using Wireshark to sniff on the packets being sent:
>
> On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:
>
>> Each message sent and received on ethernet will use 1500 bytes, even if you transmit only one byte of data.
> This is not correct.
>
> Using MINA's "no delay" option and sending around 439 bytes of data the Ethernet frame captured by Wireshark reports a total frame length of 505 bytes.

That does not change the fact that Ethernet frames are 1500 bytes long...
>
> (505 = 6 (MAC) + 6 (MAC) + 2 (Type) + 20 (IP header) + 32 (TCP header) + 439 (data))
>
> If I enable Nagle's algorithm, several messages get crammed into a single ethernet frame (up to the aforementioned MTU value).
Nagle algorithm is not a good idea for small messages, as you will have 
a delay between each messages, the system waiting for some more bytes to 
fill the PDU as much as it can before sending it to the client.

It's usefull when sending big data, though.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Perfomance related question...

Posted by Zigor Salvador <zi...@gmail.com>.
Comments after using Wireshark to sniff on the packets being sent:

On 20 Oct 2011, at 16:10, Emmanuel Lecharny wrote:

> Each message sent and received on ethernet will use 1500 bytes, even if you transmit only one byte of data.

This is not correct.

Using MINA's "no delay" option and sending around 439 bytes of data the Ethernet frame captured by Wireshark reports a total frame length of 505 bytes.

(505 = 6 (MAC) + 6 (MAC) + 2 (Type) + 20 (IP header) + 32 (TCP header) + 439 (data))

If I enable Nagle's algorithm, several messages get crammed into a single ethernet frame (up to the aforementioned MTU value).

Just thought I'd share my findings...

Zigor.

Re: Perfomance related question...

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 10/20/11 3:37 PM, Zigor Salvador wrote:
> Hello everyone,
>
> I'm benchmarking a distributed application developed with MINA 2.0.4.
>
> I use a simple text protocol (TextLineCodecFactory over TCP) to transmit JSON formatted messages (Using Jackson 1.9.0) with a payload size of 472 bytes (that is the length of the String I write to the MINA session).
>
> Two applications running on different machines that communicate with said protocol over Gigabit Ethernet achieve a maximum stable throughput of 36.000 events/second (measured by my benchmarking component).
>
> Assuming 20 bytes for IP and another 20 bytes for TCP headers, that is 512 bytes per message so roughly 17.57 MBytes/second.
>
> I was expecting *more* of our Gigabit switch (and this is without any other traffic in the network) so I'm looking for ways to improve performance. The machines have plenty of power (8 core Xeons) and RAM (24 Gb each).

Is it a Linux OS, Windows or MacOS, or anything more exotic ?
Which Linux flavor ?
>
> I have used VisualVM to profile the applications and I see that most of the time is spent in NioProcessor.select() followed (quite far) by NioProcessor.write().
>
> Should I understand that there's nothing left for me to do as MINA is taking most of the processing time?
>
> I haven't customized any aspect of MINA (buffer size, thread pool, things like that...).
Should not be necessary at this step.

What are the CPU metrics on your server ?
>
> Any hints would be GREATLY appreciated.
>
> I guess I'm using very small packages that have an impact in the maximum achieved bandwidth. Maybe using a message size closer to the MTU of 1500 bytes would bring total bandwidth up at the cost of a lowered throughput?
Each message sent and received on ethernet will use 1500 bytes, even if 
you transmit only one byte of data. That means for a message being send 
and a response being provided, you will eat 2 x 1500 bytes. With 36 000 
messages sent per second, that is 36 000 x 2 x 1500 =  108 000 000 bytes 
per second. This will pretty much saturate your Gb ethernet network...

Just try to send a 1500 bytes long messages (actually, less than 1500, I 
don't remember what is the size of the max payload you can store in a 
PDU), to see if you can still process 36 000 messages per second. The 
response must have the same size. If so, you should totally saturate 
your Gb ethernet, and have the same throughput.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com