Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there a practical limit of clients that a UDP server can simultaneously handle?
    primarykey
    data
    text
    <p>My game requires a lobby where players will gather before being assigned a dedicated/separate server where they will actually play the game. This lobby is rather trivial and the only operations there are Login, Ping, StartGame. The server needs to keep only basic information about a client, is he logged in or not, but not much other resources.</p> <p>I have done some tests with a simple TCP server, and I can support a maximum of about 10000 connections before the overhead gets me. So, to support 100000 players I will need to deploy a server farm, at least 10 machines, and on top add synchronization between the servers...</p> <p>I was looking into possibility of doing the same using UDP. I am not worried about connectionless or unreliable nature of UDP, I understand this, and there is plenty of UDP vs TCP articles. My question is practical/architectural in nature. In the above scenario, what is the practical limit, how many packets per second can a single UDP server handle? Is it realistic to expect that a UDP server can handle 100000 packets per second? Which machine? Anything that Amazon EC2 can offer.</p> <p>Any insight or further reading will be highly appreciated.</p> <p><strong>EDIT:</strong> Comments suggest I can get unlimited (100000+) TCP connections... I must be missing something, but, can anyone make the code below get to 100000 connections. </p> <pre><code>public class Server { public static void main(String[] args) { System.out.println("Listening..."); try { ServerSocket ss = new ServerSocket(22222); ArrayList&lt;Socket&gt; sockets = new ArrayList&lt;Socket&gt;(); while (true) { sockets.add(ss.accept()); if (sockets.size() % 100 == 0) { System.out.println(String.format("Received %d connections.", sockets.size())); } } } catch (IOException e) { e.printStackTrace(); } } } </code></pre> <p>and</p> <pre><code>public class Client { public static void main(String[] args) { ArrayList&lt;Socket&gt; sockets = new ArrayList&lt;Socket&gt;(); try { while (true) { sockets.add(new Socket("localhost", 22222)); } } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload