powered by Jive Software

Nonblocking SocketChannel in JiveMessenger

http://www.jivesoftware.org/forums/thread.jspa?threadID=14563&tstart=0

I fixed the SocketReadThread, SocketAcceptThread, ConnectionManagerImpl and added some new Classes in org.messenger.net package. I didn’'t change the XML Parser, but I replaced the old XMLReader and XMLWriter by some new ByteChannelReader and ByteChannelWriter Classes, Now I have a series of non-blocking socket handling classes.

I tested the modified JiveMessenger on Windows 2000 OS with my PC(intel 2.4G CPU, 1G memory). When I got over 5,000 simultaneous users, the server is fine, just CPU is full usage, memory usage is just about about 300m. it is exciting, when I used the original JiveMessenger, I only got about 3,000 users, and memory usage was much more. Now, I think if I have a more power machine(maybe, multi CPU), I will got over 20,000 users. I will test the case when I have a situation.

I believe I can do more things about server optimized, Now I used one thread for 50 socket connection, and I did a very simple thread pool.

, I desired any good advices from you, thanks.

dunal,

That sounds exciting. Would you be interested in putting together your changes for possible inclusion with the official code base? I’‘d be most interested in having the code setup so that it’'s possible for users to switch between standard IO and NIO with a config file change. That way, people can gradually switch to NIO as its stability becomes more proven.

Also, did you hand-code the NIO changes or use one of the NIO frameworks? There’‘s a few good NIO tricks that I’'ve read about like always trying to read data twice in a row before giving up and returning a selector.

Regards,

Matt

I would contribute my changes for a reference, this way, I believe the changes will be better and more stable. Now, I just finished non-ssl non-blocking socket, with javax.net.SSLEngine we can do ssl, too.

at the start, I wanted to code new Reader and Writer, but I found jaxlib on sourceforge.net, so I fixed jaxlib.io.stream.InputXStreamReader, then I used his ByteChannelReader(extends InputXStreamReader) and ByteChannelWriter classes.

next, I will test the non-blocking JiveMessenger for max simultanous user number, and continue to delve the Cluster issue.

Sounds good. Feel free to send me an email with your changes and I’'d be happy to provide feedback.

Regards,

-Matt

good idea !

but i don’'t know for cluster config

<<I tested the modified JiveMessenger on Windows 2000 OS with my PC(intel <<2.4G CPU, 1G memory).

This is only one , what about cluster config with many server