I have non-ui b4j server uses jserver library and websocket class and I want to know how much websocket threads can b4j jserver create and keeping it alive at same time.
Thank you Erel, let's say I have a vps and a b4j server running inside it, what should I do or use on b4j server to make it accept millions of connections and keeping it alive at the same time, is this possible by using b4j server that uses jserver library or another library.
This is probably a key element in your question as a server can maximum handle 65536 simultanious TCP sockets per single IP address (not a B4J limitation, just a hardware one).
This would mean you will have to start doing load-balancing over a lot of servers to keep millions of connections open (16 servers per million). Each of the servers will have to run an instance of your jServer app and something like HAProxy will have to be configured to pick one of the available sockets accross all the servers.
This is probably a key element in your question as a server can maximum handle 65536 simultanious TCP sockets per single IP address (not a B4J limitation, just a hardware one).
This would mean you will have to start doing load-balancing over a lot of servers to keep millions of connections open (16 servers per million). Each of the servers will have to run an instance of your jServer app and something like HAProxy will have to be configured to pick one of the available sockets accross all the servers.
This is probably a key element in your question as a server can maximum handle 65536 simultanious TCP sockets per single IP address (not a B4J limitation, just a hardware one).
This would mean you will have to start doing load-balancing over a lot of servers to keep millions of connections open (16 servers per million). Each of the servers will have to run an instance of your jServer app and something like HAProxy will have to be configured to pick one of the available sockets accross all the servers.
If you really had such high demand you would probably be best of using docker containers using AWS, GCP or Azure. I think all of them have load balancers and proxies which can deploy and close docker containers depending on the demand.
If you really had such high demand you would probably be best of using docker containers using AWS, GCP or Azure. I think all of them have load balancers and proxies which can deploy and close docker containers depending on the demand.