B4J Question Websockets vs Handlers

prajinpraveen

Active Member
Licensed User
Longtime User
Hello all,

I am deciding between which option to go with between WebSockets and server handler for an enterprise web application.
use case :
User base ?- 300k users.
Concurrent connections expected? - 10% during the day - 30k.
Two-way communication required? Only on the chat page.

What i like about WebSockets is that the entire coding can be done on B4J(using jqueryelement) and not have to code using client side javascript.
Having said that, since WebSockets maintain a connection between the client and the server, is it advisable to use WebSockets?
Do they have any drawbacks, in case if they are used for eg pages like login page, show user info etc.

Using handlers i am able to achieve the same results by making AJAX calls. just that i have to code javascript and all the code is available on the client-side.

Which option would you recommend and if you can please help me understand why?
Can Jetty server handle this volume?

Thank you so much.
 

prajinpraveen

Active Member
Licensed User
Longtime User
Thanks Erel,

What is the maximum recommended concurrent connections for webscokets?
Am I right in saying that Jetty server can handle this volume of concurrent users?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
What is the maximum recommended concurrent connections for webscokets?
We did some tests with jMeter and 500 Concurrent connections per physical server is about the maximum before the app slows down. BUT: concurrent means at EXACTLY the same moment each WebSocket making a call to the server (this means in your chat 500 people press send simultaneous). This does not mean you can't have many more connections to one server (which is probably with you mean with your 30K). I believe the hardware limit (ports) is around 25K per physical server but this can be expanded with load balancing to multiple physical servers. We have tens of thousands users of our WebApp with Websockets on one server and haven't reached the 500 limit by far.

Alwaysbusy
 
Upvote 0

prajinpraveen

Active Member
Licensed User
Longtime User
Thank you Erel and @alwaysbusy. There is always a war in my head of which tech to use. .Net, Php or Jetty
I have always chosen B4J/Jetty. But everytime we start a new project the question keeps poping up. Just making sure we are not half way through the project and realize that we make a mistake.

Thank you gents
 
Upvote 0
Top