What about...

acceptor = new SocketAcceptor(Runtime.getRuntime().availableProcessors()+1,
   Executors.newFixedThreadPool(50));


--
..Cheers
Mark


On 4/19/07, Richard Lowe <[EMAIL PROTECTED]> wrote:
Hi Peter,

Thanks again for your help.

This is the code that I'm currently using for my SocketAcceptor:

acceptor = new SocketAcceptor();
acceptor = new
SocketAcceptor(Runtime.getRuntime().availableProcessors()+1,
Executors.newCachedThreadPool());
acceptor.getDefaultConfig().setThreadModel(ThreadModel.MANUAL);
acceptor.bind( new InetSocketAddress(port), this);
acceptor.addListener(this);

Many thanks,
Richard.
--

peter royal wrote:
> On Apr 19, 2007, at 7:14 AM, Richard Lowe wrote:
>> I use the following tweaks to help improve performance:
>>
>> ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
>> ByteBuffer.setUseDirectBuffers(false);
>
> this is a good start.
>
>> Ideally I would love to support 2000+ simultaneous connections on
>> this test machine.  Is there a way of achieving this without my CPU
>> fan flying off it's spindle and my machine setting alight?
>
> I don't see why its not achievable.
>
> Are you using the ExecutorFilter? What's the configured pool size? And
> are you using the SocketAcceptor/Connector constructors that allow you
> to pass in the number of processing threads? If its the default, you
> may want to bump up to be 2-4x the number of CPU cores you have to
> start (while using the ExecutorFilter). Alternately, disable the
> executor filter and bump the processor thread count instead.
> -pete
>
>
> [EMAIL PROTECTED] - http://fotap.org/~osi
>
>
>


Reply via email to