(Sorry for my pre mature email an hour ago - my mistake)

 

Hi all,

I'm using Mina 2.0.2 for my server which, in the nutshell, is a very
simple server that acts as a message server, clients connect to the
server in order to send and receive messages.

I expect up to 200 clients to connect to the server concurrently and the
messages might be big (up to few hundred Megs a message).

 

The ProtocolCodecFilter does an expensive process much more than the
handler, it is the ProtocolCodecFilter duty to read & persist incoming
messages, same goes for sending messages - the  codec is responsible to
read the message from the disk and send it.

 

I wonder where is best to place the ExecutorFilter? Is it before the
ProtocolCodecFilter or after? It seems to me that given what I explained
before I should use two executorFilters one to be placed before the
codec to digest incoming messages and the other after (for the sake of
the outgoing messages). 

 

chain.addLast("sslFilter", sslFilter)

chain.addLast("logger", new LoggingFilter())

chain.addLast("readPool", new ExecutorFilter(coreSize,
maxSize,keepAliveTime, TimeUnit.MILLISECONDS,
IoEventType.MESSAGE_RECEIVED))

chain.addLast("codec", protocolCodecFilter)

chain.addLast("writePool", new ExecutorFilter(coreSize,
maxSize,keepAliveTime, TimeUnit.MILLISECONDS, IoEventType.WRITE))

 

Can you please approve that using the above chaining is best for my
needs?

 

Emmanuel, I read once your reservation about placing the executor first,
you said: "...as the executor is the fist one in the filters chain, you
may not be able to deal with fragmented messages"

Can you explain what did you mean fragmented messages? 

And in other post you said " Executor can leads to some issue if you are
under heavy load " can you elaborate on that? Taking into consideration
these comments of yours what is the best approach in case of heavy load?

 

Thanks in advance,

Guy

Reply via email to