Erinc Arikan wrote:
Thanks so much  Emmanuel;

I totally forgot to mention that I am using MINA 2.0 RC1.

I gave it a try and It worked great, I see 2-3 seconds between ack and
response now.
Great !
One thing that I wonder is optimum number of threads for an executor.

For now I set it to 10, But I don't think that I would need more than 2-3
threads at a time for a connection. Do you think that it would affect the
performance drastically when I have 10000 devices connected to my gateway.
I think it does not matter too much, as soon as if your processing is
fast, then the threads will be made available fast enough for other tasks.

Now, if it takes, say, 100 ms to process a request, and if you have 100
simultaneous tasks running, then you definitively need 10 threads
available in the pool (probably a few more in order to avoid
bottlenecks). So if you have 10000 devices doing one request every 5
seconds, and if it costs 100 ms to process a request, the the math is
simple : you will have an average of 200 requests being processed
simultaneously, so you'll need 200 threads. But a 100 ms processing time
is HUGE.

Note : when I say *simultaneous*, it means requests being processed *at
the same time*. (people are often confusing requests per second and
number of requests that can be processed simultaneous at a specific moment).

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Reply via email to