Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce the size of the search thread pool. #9165

Merged

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Jan 6, 2015

Follow-up of #9135. We initially decreased the stack size because it would end
up a lot of memory when there are many threads. But we also have some thread
pools that may be oversized, in particular the search thread pool.

This commit proposes to decrease the default search thread pool size from
3 * num_procs to 3 * num_procs / 2 + 1. This is large enough to be sure
that we can use all the machine resources even with a search-only work load
but not too large in order to not consume too much memory because of the stack
size and thread locals.

@@ -114,7 +114,7 @@ public ThreadPool(Settings settings, @Nullable NodeSettingsService nodeSettingsS
.put(Names.INDEX, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 200).build())
.put(Names.BULK, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 50).build())
.put(Names.GET, settingsBuilder().put("type", "fixed").put("size", availableProcessors).put("queue_size", 1000).build())
.put(Names.SEARCH, settingsBuilder().put("type", "fixed").put("size", availableProcessors * 3).put("queue_size", 1000).build())
.put(Names.SEARCH, settingsBuilder().put("type", "fixed").put("size", availableProcessors * 3 / 2 + 1).put("queue_size", 1000).build())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use this ((availableProcessors * 3) / 2) + 1 even though it's equivalent

@s1monw
Copy link
Contributor

s1monw commented Mar 18, 2015

I think it's good - left one comment

@s1monw s1monw self-assigned this Mar 18, 2015
Follow-up of elastic#9135. We initially decreased the stack size because it would end
up a lot of memory when there are many threads. But we also have some thread
pools that may be oversized, in particular the search thread pool.

This commit proposes to decrease the default search thread pool size from
`3 * num_procs` to `3 * num_procs / 2 + 1`. This is large enough to be sure
that we can use all the machine resources even with a search-only work load
but not too large in order to not consume too much memory because of the stack
size and thread locals.
@jpountz jpountz force-pushed the enhancement/reduce_search_pool_size branch from 96542f4 to 08388e0 Compare April 2, 2015 14:32
@jpountz
Copy link
Contributor Author

jpountz commented Apr 2, 2015

Applied the suggested change, will push soon.

jpountz added a commit that referenced this pull request Apr 7, 2015
…size

Internal: reduce the size of the search thread pool.
@jpountz jpountz merged commit 884c40a into elastic:master Apr 7, 2015
@clintongormley clintongormley changed the title Internal: reduce the size of the search thread pool. Reduce the size of the search thread pool. May 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants