Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Contention in ServletHolder.handle()

Daniel,

let me see if I can prevent the call to getServlet() in the case where
you provide a pre-constructed servlet. I'll do some testing and get
back to you - I need to confirm that the handling of that would be ok
for cases where the servlet may have been made unavailable etc etc as
well.

Jan

On 12/05/2014, Daniel Feist <dfeist@xxxxxxxxx> wrote:
> Hi,
>
> Yes.  I agree this is needed is 'initOnStartup' is not configured, was
> trying to work out why the synchonrized block was needed at all for
> the 'initOnStartup' case though.
>
> That said, the reason reason I was seeing contention is probably
> primarily due to org.eclipse.jetty.servlet.ServletHolder.getServlet()
> because my servlet doesn't have 'initOnStartup' set.
>
> In my use case I embed jetty and provide Jetty with a
> pre-instantiated/configured servlet instance wrapped in a
> ServletHolder.  I guess i need to set the somewhat unobvious initOrder
> to non-0 to configure this and reduce the contention?
>
> thanks!
>
>
>
> On Mon, May 12, 2014 at 11:15 AM, Jan Bartel <janb@xxxxxxxxxxx> wrote:
>> Daniel,
>>
>> Not sure exactly the lines in ServletHolder you're referring to, but I
>> assume its the synchronized block around line 652? If so, then this
>> code guards the initial startup of a servlet - if it isn't
>> load-on-startup, then any request coming in can initialize it.
>> Therefore, if you have multiple concurrent requests, you need to
>> protect the servlet startup so it happens only once.
>>
>> Jan
>>
>> On 8 May 2014 22:43, Daniel Feist <dfeist@xxxxxxxxx> wrote:
>>> Hi,
>>>
>>> I've been doing some testing/benchmarking of Jetty 8 with Mule ESB and
>>> seeming a decent amount of contention where it doesn't seem that
>>> synchronization is required.
>>>
>>> My test scenario is just a simple echo, all i do is read the request
>>> stream and then respond.  The contention i'm seeing can be seen here:
>>>
>>> https://www.dropbox.com/s/bbkdsk7ndfpzoj9/Screen%20Shot%202014-05-08%20at%209.35.34%20PM.png
>>>
>>> Inspecting the code, I can't understand why this needs to even be
>>> synchonrized.
>>>
>>> Any thoughts? Is there a config option I should be using that i'm not?
>>>  Is my test scenario unrealistic?
>>>
>>> thanks!
>>> Dan
>>> _______________________________________________
>>> jetty-users mailing list
>>> jetty-users@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>>
>>
>> --
>> Jan Bartel <janb@xxxxxxxxxxx>
>> www.webtide.com
>> 'Expert Jetty/CometD developer,production,operations advice'
>> _______________________________________________
>> jetty-users mailing list
>> jetty-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>


-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'


Back to the top