Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 8d8d9ef

Browse files
committed
Edited 510_Deployment/45_dont_touch.asciidoc with Atlas code editor
1 parent 963cbb9 commit 8d8d9ef

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

510_Deployment/45_dont_touch.asciidoc

+16-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11

2-
=== Don't touch these settings!
2+
=== Don't Touch These Settings!
33

44
There are a few hotspots in Elasticsearch that people just can't seem to avoid
5-
tweaking. ((("deployment", "settings to leave unaltered"))) We understand: knobs just beg to be turned.
6-
7-
But of all the knobs to turn, these you should _really_ leave alone. They are
5+
tweaking. ((("deployment", "settings to leave unaltered"))) We understand: knobs just beg to be turned. But of all the knobs to turn, these you should _really_ leave alone. They are
86
often abused and will contribute to terrible stability or terrible performance.
97
Or both.
108

@@ -27,10 +25,10 @@ like Elasticsearch. The official recommendation is to use CMS.
2725
There is a newer GC called the Garbage First GC (G1GC). ((("Garbage First GC (G1GC)"))) This newer GC is designed
2826
to minimize pausing even more than CMS, and operate on large heaps. It works
2927
by dividing the heap into regions and predicting which regions contain the most
30-
reclaimable space. By collecting those regions first ("garbage first"), it can
28+
reclaimable space. By collecting those regions first (_garbage first_), it can
3129
minimize pauses and operate on very large heaps.
3230

33-
Sounds great! Unfortunately, G1GC is still new and fresh bugs are found routinely.
31+
Sounds great! Unfortunately, G1GC is still new, and fresh bugs are found routinely.
3432
These bugs are usually of the segfault variety, and will cause hard crashes.
3533
The Lucene test suite is brutal on GC algorithms, and it seems that G1GC hasn't
3634
had the kinks worked out yet.
@@ -46,37 +44,36 @@ a lot? More threads! Node idling 95% of the time? More threads!
4644

4745
The default threadpool settings in Elasticsearch are very sensible. For all
4846
threadpools (except `search`) the threadcount is set to the number of CPU cores.
49-
If you have 8 cores, you can only be running 8 threads simultaneously. It makes
50-
sense to only assign 8 threads to any particular threadpool.
47+
If you have eight cores, you can be running only eight threads simultaneously. It makes
48+
sense to assign only eight threads to any particular threadpool.
5149

5250
Search gets a larger threadpool, and is configured to `# cores * 3`.
5351

5452
You might argue that some threads can block (such as on a disk I/O operation),
55-
which is why you need more threads. This is not actually not a problem in Elasticsearch:
56-
much of the disk IO is handled by threads managed by Lucene, not Elasticsearch.
53+
which is why you need more threads. This is not a problem in Elasticsearch:
54+
much of the disk I/O is handled by threads managed by Lucene, not Elasticsearch.
5755

5856
Furthermore, threadpools cooperate by passing work between each other. You don't
5957
need to worry about a networking thread blocking because it is waiting on a disk
6058
write. The networking thread will have long since handed off that work unit to
6159
another threadpool and gotten back to networking.
6260

63-
Finally, the compute capacity of your process is finite. More threads just forces
64-
the processor to switch thread contexts. A processor can only run one thread
61+
Finally, the compute capacity of your process is finite. Having more threads just forces
62+
the processor to switch thread contexts. A processor can run only one thread
6563
at a time, so when it needs to switch to a different thread, it stores the current
66-
state (registers, etc) and loads another thread. If you are lucky, the switch
64+
state (registers, and so forth) and loads another thread. If you are lucky, the switch
6765
will happen on the same core. If you are unlucky, the switch may migrate to a
68-
different core and require transport on inter-core communication bus.
66+
different core and require transport on an inter-core communication bus.
6967

70-
This context switching eats up cycles simply doing administrative housekeeping
71-
-- estimates can peg it as high as 30μs on modern CPUs. So unless the thread
68+
This context switching eats up cycles simply by doing administrative housekeeping; estimates can peg it as high as 30μs on modern CPUs. So unless the thread
7269
will be blocked for longer than 30μs, it is highly likely that that time would
7370
have been better spent just processing and finishing early.
7471

75-
People routinely set threadpools to silly values. On 8 core machines, we have
76-
run across configs with 60, 100 or even 1000 threads. These settings will simply
72+
People routinely set threadpools to silly values. On eight core machines, we have
73+
run across configs with 60, 100, or even 1000 threads. These settings will simply
7774
thrash the CPU more than getting real work done.
7875

79-
So. Next time you want to tweak a threadpool...please don't. And if you
76+
So. Next time you want to tweak a threadpool, please don't. And if you
8077
_absolutely cannot resist_, please keep your core count in mind and perhaps set
8178
the count to double. More than that is just a waste.
8279

0 commit comments

Comments
 (0)