You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Brenno Hayden <br...@gmail.com> on 2008/02/22 20:51:11 UTC

how to test my application for maximum connection (client) ?

Created my MyServer.java (below) mine 2.0.0-m1 to support more than 20,000
simultaneous connections there is a tool to check if my server using mine
supports 20000 connections? How to can I do this test performance? How do I
know the maximum number of customers connected?

MyServer.java

public class MyServer {

    private static int TCP_PORT = 4443;

    private static int TIMEOUT = 60;

    public static void main(String[] args) throws Exception {
        IoAcceptor acceptor = new NioSocketAcceptor(5);
        acceptor.setHandler(new Handler());
        acceptor.getFilterChain().addLast("executor", new ExecutorFilter(
Executors.newCachedThreadPool()));
        acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE,
TIMEOUT);
        acceptor.setDefaultLocalAddress(new InetSocketAddress(TCP_PORT));
        acceptor.bind();
        System.out.println("Listening on port " + TCP_PORT);
        for (;;) {
            System.out.println("R: " + acceptor.getReadBytesThroughput()
                    + ", W: " + acceptor.getWrittenBytesThroughput());
            Thread.sleep(3000);
        }
    }
}

graciously

________________________
Brenno Hayden F. Dantas

Re: how to test my application for maximum connection (client) ?

Posted by Mark Webb <el...@gmail.com>.
are you looking for automated test tools?  Like jmeter?

On Fri, Feb 22, 2008 at 2:51 PM, Brenno Hayden <br...@gmail.com> wrote:
> Created my MyServer.java (below) mine 2.0.0-m1 to support more than 20,000
>  simultaneous connections there is a tool to check if my server using mine
>  supports 20000 connections? How to can I do this test performance? How do I
>  know the maximum number of customers connected?
>
>  MyServer.java
>
>  public class MyServer {
>
>     private static int TCP_PORT = 4443;
>
>     private static int TIMEOUT = 60;
>
>     public static void main(String[] args) throws Exception {
>         IoAcceptor acceptor = new NioSocketAcceptor(5);
>         acceptor.setHandler(new Handler());
>         acceptor.getFilterChain().addLast("executor", new ExecutorFilter(
>  Executors.newCachedThreadPool()));
>         acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE,
>  TIMEOUT);
>         acceptor.setDefaultLocalAddress(new InetSocketAddress(TCP_PORT));
>         acceptor.bind();
>         System.out.println("Listening on port " + TCP_PORT);
>         for (;;) {
>             System.out.println("R: " + acceptor.getReadBytesThroughput()
>                     + ", W: " + acceptor.getWrittenBytesThroughput());
>             Thread.sleep(3000);
>         }
>     }
>  }
>
>  graciously
>
>  ________________________
>  Brenno Hayden F. Dantas
>



-- 
--------------------------------
Talent hits a target no one else can hit; Genius hits a target no one
else can see.