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

Move the terms index of _id off-heap. #52405

Merged
merged 4 commits into from
Feb 19, 2020

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Feb 17, 2020

In #42838 we moved the terms index of all fields off-heap except the
_id field because we were worried it might make indexing slower. In
general, the indexing rate is only affected if explicit IDs are used, as
otherwise Elasticsearch almost never performs lookups in the terms
dictionary for the purpose of indexing. So it's quite wasteful to
require the terms index of _id to be loaded on-heap for users who have
append-only workloads. Furthermore I've been conducting benchmarks when
indexing with explicit ids on the http_logs dataset that suggest that
the slowdown is low enough that it's probably not worth forcing the terms
index to be kept on-heap. Here are some numbers for the median indexing
rate in docs/s:

Run Master Patch
1 45851.2 46401.4
2 45192.6 44561.0
3 45635.2 44137.0
4 46435.0 44692.8
5 45829.0 44949.0

And now heap usage in MB for segments:

Run Master Patch
1 41.1720 0.352083
2 45.1545 0.382534
3 41.7746 0.381285
4 45.3673 0.412737
5 45.4616 0.375063

Indexing rate decreased by 1.8% on average, while memory usage decreased
by more than 100x.

The http_logs dataset contains small documents and has a simple
indexing chain. More complex indexing chains, e.g. with more fields,
ingest pipelines, etc. would see an even lower decrease of indexing rate.

In elastic#42838 we moved the terms index of all fields off-heap except the
`_id` field because we were worried it might make indexing slower. In
general, the indexing rate is only affected if explicit IDs are used, as
otherwise Elasticsearch almost never performs lookups in the terms
dictionary for the purpose of indexing. So it's quite wasteful to
require the terms index of `_id` to be loaded on-heap for users who have
append-only workloads. Furthermore I've been conducting benchmarks when
indexing with explicit ids on the http_logs dataset that suggest that
the slowdown is low enough that it's probably not worth forcing the terms
index to be kept on-heap. Here are some numbers for the median indexing
rate in docs/s:

| Run | Master  | Patch   |
| --- | ------- | ------- |
| 1   | 45851.2 | 46401.4 |
| 2   | 45192.6 | 44561.0 |
| 3   | 45635.2 | 44137.0 |
| 4   | 46435.0 | 44692.8 |
| 5   | 45829.0 | 44949.0 |

And now heap usage in MB for segments:

| Run | Master  | Patch    |
| --- | ------- | -------- |
| 1   | 41.1720 | 0.352083 |
| 2   | 45.1545 | 0.382534 |
| 3   | 41.7746 | 0.381285 |
| 4   | 45.3673 | 0.412737 |
| 5   | 45.4616 | 0.375063 |

Indexing rate decreased by 1.8% on average, while memory usage decreased
by more than 100x.

The `http_logs` dataset contains small documents and has a simple
indexing chain. More complex indexing chains, e.g. with more fields,
ingest pipelines, etc. would see an even lower decrease of indexing rate.
@jpountz jpountz added >enhancement release highlight :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. v8.0.0 v7.7.0 labels Feb 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Engine)

@jpountz
Copy link
Contributor Author

jpountz commented Feb 17, 2020

I'm sharing all the Rally outputs for completeness:

