Home Help Center

Can I increase the number of simultaneous connections by increasing ThreadPool.Size?

As we all know, Ice predefined 1024 as FD_SETSIZE, which means there're at most 1024 simultaneous connections for one internal select call. When I want more connections at the same time, could I specify Server.ThreadPool.Size to 2 to obtain 2048 simultaneous connections?

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    AFAIK, Ice doesn't define any value for FD_SETSIZE: the default value defined by the operating system C library is used. Increasing the number of threads won't affect the maximum number of connections the select() system call can handle.

    If you want a single server to handle more than 1024 clients, you could create multiple object adapters and have the different clients to connect to one of the server object adapters. The problem with this solution is that you'll have a monolithic server that is perhaps capabable of handling many client connections but perhaps not capable of handling the load caused by the clients invoking on the server...

    A more scalable solution would be to distribute your application over several processes: frontend processes to concentrate the client connections and backend processes to process client requests. With such an architecture, you can easily handle an increasing number of clients by simply adding more processes (and eventually server machines). Please see [thread=485]this thread[/thread] for a similar discussion.

    Note also that Ice provides active connection management to ensure that iddle connections from clients are automatically closed. Also, I believe some OS allow to increase the value of FD_SETSIZE -- it might be possible to increase this limit in the Ice source code.

    Benoit.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Actually, one of my colleague pointed out that we actually define FD_SETSIZE to 1024 on Windows (in the preprocessor settings of the Ice project file). Assuming you're using Windows, you could try to increase this value and recompile Ice.

    Benoit.
Sign In or Register to comment.