Thanks James,
Is there any method with which we can increase the number of
connections or threads to handle more simultaneous connections so that the
application can handle more number of requests at one time.
The following are sample methods which I am using to start the Grizzly web
server and to receive requests:
public void startServer() throws InstantiationException, IOException,
Exception {
selectorThread = new SelectorThread();
selectorThread.setPort(portNo);
selectorThread.setInet(host);
selectorThread.setCoreThreads(minThreadNo);
selectorThread.setMaxThreads(maxThreadNo);
selectorThread.setAdapter(new ServiceProcessor());
final AsyncHandler handler = new DefaultAsyncHandler();
handler.addAsyncFilter(new GrizzlyAsyncProcessor());
selectorThread.setAsyncHandler(handler);
selectorThread.setEnableAsyncExecution(true);
selectorThread.setDisplayConfiguration(true);
selectorThread.initEndpoint();
selectorThread.getSelectorThreadKeyHandler().setTimeout(responseTimeOut);
selectorThread.startEndpoint();
}
class ServiceProcessor implements Adapter {
public void afterService(Request arg0, Response arg1) throws
Exception {
}
public void fireAdapterEvent(String arg0, Object arg1) {
}
/**
* This method enqueue the request and response object into the
queue.
*/
public void service(Request request, Response response) {
//here I am getting the request object
}
}
}
thanks
Chandan
Cooper, James wrote:
>
> Hi,
> Well I cannot comment on Solaris. But Grizzly performs dramatically
> different on Windows as opposed to Linux, due to differences as to how
> the JVM NIO implementation on that platform works. Currently on Linux
> due to and underlying JVM bug, it simply doesn't work and it regularly
> runs into CPU spikes which means that the application is unavailable to
> handle more connections with the system responding with RST packets.
> Hopefully there are some Grizzly users with Solaris knowledge that can
> clarify how well it works.
>
> Rgds,
> James
>
> On Tue, 2009-07-14 at 23:19 -0700, chandan_evol wrote:
>> Hi All, I am using solaries 10 as the platform. thanks chandan
>> chandan_evol wrote:
>> Hi All, I am using Grizzly 1.9.15 as a HTTP web server for my
>> application. But, whenever the client side sends number of
>> requests (~10 requests in second), the application sends RST
>> packets to the client, after sending FIN to the client side.
>> This seems that the Grizzly server is dropping some requests
>> if it is heavily loaded. Can someone tell me what can prevent
>> the Grizzly server to drop requests. The client is maintaining
>> an HTTP non-persistent connection where everytime connection
>> will be closed if there is a response received for a request.
>> I would appreciate if someone gives me a solution. thanks in
>> advance Chandan
>>
>>
>> ______________________________________________________________________
>> View this message in context: Re: RST/FIN sent from the Grizzly server
>> Sent from the Grizzly - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>
>
--
View this message in context: http://www.nabble.com/RST-FIN-sent-from-the-Grizzly-server-tp24492450p24492651.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.