Master:

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     597.522 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     13.4944 |    min |
|             Max cumulative indexing time across primary shards |        |     511.144 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     111.945 |    min |
|                       Cumulative merge count of primary shards |        |         116 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.00525 |    min |
|                Max cumulative merge time across primary shards |        |      104.95 |    min |
|               Cumulative merge throttle time of primary shards |        |     24.7727 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |       0.012 |    min |
|       Max cumulative merge throttle time across primary shards |        |     24.5323 |    min |
|                      Cumulative refresh time of primary shards |        |     24.9777 |    min |
|                     Cumulative refresh count of primary shards |        |         136 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.609825 |    min |
|              Max cumulative refresh time across primary shards |        |     21.4722 |    min |
|                        Cumulative flush time of primary shards |        |     63.4469 |    min |
|                       Cumulative flush count of primary shards |        |          98 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.50189 |    min |
|                Max cumulative flush time across primary shards |        |     54.3918 |    min |
|                                             Total Young Gen GC |        |      514.23 |      s |
|                                               Total Old Gen GC |        |       0.488 |      s |
|                                                     Store size |        |     23.6658 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |      41.172 |     MB |
|                                       Heap used for doc values |        |   0.0595875 |     MB |
|                                            Heap used for terms |        |       40.88 |     MB |
|                                            Heap used for norms |        |   0.0100098 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.222412 |     MB |
|                                                  Segment count |        |         164 |        |
|                                                 Min Throughput | update |       38428 | docs/s |
|                                              Median Throughput | update |     45851.2 | docs/s |
|                                                 Max Throughput | update |     62186.5 | docs/s |
|                                        50th percentile latency | update |     791.735 |     ms |
|                                        90th percentile latency | update |     2036.61 |     ms |
|                                        99th percentile latency | update |      3042.7 |     ms |
|                                      99.9th percentile latency | update |     24774.3 |     ms |
|                                     99.99th percentile latency | update |     38637.1 |     ms |
|                                       100th percentile latency | update |     66841.7 |     ms |
|                                   50th percentile service time | update |      791.83 |     ms |
|                                   90th percentile service time | update |     2036.61 |     ms |
|                                   99th percentile service time | update |     3044.85 |     ms |
|                                 99.9th percentile service time | update |     24774.3 |     ms |
|                                99.99th percentile service time | update |     38637.1 |     ms |
|                                  100th percentile service time | update |     66841.7 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |      617.85 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     13.3961 |    min |
|             Max cumulative indexing time across primary shards |        |     532.608 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     133.299 |    min |
|                       Cumulative merge count of primary shards |        |         119 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.26677 |    min |
|                Max cumulative merge time across primary shards |        |     125.584 |    min |
|               Cumulative merge throttle time of primary shards |        |     33.4205 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |   0.0445417 |    min |
|       Max cumulative merge throttle time across primary shards |        |     32.8411 |    min |
|                      Cumulative refresh time of primary shards |        |     26.4341 |    min |
|                     Cumulative refresh count of primary shards |        |         138 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.628183 |    min |
|              Max cumulative refresh time across primary shards |        |     22.7866 |    min |
|                        Cumulative flush time of primary shards |        |     65.1949 |    min |
|                       Cumulative flush count of primary shards |        |          98 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.47753 |    min |
|                Max cumulative flush time across primary shards |        |      56.244 |    min |
|                                             Total Young Gen GC |        |     514.596 |      s |
|                                               Total Old Gen GC |        |       0.544 |      s |
|                                                     Store size |        |     17.8138 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |     45.1545 |     MB |
|                                       Heap used for doc values |        |   0.0558987 |     MB |
|                                            Heap used for terms |        |     44.8837 |     MB |
|                                            Heap used for norms |        |  0.00836182 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.206551 |     MB |
|                                                  Segment count |        |         137 |        |
|                                                 Min Throughput | update |       37747 | docs/s |
|                                              Median Throughput | update |     45192.6 | docs/s |
|                                                 Max Throughput | update |     62443.3 | docs/s |
|                                        50th percentile latency | update |     830.638 |     ms |
|                                        90th percentile latency | update |     2061.84 |     ms |
|                                        99th percentile latency | update |     3169.44 |     ms |
|                                      99.9th percentile latency | update |     27445.3 |     ms |
|                                     99.99th percentile latency | update |     44311.2 |     ms |
|                                       100th percentile latency | update |     76929.4 |     ms |
|                                   50th percentile service time | update |     830.636 |     ms |
|                                   90th percentile service time | update |     2060.35 |     ms |
|                                   99th percentile service time | update |     3169.44 |     ms |
|                                 99.9th percentile service time | update |     27445.3 |     ms |
|                                99.99th percentile service time | update |     44311.2 |     ms |
|                                  100th percentile service time | update |     76929.4 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     607.742 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     13.1352 |    min |
|             Max cumulative indexing time across primary shards |        |     521.723 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     129.275 |    min |
|                       Cumulative merge count of primary shards |        |         118 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.34401 |    min |
|                Max cumulative merge time across primary shards |        |     121.573 |    min |
|               Cumulative merge throttle time of primary shards |        |     34.1173 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |    0.037925 |    min |
|       Max cumulative merge throttle time across primary shards |        |     33.5992 |    min |
|                      Cumulative refresh time of primary shards |        |     26.2427 |    min |
|                     Cumulative refresh count of primary shards |        |         138 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.600167 |    min |
|              Max cumulative refresh time across primary shards |        |     22.7628 |    min |
|                        Cumulative flush time of primary shards |        |      64.089 |    min |
|                       Cumulative flush count of primary shards |        |          98 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.38202 |    min |
|                Max cumulative flush time across primary shards |        |     55.4799 |    min |
|                                             Total Young Gen GC |        |      553.46 |      s |
|                                               Total Old Gen GC |        |       0.551 |      s |
|                                                     Store size |        |     20.1729 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |     41.7746 |     MB |
|                                       Heap used for doc values |        |   0.0566616 |     MB |
|                                            Heap used for terms |        |     41.4934 |     MB |
|                                            Heap used for norms |        |  0.00891113 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.215591 |     MB |
|                                                  Segment count |        |         146 |        |
|                                                 Min Throughput | update |       37977 | docs/s |
|                                              Median Throughput | update |     45635.2 | docs/s |
|                                                 Max Throughput | update |     62793.3 | docs/s |
|                                        50th percentile latency | update |     810.836 |     ms |
|                                        90th percentile latency | update |     2056.78 |     ms |
|                                        99th percentile latency | update |        3188 |     ms |
|                                      99.9th percentile latency | update |     27560.8 |     ms |
|                                     99.99th percentile latency | update |     44001.6 |     ms |
|                                       100th percentile latency | update |     56606.2 |     ms |
|                                   50th percentile service time | update |     810.836 |     ms |
|                                   90th percentile service time | update |     2056.77 |     ms |
|                                   99th percentile service time | update |     3184.84 |     ms |
|                                 99.9th percentile service time | update |     27560.8 |     ms |
|                                99.99th percentile service time | update |     44001.6 |     ms |
|                                  100th percentile service time | update |     56606.2 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     591.074 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     12.3294 |    min |
|             Max cumulative indexing time across primary shards |        |     507.783 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     140.963 |    min |
|                       Cumulative merge count of primary shards |        |         121 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.10223 |    min |
|                Max cumulative merge time across primary shards |        |     132.923 |    min |
|               Cumulative merge throttle time of primary shards |        |      39.007 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |    0.032475 |    min |
|       Max cumulative merge throttle time across primary shards |        |     38.5244 |    min |
|                      Cumulative refresh time of primary shards |        |     25.2246 |    min |
|                     Cumulative refresh count of primary shards |        |         140 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.518658 |    min |
|              Max cumulative refresh time across primary shards |        |     21.4682 |    min |
|                        Cumulative flush time of primary shards |        |     63.4451 |    min |
|                       Cumulative flush count of primary shards |        |         100 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.48776 |    min |
|                Max cumulative flush time across primary shards |        |     54.0709 |    min |
|                                             Total Young Gen GC |        |     513.349 |      s |
|                                               Total Old Gen GC |        |       0.501 |      s |
|                                                     Store size |        |     16.7383 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |     45.3673 |     MB |
|                                       Heap used for doc values |        |   0.0469913 |     MB |
|                                            Heap used for terms |        |     45.1098 |     MB |
|                                            Heap used for norms |        |  0.00793457 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |     0.20253 |     MB |
|                                                  Segment count |        |         130 |        |
|                                                 Min Throughput | update |     38166.3 | docs/s |
|                                              Median Throughput | update |       46435 | docs/s |
|                                                 Max Throughput | update |     64932.5 | docs/s |
|                                        50th percentile latency | update |     793.775 |     ms |
|                                        90th percentile latency | update |     2023.25 |     ms |
|                                        99th percentile latency | update |     3013.23 |     ms |
|                                      99.9th percentile latency | update |     26793.6 |     ms |
|                                     99.99th percentile latency | update |     45257.9 |     ms |
|                                       100th percentile latency | update |     53181.7 |     ms |
|                                   50th percentile service time | update |     793.775 |     ms |
|                                   90th percentile service time | update |     2022.65 |     ms |
|                                   99th percentile service time | update |     3032.27 |     ms |
|                                 99.9th percentile service time | update |     26793.6 |     ms |
|                                99.99th percentile service time | update |     45257.9 |     ms |
|                                  100th percentile service time | update |     53181.7 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     601.946 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |      13.031 |    min |
|             Max cumulative indexing time across primary shards |        |     517.384 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     143.323 |    min |
|                       Cumulative merge count of primary shards |        |         122 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.37136 |    min |
|                Max cumulative merge time across primary shards |        |     135.399 |    min |
|               Cumulative merge throttle time of primary shards |        |      39.349 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |       0.034 |    min |
|       Max cumulative merge throttle time across primary shards |        |      38.751 |    min |
|                      Cumulative refresh time of primary shards |        |     24.7063 |    min |
|                     Cumulative refresh count of primary shards |        |         139 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.592217 |    min |
|              Max cumulative refresh time across primary shards |        |      21.253 |    min |
|                        Cumulative flush time of primary shards |        |     62.4941 |    min |
|                       Cumulative flush count of primary shards |        |          99 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.38178 |    min |
|                Max cumulative flush time across primary shards |        |     53.6944 |    min |
|                                             Total Young Gen GC |        |     559.263 |      s |
|                                               Total Old Gen GC |        |        0.48 |      s |
|                                                     Store size |        |     16.8221 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |     45.4616 |     MB |
|                                       Heap used for doc values |        |   0.0481758 |     MB |
|                                            Heap used for terms |        |     45.2026 |     MB |
|                                            Heap used for norms |        |  0.00793457 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.202896 |     MB |
|                                                  Segment count |        |         130 |        |
|                                                 Min Throughput | update |     38213.3 | docs/s |
|                                              Median Throughput | update |       45829 | docs/s |
|                                                 Max Throughput | update |     63531.9 | docs/s |
|                                        50th percentile latency | update |     798.923 |     ms |
|                                        90th percentile latency | update |     2038.83 |     ms |
|                                        99th percentile latency | update |     3133.26 |     ms |
|                                      99.9th percentile latency | update |     28218.2 |     ms |
|                                     99.99th percentile latency | update |     49386.9 |     ms |
|                                       100th percentile latency | update |     63035.3 |     ms |
|                                   50th percentile service time | update |     798.924 |     ms |
|                                   90th percentile service time | update |     2038.76 |     ms |
|                                   99th percentile service time | update |     3128.85 |     ms |
|                                 99.9th percentile service time | update |     28218.2 |     ms |
|                                99.99th percentile service time | update |     49386.9 |     ms |
|                                  100th percentile service time | update |     63035.3 |     ms |
|                                                     error rate | update |           0 |      % |

Patch:

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     580.957 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     11.9517 |    min |
|             Max cumulative indexing time across primary shards |        |     502.564 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     135.022 |    min |
|                       Cumulative merge count of primary shards |        |         118 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.18679 |    min |
|                Max cumulative merge time across primary shards |        |      127.94 |    min |
|               Cumulative merge throttle time of primary shards |        |     41.6268 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |   0.0599417 |    min |
|       Max cumulative merge throttle time across primary shards |        |     41.0395 |    min |
|                      Cumulative refresh time of primary shards |        |     25.1498 |    min |
|                     Cumulative refresh count of primary shards |        |         139 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.502567 |    min |
|              Max cumulative refresh time across primary shards |        |     22.0142 |    min |
|                        Cumulative flush time of primary shards |        |     63.1302 |    min |
|                       Cumulative flush count of primary shards |        |          99 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.27958 |    min |
|                Max cumulative flush time across primary shards |        |     54.6112 |    min |
|                                             Total Young Gen GC |        |      580.11 |      s |
|                                               Total Old Gen GC |        |       0.502 |      s |
|                                                     Store size |        |     16.7663 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |    0.352083 |     MB |
|                                       Heap used for doc values |        |   0.0513477 |     MB |
|                                            Heap used for terms |        |   0.0927124 |     MB |
|                                            Heap used for norms |        |  0.00756836 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.200455 |     MB |
|                                                  Segment count |        |         124 |        |
|                                                 Min Throughput | update |     38337.9 | docs/s |
|                                              Median Throughput | update |     46401.4 | docs/s |
|                                                 Max Throughput | update |     65769.3 | docs/s |
|                                        50th percentile latency | update |     778.592 |     ms |
|                                        90th percentile latency | update |     2060.87 |     ms |
|                                        99th percentile latency | update |     3181.56 |     ms |
|                                      99.9th percentile latency | update |     24874.2 |     ms |
|                                     99.99th percentile latency | update |     48715.5 |     ms |
|                                       100th percentile latency | update |     70788.8 |     ms |
|                                   50th percentile service time | update |     778.592 |     ms |
|                                   90th percentile service time | update |     2060.87 |     ms |
|                                   99th percentile service time | update |     3181.56 |     ms |
|                                 99.9th percentile service time | update |     24874.2 |     ms |
|                                99.99th percentile service time | update |     48715.5 |     ms |
|                                  100th percentile service time | update |     70788.8 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     600.319 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     13.1824 |    min |
|             Max cumulative indexing time across primary shards |        |     513.852 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     111.332 |    min |
|                       Cumulative merge count of primary shards |        |         119 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.14825 |    min |
|                Max cumulative merge time across primary shards |        |     103.773 |    min |
|               Cumulative merge throttle time of primary shards |        |     23.4101 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |      0.0393 |    min |
|       Max cumulative merge throttle time across primary shards |        |     22.9599 |    min |
|                      Cumulative refresh time of primary shards |        |     27.2595 |    min |
|                     Cumulative refresh count of primary shards |        |         139 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.625342 |    min |
|              Max cumulative refresh time across primary shards |        |     23.4719 |    min |
|                        Cumulative flush time of primary shards |        |     67.1631 |    min |
|                       Cumulative flush count of primary shards |        |          99 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.50336 |    min |
|                Max cumulative flush time across primary shards |        |     57.8484 |    min |
|                                             Total Young Gen GC |        |     523.684 |      s |
|                                               Total Old Gen GC |        |       0.522 |      s |
|                                                     Store size |        |     21.4699 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |    0.382534 |     MB |
|                                       Heap used for doc values |        |   0.0551491 |     MB |
|                                            Heap used for terms |        |    0.106918 |     MB |
|                                            Heap used for norms |        |  0.00872803 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.211739 |     MB |
|                                                  Segment count |        |         143 |        |
|                                                 Min Throughput | update |     37424.7 | docs/s |
|                                              Median Throughput | update |       44561 | docs/s |
|                                                 Max Throughput | update |     63408.7 | docs/s |
|                                        50th percentile latency | update |     794.341 |     ms |
|                                        90th percentile latency | update |     2119.54 |     ms |
|                                        99th percentile latency | update |      3276.7 |     ms |
|                                      99.9th percentile latency | update |     27857.3 |     ms |
|                                     99.99th percentile latency | update |     45228.6 |     ms |
|                                       100th percentile latency | update |     94201.7 |     ms |
|                                   50th percentile service time | update |     794.409 |     ms |
|                                   90th percentile service time | update |     2119.54 |     ms |
|                                   99th percentile service time | update |      3276.7 |     ms |
|                                 99.9th percentile service time | update |     27857.3 |     ms |
|                                99.99th percentile service time | update |     45228.6 |     ms |
|                                  100th percentile service time | update |     94201.7 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     629.285 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     13.3487 |    min |
|             Max cumulative indexing time across primary shards |        |     543.948 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     127.442 |    min |
|                       Cumulative merge count of primary shards |        |         113 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.21778 |    min |
|                Max cumulative merge time across primary shards |        |     119.949 |    min |
|               Cumulative merge throttle time of primary shards |        |       23.65 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |   0.0478167 |    min |
|       Max cumulative merge throttle time across primary shards |        |      23.281 |    min |
|                      Cumulative refresh time of primary shards |        |     31.2483 |    min |
|                     Cumulative refresh count of primary shards |        |         134 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.623833 |    min |
|              Max cumulative refresh time across primary shards |        |     27.2333 |    min |
|                        Cumulative flush time of primary shards |        |     73.8771 |    min |
|                       Cumulative flush count of primary shards |        |          97 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.56535 |    min |
|                Max cumulative flush time across primary shards |        |     63.3201 |    min |
|                                             Total Young Gen GC |        |     554.401 |      s |
|                                               Total Old Gen GC |        |       0.503 |      s |
|                                                     Store size |        |     16.9652 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |    0.381285 |     MB |
|                                       Heap used for doc values |        |   0.0558376 |     MB |
|                                            Heap used for terms |        |    0.106918 |     MB |
|                                            Heap used for norms |        |  0.00872803 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.209801 |     MB |
|                                                  Segment count |        |         143 |        |
|                                                 Min Throughput | update |     36412.4 | docs/s |
|                                              Median Throughput | update |       44137 | docs/s |
|                                                 Max Throughput | update |     61286.8 | docs/s |
|                                        50th percentile latency | update |     828.426 |     ms |
|                                        90th percentile latency | update |     2106.13 |     ms |
|                                        99th percentile latency | update |     3265.06 |     ms |
|                                      99.9th percentile latency | update |     33065.3 |     ms |
|                                     99.99th percentile latency | update |     51951.3 |     ms |
|                                       100th percentile latency | update |     61910.6 |     ms |
|                                   50th percentile service time | update |      828.55 |     ms |
|                                   90th percentile service time | update |     2106.38 |     ms |
|                                   99th percentile service time | update |     3266.34 |     ms |
|                                 99.9th percentile service time | update |     33065.3 |     ms |
|                                99.99th percentile service time | update |     51951.3 |     ms |
|                                  100th percentile service time | update |     61910.6 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     616.191 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |     13.4297 |    min |
|             Max cumulative indexing time across primary shards |        |     528.582 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |      117.96 |    min |
|                       Cumulative merge count of primary shards |        |         117 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.26721 |    min |
|                Max cumulative merge time across primary shards |        |     109.646 |    min |
|               Cumulative merge throttle time of primary shards |        |     29.7746 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |   0.0391917 |    min |
|       Max cumulative merge throttle time across primary shards |        |     29.4082 |    min |
|                      Cumulative refresh time of primary shards |        |     27.2005 |    min |
|                     Cumulative refresh count of primary shards |        |         138 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.580625 |    min |
|              Max cumulative refresh time across primary shards |        |     23.3441 |    min |
|                        Cumulative flush time of primary shards |        |     66.5723 |    min |
|                       Cumulative flush count of primary shards |        |          98 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.39617 |    min |
|                Max cumulative flush time across primary shards |        |     57.2171 |    min |
|                                             Total Young Gen GC |        |      522.82 |      s |
|                                               Total Old Gen GC |        |       0.533 |      s |
|                                                     Store size |        |     22.2356 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |    0.412737 |     MB |
|                                       Heap used for doc values |        |   0.0653553 |     MB |
|                                            Heap used for terms |        |    0.119629 |     MB |
|                                            Heap used for norms |        |  0.00976562 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.217987 |     MB |
|                                                  Segment count |        |         160 |        |
|                                                 Min Throughput | update |     37391.6 | docs/s |
|                                              Median Throughput | update |     44692.8 | docs/s |
|                                                 Max Throughput | update |       61700 | docs/s |
|                                        50th percentile latency | update |     813.309 |     ms |
|                                        90th percentile latency | update |     2095.04 |     ms |
|                                        99th percentile latency | update |     3272.13 |     ms |
|                                      99.9th percentile latency | update |     28889.2 |     ms |
|                                     99.99th percentile latency | update |     44699.5 |     ms |
|                                       100th percentile latency | update |     81474.3 |     ms |
|                                   50th percentile service time | update |     813.305 |     ms |
|                                   90th percentile service time | update |      2094.9 |     ms |
|                                   99th percentile service time | update |     3271.68 |     ms |
|                                 99.9th percentile service time | update |     28889.2 |     ms |
|                                99.99th percentile service time | update |     44699.5 |     ms |
|                                  100th percentile service time | update |     81474.3 |     ms |
|                                                     error rate | update |           0 |      % |

|                                                         Metric |   Task |       Value |   Unit |
|---------------------------------------------------------------:|-------:|------------:|-------:|
|                     Cumulative indexing time of primary shards |        |     621.576 |    min |
|             Min cumulative indexing time across primary shards |        |           0 |    min |
|          Median cumulative indexing time across primary shards |        |      12.388 |    min |
|             Max cumulative indexing time across primary shards |        |     539.826 |    min |
|            Cumulative indexing throttle time of primary shards |        |           0 |    min |
|    Min cumulative indexing throttle time across primary shards |        |           0 |    min |
| Median cumulative indexing throttle time across primary shards |        |           0 |    min |
|    Max cumulative indexing throttle time across primary shards |        |           0 |    min |
|                        Cumulative merge time of primary shards |        |     137.878 |    min |
|                       Cumulative merge count of primary shards |        |         114 |        |
|                Min cumulative merge time across primary shards |        |           0 |    min |
|             Median cumulative merge time across primary shards |        |     1.28272 |    min |
|                Max cumulative merge time across primary shards |        |     131.136 |    min |
|               Cumulative merge throttle time of primary shards |        |     37.1758 |    min |
|       Min cumulative merge throttle time across primary shards |        |           0 |    min |
|    Median cumulative merge throttle time across primary shards |        |     0.03335 |    min |
|       Max cumulative merge throttle time across primary shards |        |     36.8143 |    min |
|                      Cumulative refresh time of primary shards |        |     28.1475 |    min |
|                     Cumulative refresh count of primary shards |        |         137 |        |
|              Min cumulative refresh time across primary shards |        |           0 |    min |
|           Median cumulative refresh time across primary shards |        |    0.582225 |    min |
|              Max cumulative refresh time across primary shards |        |     24.6703 |    min |
|                        Cumulative flush time of primary shards |        |     67.4403 |    min |
|                       Cumulative flush count of primary shards |        |          97 |        |
|                Min cumulative flush time across primary shards |        |           0 |    min |
|             Median cumulative flush time across primary shards |        |     1.42952 |    min |
|                Max cumulative flush time across primary shards |        |     58.3992 |    min |
|                                             Total Young Gen GC |        |     557.024 |      s |
|                                               Total Old Gen GC |        |       0.539 |      s |
|                                                     Store size |        |     17.0433 |     GB |
|                                                  Translog size |        | 4.09782e-07 |     GB |
|                                         Heap used for segments |        |    0.375063 |     MB |
|                                       Heap used for doc values |        |   0.0502491 |     MB |
|                                            Heap used for terms |        |    0.106171 |     MB |
|                                            Heap used for norms |        |  0.00866699 |     MB |
|                                           Heap used for points |        |           0 |     MB |
|                                    Heap used for stored fields |        |    0.209976 |     MB |
|                                                  Segment count |        |         142 |        |
|                                                 Min Throughput | update |     37341.5 | docs/s |
|                                              Median Throughput | update |       44949 | docs/s |
|                                                 Max Throughput | update |     63787.1 | docs/s |
|                                        50th percentile latency | update |     823.837 |     ms |
|                                        90th percentile latency | update |     2082.12 |     ms |
|                                        99th percentile latency | update |     3132.25 |     ms |
|                                      99.9th percentile latency | update |     29802.7 |     ms |
|                                     99.99th percentile latency | update |     47970.6 |     ms |
|                                       100th percentile latency | update |     83070.3 |     ms |
|                                   50th percentile service time | update |     823.703 |     ms |
|                                   90th percentile service time | update |     2082.22 |     ms |
|                                   99th percentile service time | update |     3135.24 |     ms |
|                                 99.9th percentile service time | update |     29802.7 |     ms |
|                                99.99th percentile service time | update |     47970.6 |     ms |
|                                  100th percentile service time | update |     83070.3 |     ms |
|                                                     error rate | update |           0 |      % |

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -84,6 +84,9 @@
"[true, false, checksum] but was: " + s);
}
}, Property.IndexScope);
// This setting is undocumented as it is considered as an escape hatch.
public static final Setting<Boolean> ON_HEAP_ID_TERMS_INDEX =
Setting.boolSetting("index.force_memory_id_terms_dictinary", false, Property.IndexScope);
Copy link
Member

