aspose file tools*
The moose likes Glassfish and the fly likes WebSockets in Glassfish - Scalability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Glassfish
Bookmark "WebSockets in Glassfish - Scalability" Watch "WebSockets in Glassfish - Scalability" New topic
Author

WebSockets in Glassfish - Scalability

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9506
    
    2

I have a WebApp built using the Java WebSocket API and the app is deployed to Glassfish. I however noticed that there will be one instance of a WebSocket Service Endpoint per connection:

http://docs.oracle.com/javaee/7/tutorial/doc/websocket006.htm

How would this then even scale? Let us say, I have millions of requests to my WebSocket Endpoint, this would mean that I have million instances of my WebSocket Endpoint. Is this something to think about? Any suggestions?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42601
    
  65
Millions of objects are a small number for a JVM. Is this a hypothetical problem, or do you have indications that it is an actual problem?

Of course, if you meant "millions of simultaneous connections", then I salute you to the success of your platform, and will point out that you need a server farm to handle the load, no matter how it's implemented.


Ping & DNS - my free Android networking tools app
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9506
    
    2

Ulf Dittmer wrote:Millions of objects are a small number for a JVM. Is this a hypothetical problem, or do you have indications that it is an actual problem?

Of course, if you meant "millions of simultaneous connections", then I salute you to the success of your platform, and will point out that you need a server farm to handle the load, no matter how it's implemented.


Yes, I did mean millions of simultaneous connections per second. I would be stress testing my app soon and would have an indication of how my app behaves. Isn't the Async IO designed to address such a need?
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
You are worrying about a problem you haven't proved to be having. The reason why I'm reluctant to give any suggestions is that typically make up problems like this, google solutions and start applying solutions without verifying that they actually have problems and verifying where their problem actually is. Do the stress test first and find out if you are not meeting the required non functional requirement metrics and if you not meeting them then investigate what is causing that for your application and only then should you consider possible solutions.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9506
    
    2

I'm wiring up some Akka actors to actually stress test my WebSocket connection. Let me see what I get in terms of the responsiveness under heavy load.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WebSockets in Glassfish - Scalability