第一 有关内存
in general, the more memory allocated to the process, the better(通常,越大越好)
It is recommended to set the min and max memory to the same value, and enable mlockall.(建议设置成相同的值,并且开启mlockall)
No more than 50% of available RAM (不要超过内存的一半)
No more than 32 GB: If the heap is less than 32 GB, the JVM can use compressed pointers, which saves a lot of memory: 4 bytes per pointer instead of 8 bytes.(不要超过32G,因为对于JVM,小于32G的时候会使用压缩指针,这个会节省很大内存)
Increasing the heap from 32 GB to 34 GB would mean that you have much less memory available, because all pointers are taking double the space. Also, with bigger heaps, garbage collection becomes more costly and can result in node instability.(从32G到34G,意味着你失去了更多的可用内存,因为所有的内存指针都变成了double,而且heap越大,GC花销越大,这将是不稳定因素)

建议 Don’t Touch These Settings!(不要触碰这些设置)
We would like to recommend G1GC someday, but for now, it is simply not stable enough to meet the demands of Elasticsearch and Lucene.(我们很期待以后某一天推荐G1 GC,但是对于现在,它对于elasticsearch和lucene来说不能足够稳定(你还是老实用CMS GC吧)

建议:Swapping is very bad for performance and for node stability, so it should be avoided at all costs.
(swapping 对性能和节点稳定性是相当有影响的,so一定要禁掉它。


It may surprise you to find that Elasticsearch does not load into fielddata just the values for the documents that match your query. It loads the values for all documents in your index, even documents with a different _type!
To make sorting efficient, Elasticsearch loads all the values for the field that you want to sort on into memory. This is referred to as fielddata.(为了排序,elasticsearch会把这个字段的所有的值都加载到内存里,也就是所谓的fielddata)

indices.fielddata.cache.size: 40%
this setting is a safeguard, not a solution for insufficient memory.
If you don’t have enough memory to keep your fielddata resident in memory, Elasticsearch will constantly have to reload data from disk, and evict other data to make space. Evictions cause heavy disk I/O and generate a large amount of garbage in memory, which must be garbage collected later on.




验证码 *