Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WebSockets in Glassfish - Scalability

 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 989
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic