addressalign-toparrow-leftarrow-leftarrow-right-10x10arrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcredit-cardcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobe--smallglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1languagelaunch-new-window--smalllight-bulblightning-boltlinklocation-pinlockm-swarmSearchmailmediummessagesminusmobilemoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstar-shapestartickettrashtriangle-downtriangle-uptwitteruserwarningyahooyoutube

Re: [ljc] Peculiar behaviour of ManagedScheduledExecutorService

From: Ben E.
Sent on: Friday, July 25, 2014, 2:14 PM
Hi Linesh,

I think you might have slightly misunderstood my post.

I'm not looking for a dynamically resizing thread pool.
ManagedScheduledExec­utorService is an EE7 interface that is used to
supply a container-managed threadpool, so in an @ApplicationScoped
provider class, we have something like this:

    @Resource
    private ManagedExecutorServi­ce executorService;

Then this service can be treated from within the EE app as just
another executor threadpool. The Glassfish documentation indicates how
to define the size of the threadpool statically via configuration, and
what the defaults should be.

I have an application that is demonstrably not using all the available
cores (at 32 cores, it maxes out 8 of them, and leaves 24 completely
idle). I also have a test harness which runs the same code outside of
Glassfish (thank you dependency injection for the helpful decoupling
from the container!), and uses a standard STPE threadpool, configured
with 64 threads, and it more-or-less maxes out the CPU, as we would
expect from the 2 * cores rule of thumb).

So the issue is that the Glassfish ManagedExecutorServi­ce being
provided does not have a correctly sized threadpool - the question is
why?

Thanks,

Ben

On Fri, Jul 25, 2014 at 12:09 PM, lineshv5 <[address removed]> wrote:
> Hi Ben,
>
> What you mentioned in your email below is an interface.
> If the object used for invoking methods on this interface has a fixed
> poolsize of threads e.g. ScheduledThreadPoolE­xecutor class object, poolsize
> made up of core threads will be fixed.
> So thread pool won't resize in that case.
>
> Regards.
> Linesh.
>
>
> Sent from Samsung Mobile
>
>
> -------- Original message --------
> From: Ben Evans
> Date:24/07/[masked]:­09 (GMT+00:00)
> To: [address removed]
> Subject: [ljc] Peculiar behaviour of ManagedScheduledExec­utorService
>
> Hi,
>
> Is anyone using the new EE7 ManagedScheduledExec­utorService class?
>
> (This is basically an EE version of the ScheduledExecutorSer­vice from
> java.util.concurrent­)
>
> I'm using it in Glassfish 4, and seeing some rather odd behaviour - in
> particular it doesn't seem to be sizing the threadpool as the
> documentation indicates it should.
>
> I'd be interested in talking to anyone who's also using it or has had
> problems with it.
>
> Thanks,
>
> Ben
>
>
>
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on
> this mailing list ([address removed])
> https://www.meetup...­
> This message was sent by Ben Evans ([address removed]) from LJC
> - London Java Community.
> To learn more about Ben Evans, visit his/her member profile:
> https://www.meetup...­
> Set my mailing list to email me
>
> As they are sent
> https://www.meetup...­
>
> In one daily email
> https://www.meetup...­
>
> Don't send me mailing list messages
> https://www.meetup...­
> Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]
>

People in this
group are also in: