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
--
-----------
Bobby R. Harsono
Software Developer
Tricada Intronik - Bandung