Maximum number of socket connections?

Hi there,
I've done a test to check what is the maximum simultanenous socket clients can connect to a socketserver.
The code is as follows:
--------- The Server ------------
import java.net.*;
public class Server {
     public void start() {
          int counter = 0;
          try {
               ServerSocket server = new ServerSocket(9999);
               System.out.println("Server started.");
               while (true) {
                    Socket connection = server.accept();
                    counter++;
                    System.out.println("Client " + counter + " connected.");
     catch (Exception ex) {
     public static void main(String args[]) {
          Server obj = new Server();
          obj.start();
----------- The Client -----------
import java.net.*;
public class Client {
     public static final int NUMBER_OF_CLIENTS = 20; // number of simultaneous connections.
     class ClientThread implements Runnable {
          Thread t;
          int id;
          public ClientThread(int id) {
               t = new Thread(this);
               this.id = id;
               t.start();
          public void run() {
               try {
                    Socket connection = new Socket(InetAddress.getLocalHost(), 9999);
                    System.out.println("Client " + id + " connection OK!");
                    //connection.close();
          catch (Exception ex) {
               System.out.println("Client " + id + " connection Failed!");
     public void start() {
          for (int i = 0; i < NUMBER_OF_CLIENTS; i++)     {
               ClientThread t = new ClientThread(i+1);
     public static void main(String args[]) {
          Client c = new Client();
          c.start();
Test env: Windows XP Sp1
Test results: There is atleast one client which has connection refused.
Questions:
1) Is the situation platform-dependent?
2) Is it possible to configure connection limit on server socket?
Thanks for paying attention.
Trung

Oh, it doesn't work!
Client 1 connection OK!
Client 20 connection OK!
Client 19 connection OK!
Client 18 connection OK!
Client 17 connection OK!
Client 16 connection OK!
Client 11 connection OK!
Client 10 connection OK!
Client 15 connection OK!
Client 14 connection OK!
Client 13 connection OK!
Client 9 connection OK!
Client 8 connection OK!
Client 3 connection OK!
Client 4 connection OK!
Client 5 connection OK!
Client 6 connection Failed!
Client 7 connection Failed!
Client 2 connection OK!
Client 12 connection OK!
I've executed 5 times, the 5th one has showed the
error.I doubt this has anything to do with a 'limit' in the OS.
A box can only process so much at once. That includes establishing connections.
High volume situations are handled by using multiple servers and a front end load balancing router.

Similar Messages

  • Maximum number of concurrent connections using java sockets

    How can we find out the maximum number of concurrent connections that can be handled by a pooled connection server?
    I have a pooled server which creates a predefined number of handlers. Upon receiving a new request it accepts the connection and sends it to one of the handler.
    The solution works well for low number of concurrent connections - < 50 or 100
    But as the number increases there seems to be an issue
    1. Ignoring request even if i increase the handlers
    2. Increase in delay. [I feel that the listening thread is not getting the time slice to go read the socket for new requests]
    Any idea as to how i can solve this?
    Would an NIO socket help [am using the conventional java.io Serversocket, because my clients may not be non-blocking]??
    Any help would be appreciated.
    Anp

    There is no set maximum, but it is in the thousands on most platforms. I have a production server that handles tens of thousands of connections simultaneously. Most likely you have a bug in your code.

  • I can't enter a Site. Ihere is only a message: "Maximum number of open connections reached."

    If i want to go to a Site, i recive this: "Maximum number of open connections reached.
    " other Browser work. I have the Problem only with Firefox.

    Check the connection settings.
    *Firefox/Tools > Options > Advanced : Network : Connection > Settings
    *https://support.mozilla.org/kb/Options+window+-+Advanced+panel
    If you do not need to use a proxy to connect to internet then select "Use the system proxy settings" setting or select "No Proxy".
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can

  • Adobe media server stand and adobe meidia server pro Maximum number of concurrent connections ?

    adobe media server stand and adobe meidia server pro Maximum number of concurrent connections ?

    Petro - you are alive - good news. Can you please contact Matt or I please, we'd be grateful mate - thanks - gavin

  • What is the maximum number of Active Connection in SSG 7206VXR?

    Hi,
    What is the maximum number of SSG Host or active connection (show ssg service package) for Cisco 7206VXR which running with NPE-G1? The SSG is deploying with Web-login and the TCP-Redirect, Port-bundle and Pass-through is enabling. The SSG is to handling IP session authentication. The SSG is binding Gigabit Ethernet.
    The current version of IOS is show as below.
    Cisco IOS Software, 7200 Software (C7200-ADVIPSERVICESK9-M), Version 12.4(9)T1, RELEASE SOFTWARE (fc2)
    Thanks,
    Chia

    To set the maximum number of services per user, use the ssg maxservice command in global configuration mode. To reset the maximum number of services per user to the default, use the no form of this command. ssg maxservice number and no ssg maxservice
    If you want to know more please click following URL:
    http://www.cisco.com/en/US/products/sw/iosswrel/ps5187/products_command_reference_chapter09186a008017cf59.html

  • Maximum number of users connections

    can any one able to tell me, is there a maximum number of allowable users on the database? And if so, if someone is trying to logon to Connect but the database is at the number of maximum users, what sort of error message will they receive?

    Depends on the context of the question. Are you asking about legal (i.e. licensing) limits? Or physical and logical limits of the hardware or software configuration?
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • [Q] Maximum Number of Concurrent Connections to 1142 LAP

    We are having random issues of users not being able to connect to our wireless network consistently. The users will have successfully accessed the network previously but then will have difficulty associating to the network. After a period of time, the association appears successful again. My first thoughts were that there was a restriction on the number of clients that could associate to a given AP at any one time.
    This is the equipment we have:
    1x Cisco Wireless Control Server (WCS) 6.0.181.0
    4x Cisco 5508 Wireless LAN Controllers 6.0.196.0
    60x Aironet 1142N Lightweight Access Points (LAP)
    Is there a hard or recommended maximum number of clients per LAP? If so, where is this defined? From what I have read on these forums, Cisco apparently recommends about 25 clients per AP but I can not find any official documentation to support this.
    When I go to WCS Home > General > Top APs by Client Count, the top AP reports 20 clients. However, if I click on the AP Name and go to the Current Associated Clients tab, it is only listing 8 clients - why is this?
    Any help greatly appreciated.
    Thanks in advance.

    1.  What error messages do the clients get when they are having association/authentication issues?
    There is no error message on the client, it simply fails to connect instantly. On an Android phone, you see it constantly trying to connect, failing and trying to reconnect. After many attempts (at least 10) it may connect successfully. This appears to me that it may be related to aggressive load balancing - here is what I think may be happening:
    Client tries to connect to nearest LAP
    Nearest LAP has to many clients on associated (as detemrined by the RRM Thresholds > Max Clients setting) and so refuses the connection (and sends a code 17 response)
    Client attempts to connect to the next nearest LAP which is also too busy. It too rejects the connection.
    Client attempts to connect to the third nearest LAP which is also too busy. It too rejects the connection.
    And so on until it comes back to the first nearest LAP
    This LAP, which still has too many associated clients, rejects the connection for a second time (its RRM Thresholds > Min Failed Clients is set to 3)
    the clients tries the other APs and is also rejected as they are all set to reject connections for 3 times.
    Client goes round all the APs for a third time. still getting rejected.
    It then attempts a 4th connection to the nearest LAP and is allowed to associated as it is beyong the 3-attempt threshold for rejected connections.
    This is my understanding of Aggressive Load balancing and would seem to match the observed behaviour of the clients but I would like to know if this is correct and how I can verify that in the logs?
    This goes back to my first question, what is the max recommended number of clients for a 1142N LAP? Furthermore, is there any supporting documentation for this recommendation? Also, if I increase the RRM threshold Max clients to more than its default of 12, will the LAP accept more connections before rejecting them?
    I would also like an answer to my second question in the original post.
    2.  Are you using ACS/RADIUS/TACACS?
    We are using 802.1X with ACS for our corporate users on the corporate SSID but the behaviour described above is seen on guest clients that just use web passthrough (i am not sure if it is also on corporate clients, I have not seen any reports to that effect yet).

  • Maximum number of VPN-connections

    Using OSX server how many VPN-connections can be made to a single VPN-server?

    Using OSX server how many VPN-connections can be made
    to a single VPN-server?
    Assuming you're using the unlimited client license version of OS X server, then the number of VPN connections are limited by the number of IP's you specify in the VPN section of server admin.
    So if you give 10 IP's to PPTP and 10 to L2TP, then 20 VPN users can connect, 10 of each kind. Additional users should authenticate just fine, but won't get an IP address, and thus will be unable to use the VPN.
    Of course, there are processor and bandwidth considerations you should keep in mind as well, which, in most circumstances, will come into play before any IP address limits.
    For example, if you're server is on a single T1 (1.5 Mbps) and you've got 10 remote VPN users actively connected, then each one is only going to get ~150 Kbps of bandwidth (and that's assuming nothing else is going in or out of the network).
    MacBook Pro   Mac OS X (10.4.8)  

  • Oracle Standard Edition databases are based on a maximum number of sockets

    Can someone explain this further?
    I need install Database in RAC.
    I have:
    1. Named User Plus Licenses.
    2. Oracle standard Edition Database.
    3. Two servers with 2 processors Dual Core 64-bit Intel® Xeon® Processor 7140M.
    4. Each server has 4 sockets, 2 are occupied and 2 are unoccupied.
    My question is:
    I need upgrade Oracle Enterprise edition database because I will have 8 socket, although only will use 4 sockets.
    I need more information on these sockets, specially in Database SE, User Named plus and multi-chip
    processors.
    I have contacted Oracle Sales and they/the sales person also do not have
    these information.
    Thanks in advance.
    Regards
    Carl

    Try reading through http://www.oracle.com/corporate/pricing/databaselicensing.pdf, and then http://www.oracle.com/corporate/pricing/sig.pdf (page 11) - also pass those URLs to your Oracle sales guy and ask for clarification.
    Note that any answers you get here will be quite useless in a court of law, if you and Oracle decide to have different opinions. So it is important you get an answer from Oracle - in writing.

  • Maximum number of processor sockets in Windows Server 2012 Datacenter and Standard

    I have found no documentation on the technical number of supported processor sockets supported by Windows Server 2012 for the Standard and Datacenter editions.
    Some donation websites like Techsoup claim that Datacenter supports 64 physical processors and Standard 8, but I can find no authoritative confirmation of this and those look like extrapolation from Windows Server 2008 R2.
    So what are the maximum supported # of processor sockets, assuming you have licenses for all of them, for Datacenter and Standard? Do they differ by edition?
    In addition, is it true that the total # of supported logical processors in a single system is 640 w/o Hyper-V? It was originally reported to be that, but since Hyper-V's number doubled from 160 in the Beta to 320 in the RC and RTM, did this double too?

    You might find some of the information you are looking for here -
    http://download.microsoft.com/download/2/C/A/2CA38362-37ED-4112-86A8-FDF14D5D4C9B/WS%202012%20Feature%20Comparison_Hyper-V.pdf.  I know there is one change that is not reflected there.  Recently the maximum number of virtual machines supported
    in a cluster was raised to 8,000 instead of the 4,000 reflected in this document.
    The maximum number of sockets for Standard would be two because that is the maximum number that the license supports.  Standard has never supported 8.  Prior to 2012, it supported 4, and then the licensing changed with 2012 so that Standard would
    be sold per processor (socket) with a maximum of two.  Technically, the binaries are the same for Standard and Datacenter, so you can most likely get it to run with more somehow, but it is not a supported configuration.
    The maximum number of sockets for Datacenter would be 64 - that has not changed from 2008.  I make this statement based on the fact that Datacenter supports a maximum of 64 virtual CPUs when run as a virtual machine.  Virtual machines don't have
    the distinction of socket versus hyper-thread versus core.  They see what is presented to them as a processor.  But, I doubt very much that you will find any off-the-shelf 64 socket systems; most vendors are relying on the core densities instead
    of socket density in order to deliver the horsepower.  The above referenced document still shows 320 as the maximum number of logical processors, with or without Hyper-V.
    tim

  • Maximum number of connections that database can make

    Dear All,
    I have a problem regarding maximum number of database connections that can be handled .
    Theoretically i am aware that the number of sessions we set in init ora settings tells me the maximum
    connections that can be opened.but this number will be also be dependent on the capability of the OS to handle the sessions.
    is there any way i can analyse the number of possible connections possible if I have the OS memory and CPU parameters with me
    Regards

    http://books.google.com/books?id=TmPoYfpeJAUC&pg=PA129&lpg=PA129&dq=.5mb+for+each+db+session+oracle&source=web&ots=RzRe2s2AYy&sig=zmO-RBoCEuWQzaZhOIN122Serzk&hl=en&sa=X&oi=book_result&resnum=5&ct=result#PPA122,M1.
    This is from expert oracle database architecture by tom kytes and I personally ran some queries to confirm that.
    Edited by: OrionNet on Nov 30, 2008 11:51 PM

  • Max number of sockets provided by JVM

    Hi,
    I am currently working on a program that creates a vast number of stream-oriented sockets and I encountered some problems that made me wonder whether there is a maximum number of sockets available.
    I searched the forum for a hint but only found vague answers. What I am particularly interested in is a statement whether there is a maximum number of sockets that can be managed by the virtual machine regardless of the hardware provided or the operating system in use.
    Thanks in advance.

    If I were to write Java, I would not impose an
    arbitrary limit but would rely upon the operating
    system and thus "inherit" the limit from there.Correct. It's the OS that specifies the limitations in this case.

  • Excessive cxs socket connections created for ejb access

    We are seeing a large number of TCP connections being created to the cxs engine for ejb access in our application.
    We are running iPlanet application server 6.0, sp3 on Solaris 8. We have a web application that accesses a singleton component running in a kjs engine. That singleton accesses cmp entity beans and stateless session beans for serving client requests over the RMI/IIOP bridge. When three clients are connected and making requests, the number of TCP connections to the IIOP port (9010) starts to increase until everything freezes. I believe the "freezing" of the client apps is due to the open socket limit of 1024 being exceeded. According to the developer doc we can increase rlim_fd_max to 8192 to fix that problem.
    However, my question is why are there an increasing number of socket connections? We are caching the ejb instances in the singleton so we should not be creating a large pool of EJBs. I have verfied the large number of sockets using netstat and also using RMI runtime logging in the kjs engine.
    Does anyone have any ideas what could be happening here?
    Thanks,
    Mark

    I noticed that most of the TCP connections are made to port 32787. Can anyone from iPlanet tell me what is listening on this port? The large number of socket connections is really tying up server resources.
    Thanks,
    Mark

  • Increasing max number of socket readers on client

    How can you increase the number of socket readers on a client
              application which
              uses JMS, EJB and talks to multiple WLAS servers.
              I get the following message
              Muxer> <There are: '3' active sockets, but the maximum number of socket
              readers allowed by theconfiguration is: '2', you may want alter your
              configuration.>
              But I cant find out how to increase the socket readers or better yet can
              I use the native IO for Solaris and NT clients??
              

    Try to use the WebItem Parameter "MAX_TEXT_LINES":
    <object>
    <param name="OWNER" value="SAP_BW"/>
    <param name="CMD" value="GET_ITEM"/>
    <param name="NAME" value="DOCUMENT_1"/>
    <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_DOC"/>
    <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
    <b><param name="MAX_TEXT_LINES" value="50"/></b>
    ITEM:            DOCUMENT_1
    </object>

  • Number of User Connections

    Is there a way to monitor the maximum number of user connections from Solution Manager?

    Hi Ashwin,
    By "monitoring" if you mean the checking the configured part, following is the navigation
    SOLMAN-->DBACOCKPIT-->Configuration-->Server configuration-->Memory Use-->number of user connections
    If you are looking for "dynamic" usage of this parameter,
    using DB02-->Performance -->Dash board-->Connections
    will give you information of active, free and reuse count values.
    Also,sp_monitorconfig "number  of user connections"
    will give you same results using isql.
    HTH
    Rajesh

Maybe you are looking for