Hi,
hard to tell.
Have you profiled your application? Are you CPU bound? If not, you
should probably increase the default number of threads capable of
handling the incoming messages (it defaults to Nb cores + 1 )
On 16/01/2024 09:04, Bobby R. Harsono wrote:
Hi all,
Im using Mina 2.2.3 to build a UDP Server,
Currently, i implemented one IoHandlerAdapterclass, lets call this
MainHandlerAdapter, inside i have plenty of variables of custom
instance; Several of them are @Autowired on the parent class and when
creating UDP Server i set them through constructor.
In the end of processing, i use KafkaProducer class to send event to
kafka topic. All is fine and well, until i found leaked threads, i fixed
this by
1. supplying custom threadpool executor in acceptor=
newNioDatagramAcceptor(IOExecutor.get());
2. removing @Async on my send() method in KafkaProducer - this way,
will not spawn any more threads
3. made MainHandlerAdapter threaded,
4. supply executor in filterchainbuilder -> DefaultIoFilterChainBuilder
chain = acceptor.getFilterChain();
chain.addLast("threadPool", new
ExecutorFilter(Executors.newCachedThreadPool()));
The thread leaked is no more but there is another problem,
My UDP Listener received around 500k TPS, an instance deployed in K8 can
handle around 30-50k TPS but when measuring with core utilizing, 1 core
only handled around 1-4k TPS, this is very low compared to another
component (not using Mina) that achieved minn 8k TPS
Are there any suggestions how to improve my UDP Server performance ??
Another problem is when i increased deployment pod, no significant tps
improved
--
*Emmanuel Lécharny* P. +33 (0)6 08 33 32 61
elecha...@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@mina.apache.org
For additional commands, e-mail: users-h...@mina.apache.org