users@grizzly.java.net

Re: Grizzly thread pool not expanding

From: jakewins <jacob_at_voltvoodoo.com>
Date: Mon, 9 Aug 2010 07:33:13 -0700 (PDT)

Update:

I found the problem, I set core threads before max threads. That part was in
a try/catch block in the complete code, hiding the exception thrown when
trying to set a core thread number higher than max threads.

Sorry about the inconvinience!

/Jacob


jakewins wrote:
>
> Hi,
>
> I'm working on a Jersey + Grizzly (1.9.18) project, and am having trouble
> getting Grizzly to expand its thread pool. I've got a test script that
> runs 400 concurrent requests against the grizzly server, but the number of
> threads remains at the minimum number of threads, 5.
>
> Could anyone point me in the right direction?
>
> I create the server like this:
>
> GrizzlyWebServer server = new GrizzlyWebServer( 9999 );
> server.setCoreThreads( 5 );
> server.setMaxThreads( 256 );
>
> // Create our REST service
> ServletAdapter jersey = new ServletAdapter();
> jersey.setServletInstance( new ServletContainer() );
>
> // Tell jersey where to find REST resources
> jersey.addInitParameter( "com.sun.jersey.config.property.packages",
> "my.rest.package" );
>
> // Authentication filter
> jersey.addInitParameter(
> ResourceConfig.PROPERTY_CONTAINER_REQUEST_FILTERS,
> SecurityFilter.class.getName() );
>
> // This adds CORS-headers to all responses
> jersey.addInitParameter(
> ResourceConfig.PROPERTY_CONTAINER_RESPONSE_FILTERS,
> AllowAjaxFilter.class.getName() );
>
> jersey.setServletPath( "" );
>
> // Tell grizzly to serve our REST service
> server.addGrizzlyAdapter( jersey );
> server.start();
>
>
> --
> Jacob Hansson
> Phone: +46 (0) 763503395
> Twitter: @jakewins
>

-- 
View this message in context: http://old.nabble.com/Grizzly-thread-pool-not-expanding-tp29387644p29388571.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.