Minimize Tomcat memory per connection

I created my own message server in Java, which receives a message flow and delivers each message to its client (1: 1, drop msg if not connected - very simple). I run Tomcat 7 on Win7x64 and Java 7 and use the NIO connector (implemented by the Comet servlet). It works fine, but now I'm studying the scaling of this beast and currently see about 85 KB of RAM allocated for each connected client. 10,000 customers @ under 900 MB and scaling linearly. (I am not doing anything yet, but I am maintaining a connection). This is quite a lot for my opinion, so I wonder if there are any tricks to make Tomcat or Java save more memory using NIO impl. All the Tomcat settings I've tried so far have not affected this at all.

Does anyone have any experience how to put Java or Tomcat on a memory diet regarding socket connections?

UPDATE: I am now below 70 kb / connection, trimming socket buffers and some other tomcat internal elements. Not sure how this affects bandwidth. I also tried this on 32bit / 64bit Linux with the same result.

+5
source share
1 answer

After quite some research and games, I came to the conclusion that with Tomcat it is simply impossible to cope with a huge number of simultaneous connections with a reasonable amount of memory. (I would still be happy if I were wrong here)

However, there is a savior:

Netty: http://www.jboss.org/netty/downloads

Java IO, NIO Java . -- TCP- .

loadtest EC2 7 @ 1,5 ! (, tomcat, , , , , mem, 200 / " " - !) , Java VM 1,5 , , C10M .

Netty Java VM! .

+1

All Articles