How many shards and replicas do I have to set to use every cpu core (I want 100% load, fastest query results) in my cluster?
I want to use Elasticsearch for aggregations. I read that Elasticsearch uses multiple cpu cores, but found no exact details about cpu cores regarding sharding and replicas.
My observations are, that a single shard does not use more than 1 core/thread at query time (considerung there is only one query at a time). With replicas, the query of a 1-shard index are not faster, since Elasticsearch does not seem to use the other nodes to distribute the load on a shard.
My questions (one query at a time):
- A shard does not use more than one cpu core?
- Shards must always be scanned completely, replicas cannot be used to divide intra-shard load between nodes?
- The formular for best performance is SUM(CPU_CORES per node) * PRIMARY_SHARDS?