The effect of elasticsearch cluster is several orders of magnitude slower than that of stand-alone. What's going on?

< H2 > Elasticsearch search engine, the cluster effect is much worse than the stand-alone effect, what"s going on < / H2 > < H1 > configuration and data description < / H1 >
  1. Server configuration: 4C8G CVM
  2. Cluster configuration: 3 nodes, 1 master, 2 replicas
  3. quantity of data: 4000W
  4. data model: 4 fields, extremely simple model
  5. query method: term precise search
  6. ES version: 2.4.6
  7. data initialization: read the data from Hbase through spark and import it into ES, and import 4000W at one time
< H1 > the background of the problem and what methods you have tried < / H1 >
We tested the situation of stand-alone, cluster, cluster down to stand-alone, and upgrade from stand-alone to cluster. The conclusions are as follows, but we don"t know what caused it. Concurrency is not considered for the time being, only a single request is considered, and the test data is the statistical result of tens of thousands of single requests that do not hit the cache.
  • initialize the data to the cluster, and the response of the cluster is 400ms
  • initialize the data to the standalone, and the corresponding speed of the stand-alone is 20ms
  • initialize the data to the cluster, and when it is reduced to a stand-alone machine, the corresponding speed is in 20ms (this process is a slow process, that is, when it is first reduced to a single machine, the speed changes from the original 400ms to 150ms, after a few hours, the response speed becomes 50ms, and reaches the extreme speed the next day. 10ms, due to the test gap in between, it may not need to reach the maximum speed by the next day)
  • initialize the data to the cluster, reduce it to a stand-alone machine, and then upgrade to a cluster. The corresponding speed of the cluster is in 20ms
in the case of a single request, it is acceptable for cluster performance to be slower than that of a single machine, but it feels suspicious if it is 20 times slower, as I explained above.
< H1 > what you expect to know: < / H1 >
  1. what is the way ES is stored when data is initialized?
  2. Does the change of
  3. from a cluster to a stand-alone machine trigger some changes in ES"s internal storage structure, index data collation, and so on, resulting in a sharp increase in speed?
< H1 > extension-want to discuss the caching mechanism of ES < / H1 >
found several strange ways to handle caching during the test
    1. stand-alone case: I query 2 pieces of data according to the condition, and the response is 20ms. If I use the current condition query again, the response is always between 2--4ms, that is to say, if I hit the result caused by cache, then I directly use the request to write a piece of data into it, which meets the current query conditions. After the query, it is still between 2--4ms, and the newly written data is also found out. I delete the data, too, hit the cache, and the data is updated in real time.
    1. Cluster case: my first query speed is in 400ms, the second query speed is in 400ms, the third query speed is in 50ms, and the fourth query speed is also 50ms. The guess conclusion is that the cache was hit the third and fourth times, but because it hit the cache twice, guess whether the first query left the query results on the first machine, and the data was cached on the first machine; the second query left the query results on the second machine, so the cache was also on the second machine, so it appeared, and the response speed of the second query was very slow?
    Apr.01,2022
    MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
    MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b315ef-2bd70.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
    MySQL Errno : 1021
    Message : Disk full (/tmp/#sql-temptable-64f5-1b315ef-2bd70.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
    Need Help?