felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: Event Admin Tuning the Async Thread Pool
Date Thu, 28 Aug 2014 13:25:04 GMT
Hi Bob,

this sounds good to me, however it would be even better if the event admin
could find out the ratio and adjust it accordingly. I'm not against making
this configurable, but it might be hard to know the good value upfront.

As a general node, it would be great, if we could simply have a single
thread pool :)

But +1 for a patch in any case.

Carsten


2014-08-28 15:00 GMT+02:00 Bob Paulin <bob@bobpaulin.com>:

> Hi,
>
> I'd like to propose adding an additional configuration variable to Event
> Admin that controls the sync to async thread ratio.  Currently the code
> sets an intelligent default that sets the async threads at 50% of the sync
> threads as long as there are more than 5 total sync threads.
>
> final int asyncThreadPoolSize = m_threadPoolSize > 5 ? m_threadPoolSize /
> 2  : 2;
>
> This assumes an even split between post and send operations. However this
> is not the case with many applications leaning heavily one way or the
> other.  I'd like to replace the above code with:
>
> final int asyncThreadPoolSize = m_threadPoolSize > 5 ?
> Math.floor(m_threadPoolSize * m_asyncToSyncThreadRatio)  : 2;
>
> With m_asyncToSyncThreadRatio defaulting to 0.5.  This leaves the
> intelligent defaults but allows the admin to tune the application based on
> the application usage.  This tuning can show significant performance
> improvements.  From the EventAdmin StressTestIT:
>
> Scenerio 100% Async events
> Events sent 1050000
> Producer Threads 15
>
>
> @ 50% async to sync ratio
> PAXEXAM-PROBE-8762bbe7-91d9-4ff1-8562-38096af676da[org.
> apache.felix.eventadmin.ittests.StressTestIT] : Finished tests, received
> 1050000 events in 6551ms
>
> @ 100% async to sync ratio
> PAXEXAM-PROBE-02e70ff6-36ff-4bed-ab00-f2bcb9440109[org.
> apache.felix.eventadmin.ittests.StressTestIT] : Finished tests, received
> 1050000 events in 4871ms
>
> Thoughts?  Happy to submit a patch if there are no concerns.
>
> - Bob Paulin
>



-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message