4 Replies Latest reply on Jan 15, 2009 5:43 AM by Doychin Bondzhev

    Using remoting for RMI for EJB 2 with scoket connector and c

    Doychin Bondzhev Newbie

      Here is the configuration of my application which I'll use to describe my problems, findings and solutions

      - JBoss App server 4.2.3 with EJB 2.x application
      - JBoss remoting 2.2.2. SP8
      - Swing client application that uses JBoss remoting to talk to the app server
      - Using jboss serialization over the wire.

      My problem lies in the way my client application works with application server. I'm using in some cases multiple threads to load different kinds of data from application server.

      In that case I end up with many socket connections open from one client to the server. These connections remain open while that client is still active no matter are they used or not. In my case usually these are around 30.

      In case there are many active clients at the same time this creates big problem. The system works OK up to the point where maxPoolSize number of server threads is reached and from there starts the problem.

      Because that limit is reached server now tries to free some ServerThread instance but it can't until it's timeout is reached. This leads to a situation where client application freezes for some time and this could be very long time.

      This of course leaves the end user with feeling that the application freezes and the usually restart the client after few minutes of waiting.

      In order to fix this problem I had to make changes to some of the settings for socket connection in jboss-service.xml

      What I changed was to set clientMaxPoolSize to 5 (it was 50 by default). This will allow up to 5 simulations connection open to the server from a single client application. Another change I did was to add continueAfterTimeout parameter and to set it to false. It's default value of true prevents the server from closing unused connections after the timeout has expired.

      Now with these settings my app server can handle up to 60 active clients and even more if the maximum amount of allowed client connections is not used by all of them.

      Doychin Bondzhev