[sheepdog] [PATCH v2 5/5] work: shrink the number of worker threads dynamically
MORITA Kazutaka
morita.kazutaka at gmail.com
Thu Feb 28 13:25:00 CET 2013
At Thu, 28 Feb 2013 20:17:23 +0800,
Liu Yuan wrote:
>
> On 02/28/2013 08:09 PM, MORITA Kazutaka wrote:
> > At Thu, 28 Feb 2013 19:28:32 +0800,
> > Liu Yuan wrote:
> >>
> >> On 02/28/2013 06:46 PM, MORITA Kazutaka wrote:
> >>> + if (wi->nr_pending + wi->nr_running <= wi->nr_threads / 2)
> >>> + /* we cannot shrink work queue during protection period. */
> >>> + return wi->tm_end_of_protection <= get_msec_time();
> >>
> >> Why we need delay shrinking?
> >
> > To avoid many calls of pthread_create. Without it, threads are
> > frequently created and deleted like short threads, and it leads poor
> > performance on my environment.
> >
>
> Then we'd better embed this as comment.
Okay.
> And what about longer delay,
> which might further reduce the false shrinking?
It's a trade-off with an efficient use of resources. If we use a
longer value, we may keep too many threads.
There is no rationale for 1 second for now. I think we should change
it after we merge this series and see how it works on actual
environment.
Thanks,
Kazutaka
More information about the sheepdog
mailing list