Choose a reason for hiding this comment

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

nit: dictinary -> dictionary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this, you were not nit-picking!

@jpountz jpountz merged commit f3b5bd9 into elastic:master Feb 19, 2020
@jpountz jpountz deleted the enhancement/offheap_terms_dict branch February 19, 2020 15:02
jpountz added a commit to jpountz/elasticsearch that referenced this pull request Feb 19, 2020
Backport of elastic#52405

In elastic#42838 we moved the terms index of all fields off-heap except the
`_id` field because we were worried it might make indexing slower. In
general, the indexing rate is only affected if explicit IDs are used, as
otherwise Elasticsearch almost never performs lookups in the terms
dictionary for the purpose of indexing. So it's quite wasteful to
require the terms index of `_id` to be loaded on-heap for users who have
append-only workloads. Furthermore I've been conducting benchmarks when
indexing with explicit ids on the http_logs dataset that suggest that
the slowdown is low enough that it's probably not worth forcing the terms
index to be kept on-heap. Here are some numbers for the median indexing
rate in docs/s:

| Run | Master  | Patch   |
| --- | ------- | ------- |
| 1   | 45851.2 | 46401.4 |
| 2   | 45192.6 | 44561.0 |
| 3   | 45635.2 | 44137.0 |
| 4   | 46435.0 | 44692.8 |
| 5   | 45829.0 | 44949.0 |

And now heap usage in MB for segments:

| Run | Master  | Patch    |
| --- | ------- | -------- |
| 1   | 41.1720 | 0.352083 |
| 2   | 45.1545 | 0.382534 |
| 3   | 41.7746 | 0.381285 |
| 4   | 45.3673 | 0.412737 |
| 5   | 45.4616 | 0.375063 |

Indexing rate decreased by 1.8% on average, while memory usage decreased
by more than 100x.

The `http_logs` dataset contains small documents and has a simple
indexing chain. More complex indexing chains, e.g. with more fields,
ingest pipelines, etc. would see an even lower decrease of indexing rate.
sbourke pushed a commit to sbourke/elasticsearch that referenced this pull request Feb 19, 2020
In elastic#42838 we moved the terms index of all fields off-heap except the
`_id` field because we were worried it might make indexing slower. In
general, the indexing rate is only affected if explicit IDs are used, as
otherwise Elasticsearch almost never performs lookups in the terms
dictionary for the purpose of indexing. So it's quite wasteful to
require the terms index of `_id` to be loaded on-heap for users who have
append-only workloads. Furthermore I've been conducting benchmarks when
indexing with explicit ids on the http_logs dataset that suggest that
the slowdown is low enough that it's probably not worth forcing the terms
index to be kept on-heap. Here are some numbers for the median indexing
rate in docs/s:

| Run | Master  | Patch   |
| --- | ------- | ------- |
| 1   | 45851.2 | 46401.4 |
| 2   | 45192.6 | 44561.0 |
| 3   | 45635.2 | 44137.0 |
| 4   | 46435.0 | 44692.8 |
| 5   | 45829.0 | 44949.0 |

And now heap usage in MB for segments:

| Run | Master  | Patch    |
| --- | ------- | -------- |
| 1   | 41.1720 | 0.352083 |
| 2   | 45.1545 | 0.382534 |
| 3   | 41.7746 | 0.381285 |
| 4   | 45.3673 | 0.412737 |
| 5   | 45.4616 | 0.375063 |

Indexing rate decreased by 1.8% on average, while memory usage decreased
by more than 100x.

The `http_logs` dataset contains small documents and has a simple
indexing chain. More complex indexing chains, e.g. with more fields,
ingest pipelines, etc. would see an even lower decrease of indexing rate.
@mfussenegger mfussenegger mentioned this pull request Mar 24, 2020
37 tasks
bpintea added a commit that referenced this pull request Apr 20, 2020
* Highlights of the 7.7 release

Add the 7.7 release highlights (minus #52405, covered in #55238).

* Update docs/reference/release-notes/highlights-7.7.0.asciidoc

Co-Authored-By: James Rodewig <[email protected]>
mfussenegger added a commit to crate/crate that referenced this pull request Apr 30, 2020
Port of elastic/elasticsearch#52405 but excludes
the undocumented setting.

Relates to #9796
mfussenegger added a commit to crate/crate that referenced this pull request Apr 30, 2020
Port of elastic/elasticsearch#52405 but excludes
the undocumented setting.

Relates to #9796
mergify bot pushed a commit to crate/crate that referenced this pull request Apr 30, 2020
Port of elastic/elasticsearch#52405 but excludes
the undocumented setting.

Relates to #9796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >enhancement release highlight v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants