Re: [Simpleweb-Support] Asynchronous services get blocked
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2013-04-30 09:38:01
|
Hi Alvaro,
This is simply not true, there is something wrong with your test code, not sure what exactly but I would recommend you take a closer look at your code.
Niall
--- On Tue, 30/4/13, Alvaro Guillermo <alv...@gm...> wrote:
From: Alvaro Guillermo <alv...@gm...>
Subject: [Simpleweb-Support] Asynchronous services get blocked
To: Sim...@li...
Received: Tuesday, 30 April, 2013, 1:38 AM
nice and easy to use but there seems to be a problem when you use several
thread. I have a timeout for certain type of request the code is quite
straightforward. I looks like the example, ie.
this.executor =
Executors.newCachedThreadPool();
@Override
public void handle(Request request, Response
response)
{
LOG.info("receiving request " +
request.getAddress().toString());
Task task = new
Task(request, response, cfg);
executor.execute(task);
LOG.info("Executing task");
}
There is two differences In the Task compared to the examples in the homepage,
1)I have a
Thread.sleep(millis)
2) I used Executors.newCachedThreadPoolI tried the same sniper code outside the simpleframework
and It worked fine. The problem is that it seems that when you have big loads of
requests the simpleframework get a blocked handling like 3 requests at the time, ie. and it does not handle more
request until the current Threads have runned completetly.
In my eyes it should
continue to handle requests even if some threads are sleeping, if you are using threads, the same sniper
code outside simpleframework works fine so I don't think it has to do with the
code. I tried also without Thread.sleep but I let the "task" do a lot of things that took about 10 seconds to finish. The same problem here simpleframework get blocked until it was finished with the current tasks, despite the fact it was supposed to run asynchronously. The same code works fine outside simpleframework, when I put it in a "main" class instead.
I need some hints och
help with this issue.
-----Inline Attachment Follows-----
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
-----Inline Attachment Follows-----
_______________________________________________
Simpleweb-Support mailing list
Sim...@li...
https://lists.sourceforge.net/lists/listinfo/simpleweb-support
|