users@grizzly.java.net

Re: Grizzly and filedescriptors

From: Barry van Someren <barry_at_coffeesprout.com>
Date: Mon, 27 Jul 2009 13:17:07 +0200

Hi,

On Mon, Jul 27, 2009 at 11:52 AM, Oleksiy
Stashok<Oleksiy.Stashok_at_sun.com> wrote:
> Hello,
>


> Yep, I understand that know, just wanted to make sure :)
>
> I just thought, that if we open and then close file - we don't need any
> extra filedescriptors number. Glassfish, by default, has 5 worker threads,
> which means 5 files could be processed simultaneously by static handler
> (these are default numbers for sure).
> That's why I started to think about some fd leak.

I'm using a 128 thread http threadpool but I believe you to be correct
on the number of acceptor threads.

>
> Actually Grizzly has a cache implementation, though it doesn't cache fds,
> but file content itself. Probably it's what you and Barry were interested
> in. Seems Glassfish v3 doesn't use it by default. I'll check this and let
> you know how you can enable it.

I've switched it on and it should probably hold all the files in cache
since it has room for all of them.
Interestingly enough, if I write a simple Servlet that just writes the
entire files from memory (Bytebuffer.array) it's even slightly faster
(same load, except slightly lower CPU usage)
There is a lot of garbage generated by the array copies most likely.
Either way, I'm not convinced that there is a performance issue, but
it does leave me scratching my head why opening 500 connections will
kill Glassfish on a box with 1024 fd's

I'll see if I can do some more in-depth analysis.
>
>> Without measurements of the effect on the performance when reusing such
>> resources we cannot tell either way, though. Barry thinks it might help, you
>> dismiss it. I prefer to wait until someone sat down and actually measured
>> it.
>
> 100% agree :)
>
> Thank you.
>
> WBR,
> Alexey.
>
>>
>> So.... Anybody with a little spare time? :-)
>> --
>> Kees Jan
>>
>> http://java-monitor.com/
>> kjkoster_at_kjkoster.org
>> 06-51838192
>>
>> The secret of success lies in the stability of the goal. -- Benjamin
>> Disraeli
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>



-- 
Barry van Someren
---------------------------------------
LinkedIn: http://www.linkedin.com/in/barryvansomeren
Skype: BvsomerenSprout
Blog: http://blog.bvansomeren.com
KvK: 27317624
irc: BarryNL @ FreeNode