Thank you for your prompt response. On Thu, Feb 10, 2011 at 9:19 PM, Emmanuel Lecharny <[email protected]>wrote:
> Well, not switching would be a major mistake. 2.0.0-M6 is frankly buggy, > and you may face an issue every now and then... > Ok. > >> Probably because your client has disconnected. There is no way for the > TCP stack to know that a client brutally shutdown its computer. You have to > deal with idle connections on the server side. > > It's not actually computer, it's rather a handset device. But I got your point. in sessionIdle() we have the client removed after 60 seconds of inactivity. the protocol have ping / heartbeat to make sure the connection is still active. > step #2 is related with database, we find the average time required is >> very >> acceptable (less than 100ms) >> > > 100ms ?? Whaooohhh. This is incredibly high ! I would expect a DB to be > able to process a request in less than 10ms... > Actually a lot lesser than 100ms, maybe close to 10ms. I'm just being humble :) But I admit there's plenty of room for improvement in DB area. > Let's do some maths here : > - average response time : 100ms > - number of IoProcessor is N > - number of concurrent users is 600 > > so you need N = 600 * 0.1 --> 60 IoProcessor to handle the load. This is > just HUGE. > In other words, with a 100ms average processing time, you can't deliver more > than 10 req/s on a single IoProcessor, unless you added an Executor filter > in the chain. > > the maximum concurent user ever recorded was 600 something when the >> problem >> starts to occure >> > Concurrent users != concurrent requests. How many request per second are > you trying to process when the problem occurs ? > Most of the user only perform heartbeat every 30 sec. at best it's only 20 request per sec, worst 600 doing ping at the same time (unlikely tough) ? Adding sending message and other request .. it's likely average 30 request / sec. Am I doing my calculation right ? > Also how many IoProcessor do you use, how many core do you have on your > server, what is the internal network bandwith ? > > I'm using this code to create my socketAcceptor. chatAcceptor = new NioSocketAcceptor(Runtime.getRuntime().availableProcessors() + 1) The server is quad core with gigabit ethernet (only one interface connected to network carrier, the other interface serve for LAN) >> The first step is to discover where is your bottleneck. Is it the DB ? > MINA ? Your application ? > > I think my application is the bottleneck. For your explanation above, related with the executor chain. What i should do in order to improve the number of request for each IoProcessor ? I admit my understanding for MINA and Executor is still basic. I'll spend more time to read that section after this. Thanks again for your quick response.
