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

[BUG] desc_sort_timestamp is slower with OS 3.0 index compared to OS 2.19 index on OS 3.0 server #17404

Open
expani opened this issue Feb 20, 2025 · 11 comments
Assignees
Labels
bug Something isn't working Search:Performance

Comments

@expani
Copy link
Contributor

expani commented Feb 20, 2025

Describe the bug

OS 3.0 * OS 2.19 indicates that the OpenSearch server was running 3.0 whereas the index used was created in OS 2.19. This was done to eliminate any suspicion of the bug arising from an indexing change in Lucene.

Metric Name Operation/Query name OS 2.19 OS 3.0 OS 3.0 * OS 2.19 Unit
50th percentile latency desc_sort_timestamp 7.93071 10.8131 7.7783 ms
90th percentile latency desc_sort_timestamp 8.45714 11.4532 8.68553 ms
99th percentile latency desc_sort_timestamp 9.68866 14.6754 10.0167 ms
100th percentile latency desc_sort_timestamp 11.1424 16.3041 10.6183 ms
50th percentile service time desc_sort_timestamp 6.51203 9.40036 6.35852 ms
90th percentile service time desc_sort_timestamp 7.07093 9.89428 7.15328 ms
99th percentile service time desc_sort_timestamp 8.42815 13.2756 8.50242 ms
100th percentile service time desc_sort_timestamp 9.56305 14.7515 9.65212 ms

As we can see something in the index layout is causing OS 3.0 server to be slower with OS 3.0 index.

Related component

Search:Performance

To Reproduce

Run desc_sort_timestamp with Big5 workload using OS 3.0 server and compare with indices created in OS 2.19 v/s OS 3.0

Expected behavior

desc_sort_timestamp should be equally faster with OS 3.0 index.

Additional Details

Meta

@expani
Copy link
Contributor Author

expani commented Feb 20, 2025

@prudhvigodithi Created an issue for regression with desc_sort_timestamp b/w OS 2.19 and OS 3.0

@mgodwan
Copy link
Member

mgodwan commented Feb 26, 2025

@expani Is the OS 3.0 server running the code in current main? Could you please share the commit as well?

@mgodwan
Copy link
Member

mgodwan commented Feb 26, 2025

Also, to rule out whether the regression is due to OpenSearch integration with Lucene vs certain lucene changes, have you run similar benchmarks directly against Lucene?

@expani
Copy link
Contributor Author

expani commented Feb 26, 2025

Thanks for taking a look @mgodwan

Yes it was mainline commit post reta's PR for Lucene 10 Upgrade along with fix for another regression we found #17329

This is the branch I used in my fork which contain the same changes.

The setup details are mentioned in the META #16934 (comment)

Also, to rule out whether the regression is due to OpenSearch integration with Lucene vs certain lucene changes, have you run similar benchmarks directly against Lucene?

That's a good suggestion to try out FYI @prudhvigodithi

@prudhvigodithi
Copy link
Member

Thanks @mgodwan and @expani, In process on reproducing the numbers with single node and 2 node cluster. Will post some results and findings shortly.

@prudhvigodithi
Copy link
Member

prudhvigodithi commented Feb 26, 2025

desc_sort_timestamp

Using https://github.com/opensearch-project/OpenSearch/pull/17329/files and running on a 2 node cluster I dont see regression for desc_sort_timestamp.

Metric Min Mean Median Max Unit
Throughput 2.0065 2.0079 2.0078 2.0097 ops/s
Metric 50.0% 90.0% 99.0% 100.0% Mean Unit
Latency 7.7993 8.4818 9.3014 11.3231 7.8253 ms
Service Time 6.4602 6.8806 8.1644 10.0046 6.6034 ms
Client Processing Time 0.2553 0.2681 0.2870 0.3106 0.2582 ms
Processing Time 6.8037 7.2246 8.5087 10.3893 6.9520 ms
Raw JSON Data

 {
 "benchmark-version": "1.11.0",
 "benchmark-revision": null,
 "environment": "local",
 "test-execution-id": "52475486-32f5-44b0-b979-63b1a112334c",
 "test-execution-timestamp": "20250226T054626Z",
 "pipeline": "benchmark-only",
 "user-tags": {},
 "workload": "big5",
 "provision-config-instance": [
  "external"
 ],
 "cluster": {
  "revision": "21a924d450b567eaba0cd79159a15efbd6e24382",
  "distribution-version": "3.0.0-SNAPSHOT",
  "distribution-flavor": "oss",
  "provision-config-revision": null
 },
 "results": {
  "op_metrics": [
   {
    "task": "desc_sort_timestamp",
    "operation": "desc_sort_timestamp",
    "throughput": {
     "min": 2.0064874647333277,
     "mean": 2.007877608788571,
     "median": 2.0077727333078834,
     "max": 2.0096717486568525,
     "unit": "ops/s"
    },
    "latency": {
     "50_0": 7.799304999934975,
     "90_0": 8.481775302061578,
     "99_0": 9.301373549242282,
     "100_0": 11.323106999043375,
     "mean": 7.825337960712204,
     "unit": "ms"
    },
    "service_time": {
     "50_0": 6.460237498686183,
     "90_0": 6.880583902238868,
     "99_0": 8.16442375002226,
     "100_0": 10.004610998294083,
     "mean": 6.60335849996045,
     "unit": "ms"
    },
    "client_processing_time": {
     "50_0": 0.255280499914079,
     "90_0": 0.26806040077644866,
     "99_0": 0.2869502815156012,
     "100_0": 0.31063899950822815,
     "mean": 0.2581927903884207,
     "unit": "ms"
    },
    "processing_time": {
     "50_0": 6.8036605007364415,
     "90_0": 7.224638901971048,
     "99_0": 8.508656228332265,
     "100_0": 10.389283001131844,
     "mean": 6.952017930125294,
     "unit": "ms"
    },
    "error_rate": 0.0,
    "duration": 149508.94947399865
   }
  ],
  "correctness_metrics": [
   {
    "task": "desc_sort_timestamp",
    "operation": "desc_sort_timestamp",
    "recall@k": {},
    "recall@1": {},
    "error_rate": 0.0,
    "duration": 149508.94947399865
   }
  ],
  "total_time": 8106590,
  "total_time_per_shard": {
   "min": 8106590,
   "median": 8106590,
   "max": 8106590,
   "unit": "ms"
  },
  "indexing_throttle_time": 0,
  "indexing_throttle_time_per_shard": {
   "min": 0,
   "median": 0,
   "max": 0,
   "unit": "ms"
  },
  "merge_time": 12739943,
  "merge_time_per_shard": {
   "min": 12739943,
   "median": 12739943,
   "max": 12739943,
   "unit": "ms"
  },
  "merge_count": 998,
  "refresh_time": 1118650,
  "refresh_time_per_shard": {
   "min": 1118650,
   "median": 1118650,
   "max": 1118650,
   "unit": "ms"
  },
  "refresh_count": 8992,
  "flush_time": 473326,
  "flush_time_per_shard": {
   "min": 473326,
   "median": 473326,
   "max": 473326,
   "unit": "ms"
  },
  "flush_count": 18,
  "merge_throttle_time": 6119921,
  "merge_throttle_time_per_shard": {
   "min": 6119921,
   "median": 6119921,
   "max": 6119921,
   "unit": "ms"
  },
  "ml_processing_time": [],
  "young_gc_time": 0,
  "young_gc_count": 0,
  "old_gc_time": 0,
  "old_gc_count": 0,
  "memory_segments": 0,
  "memory_doc_values": 0,
  "memory_terms": 0,
  "memory_norms": 0,
  "memory_points": 0,
  "memory_stored_fields": 0,
  "store_size": 25699222076,
  "translog_size": 55,
  "segment_count": 30,
  "total_transform_search_times": [],
  "total_transform_index_times": [],
  "total_transform_processing_times": [],
  "total_transform_throughput": []
 },
 "workload-revision": "e0831c4",
 "test_procedure": "big5",
 "workload-params": {
  "number_of_shards": 1,
  "bulk_indexing_clients": 1,
  "number_of_replicas": 0
 }
}

Run in progress for single node cluster.

@mgodwan
Copy link
Member

mgodwan commented Feb 27, 2025

This may have something to do with segment topology i.e. either how segments are order, and traversed for queries. Or the other culprit can be the merge policy here.

We can explore these 2 directions to start with and understand if they are impacting the performance here.

@prudhvigodithi
Copy link
Member

Raw JSON Data for OS 3.0.0 Single node Before force merge of Segments

{
 "benchmark-version": "1.11.0",
 "benchmark-revision": null,
 "environment": "local",
 "test-execution-id": "fe48fe1c-363d-40bb-8f2a-a61e00f804db",
 "test-execution-timestamp": "20250227T181859Z",
 "pipeline": "benchmark-only",
 "user-tags": {},
 "workload": "big5",
 "provision-config-instance": [
  "external"
 ],
 "cluster": {
  "revision": "21a924d450b567eaba0cd79159a15efbd6e24382",
  "distribution-version": "3.0.0-SNAPSHOT",
  "distribution-flavor": "oss",
  "provision-config-revision": null
 },
 "results": {
  "op_metrics": [
   {
    "task": "desc_sort_timestamp",
    "operation": "desc_sort_timestamp",
    "throughput": {
     "min": 2.006102784207857,
     "mean": 2.007404422863267,
     "median": 2.007316393413575,
     "max": 2.0090902460239737,
     "unit": "ops/s"
    },
    "latency": {
     "50_0": 28.132502498920076,
     "90_0": 28.757467796094716,
     "99_0": 31.533542485558463,
     "100_0": 38.26529299840331,
     "mean": 28.2568119597272,
     "unit": "ms"
    },
    "service_time": {
     "50_0": 25.714421492011752,
     "90_0": 26.51430231053382,
     "99_0": 29.641982536704777,
     "100_0": 35.63450499495957,
     "mean": 26.01236410002457,
     "unit": "ms"
    },
    "client_processing_time": {
     "50_0": 0.278962506854441,
     "90_0": 0.29184489976614714,
     "99_0": 0.31797310177353216,
     "100_0": 0.3241219965275377,
     "mean": 0.28107511898269877,
     "unit": "ms"
    },
    "processing_time": {
     "50_0": 26.091977495525498,
     "90_0": 26.89593130198773,
     "99_0": 30.02315576261029,
     "100_0": 36.02599698933773,
     "mean": 26.39667612995254,
     "unit": "ms"
    },
    "error_rate": 0.0,
    "duration": 149508.8225970103
   }
  ],
  "correctness_metrics": [
   {
    "task": "desc_sort_timestamp",
    "operation": "desc_sort_timestamp",
    "recall@k": {},
    "recall@1": {},
    "error_rate": 0.0,
    "duration": 149508.8225970103
   }
  ],
  "total_time": 0,
  "total_time_per_shard": {
   "min": 0,
   "median": 0,
   "max": 0,
   "unit": "ms"
  },
  "indexing_throttle_time": 0,
  "indexing_throttle_time_per_shard": {
   "min": 0,
   "median": 0,
   "max": 0,
   "unit": "ms"
  },
  "merge_time": 0,
  "merge_time_per_shard": {
   "min": 0,
   "median": 0,
   "max": 0,
   "unit": "ms"
  },
  "merge_count": 0,
  "refresh_time": 1,
  "refresh_time_per_shard": {
   "min": 1,
   "median": 1,
   "max": 1,
   "unit": "ms"
  },
  "refresh_count": 4,
  "flush_time": 34,
  "flush_time_per_shard": {
   "min": 34,
   "median": 34,
   "max": 34,
   "unit": "ms"
  },
  "flush_count": 2,
  "merge_throttle_time": 0,
  "merge_throttle_time_per_shard": {
   "min": 0,
   "median": 0,
   "max": 0,
   "unit": "ms"
  },
  "ml_processing_time": [],
  "young_gc_time": 0,
  "young_gc_count": 0,
  "old_gc_time": 0,
  "old_gc_count": 0,
  "memory_segments": 0,
  "memory_doc_values": 0,
  "memory_terms": 0,
  "memory_norms": 0,
  "memory_points": 0,
  "memory_stored_fields": 0,
  "store_size": 25814690285,
  "translog_size": 55,
  "segment_count": 28,
  "total_transform_search_times": [],
  "total_transform_index_times": [],
  "total_transform_processing_times": [],
  "total_transform_throughput": []
 },
 "workload-revision": "e0831c4",
 "test_procedure": "big5"
}

Ran curl -XPOST "http://localhost:9200/big5/_forcemerge?max_num_segments=10" force merge of segments

Raw JSON Data for OS 3.0.0 Single node After force merge of Segments

{

"benchmark-version": "1.11.0",
"benchmark-revision": null,
"environment": "local",
"test-execution-id": "a3d600ff-be19-4c69-91f1-ff17405baecb",
"test-execution-timestamp": "20250227T183833Z",
"pipeline": "benchmark-only",
"user-tags": {},
"workload": "big5",
"provision-config-instance": [
"external"
],
"cluster": {
"revision": "21a924d450b567eaba0cd79159a15efbd6e24382",
"distribution-version": "3.0.0-SNAPSHOT",
"distribution-flavor": "oss",
"provision-config-revision": null
},
"results": {
"op_metrics": [
{
"task": "desc_sort_timestamp",
"operation": "desc_sort_timestamp",
"throughput": {
"min": 2.0064689416358275,
"mean": 2.007846986452968,
"median": 2.0077454792786407,
"max": 2.00964162072109,
"unit": "ops/s"
},
"latency": {
"50_0": 8.136096505040769,
"90_0": 8.849195500079077,
"99_0": 10.613913459528707,
"100_0": 11.314086004858837,
"mean": 8.302625304786488,
"unit": "ms"
},
"service_time": {
"50_0": 6.837588000053074,
"90_0": 7.19538860139437,
"99_0": 9.528433392406441,
"100_0": 9.61915600055363,
"mean": 6.987126050371444,
"unit": "ms"
},
"client_processing_time": {
"50_0": 0.28004000341752544,
"90_0": 0.29187160107539967,
"99_0": 0.3288995537150188,
"100_0": 0.37033700209576637,
"mean": 0.2827124996110797,
"unit": "ms"
},
"processing_time": {
"50_0": 7.225831002870109,
"90_0": 7.614973008458037,
"99_0": 9.9532163789263,
"100_0": 10.051858989754692,
"mean": 7.372752779483562,
"unit": "ms"
},
"error_rate": 0.0,
"duration": 149507.21402700583
}
],
"correctness_metrics": [
{
"task": "desc_sort_timestamp",
"operation": "desc_sort_timestamp",
"recall@k": {},
"recall@1": {},
"error_rate": 0.0,
"duration": 149507.21402700583
}
],
"total_time": 0,
"total_time_per_shard": {
"min": 0,
"median": 0,
"max": 0,
"unit": "ms"
},
"indexing_throttle_time": 0,
"indexing_throttle_time_per_shard": {
"min": 0,
"median": 0,
"max": 0,
"unit": "ms"
},
"merge_time": 101942,
"merge_time_per_shard": {
"min": 101942,
"median": 101942,
"max": 101942,
"unit": "ms"
},
"merge_count": 2,
"refresh_time": 5,
"refresh_time_per_shard": {
"min": 5,
"median": 5,
"max": 5,
"unit": "ms"
},
"refresh_count": 8,
"flush_time": 34,
"flush_time_per_shard": {
"min": 34,
"median": 34,
"max": 34,
"unit": "ms"
},
"flush_count": 2,
"merge_throttle_time": 0,
"merge_throttle_time_per_shard": {
"min": 0,
"median": 0,
"max": 0,
"unit": "ms"
},
"ml_processing_time": [],
"young_gc_time": 0,
"young_gc_count": 0,
"old_gc_time": 0,
"old_gc_count": 0,
"memory_segments": 0,
"memory_doc_values": 0,
"memory_terms": 0,
"memory_norms": 0,
"memory_points": 0,
"memory_stored_fields": 0,
"store_size": 25803602022,
"translog_size": 55,
"segment_count": 10,
"total_transform_search_times": [],
"total_transform_index_times": [],
"total_transform_processing_times": [],
"total_transform_throughput": []
},
"workload-revision": "e0831c4",
"test_procedure": "big5"
}

Metric Before Force Merge After Force Merge
Segment Count 28 10
50th % Latency 28.13ms 8.13ms
90th % Latency 28.75ms 8.85ms
99th % Latency 31.53ms 10.61ms
100th % Latency 38.26ms 11.31ms
50th % Service Time 25.71ms 6.83ms
90th % Service Time 26.51ms 7.19ms
99th % Service Time 29.64ms 9.52ms
100th % Service Time 35.63ms 9.61ms

@prudhvigodithi
Copy link
Member

Coming from #17404 (comment) both the 2.19 and 3.0 uses "codec" : "best_compression" and "merge.policy" :"log_byte_size", after running _forcemerge?max_num_segments=10 can see performance improvement for desc_sort_timestamp.

@prudhvigodithi
Copy link
Member

Summary of Observations:

Regression Results in 3.0.0:

  • In some cases, 3.0.0 showed no to very minimal regression.
  • However, in direct comparisons using single-segment indices, 2.19.0 consistently outperformed and regression in the 2.19.1 and 3.0.0 versions.
  • Copying the 2.19.0 (which has no regression) index data directory to both 2.19.1 and 3.0.0 resulted in similar performance across all versions, eliminating the regression.

Regression in 2.19.1:

  • Regression observed with indices created in 2.19.1, even when switching the server to the 2.19.0 commit (fd9a9d9) (the underlying index data directory is created by 2.19.1).
  • Regression persists across different segment indices as well as after forcing a merge to 10 and 1 segments.
  • In comparison with 3.0.0, 2.19.1 shows similar regression patterns.

2.19.1 Commit-Based Testing:

  • Tested with all new commits 2.19.0...2.19.1 part of 2.19.1 regression was inconsistent; some tests showed high latency with one segment, while others did not.
  • Initially in my tests 95ff23f had regression, when copying the 2.19.1 index created using commit cd8bcd2 (which performed better) to 95ff23f, the performance was better and matched the performance of cd8bcd2.

Results

Server Version Index version Segment Count 50th percentile latency 90th percentile latency 99th percentile latency 100th percentile latency 50th percentile service time 90th percentile service time 99th percentile service time 100th percentile service time Additional Comments
2.19.1 2.19.1 18 9.92739 10.65 13.9831 14.2725 8.65606 9.17678 12.5065 12.5389 Slight Regression.
2.19.1 2.19.1 10 10.3399 11.0663 14.1869 17.8774 8.91268 9.49801 12.6971 16.032 Regressed.
2.19.1 2.19.1 19 12.1334 12.7664 16.879 17.0225 10.6949 11.2732 15.054 15.3445 Regressed.
2.19.1 2.19.0 17 8.11518 8.79016 10.3165 11.6093 6.72355 7.41405 8.74066 9.75319 Copied data from 2.19.0 to 2.19.1 and performs better.
2.19.1 (From 2.19.0 code, just incremented the version) 2.19.1 (Index created from 2.19.0 code, just incremented the version) 17 8.07909 8.7658 9.71264 10.8374 6.64531 7.22956 8.63907 9.22431 No resgression.
2.19.1 2.19.1 1 77355.3 89378.1 92046.6 92337.7 796.586 830.967 841.592 845.653 Seeing big regression.
2.19.1 2.19.1 10 8.33473 8.94007 11.2916 11.298 6.99523 7.32029 9.54131 10.1921 In this test the 2.19.1 Performs better.
2.19.1 2.19.1 1 467519 539263 555669 557438 2292.68 2318.14 2539.68 2599.95 Seeing big regression.
2.19.1 2.19.0 1 26.306 27.784 36.1235 37.5962 23.9851 25.2292 34.4169 34.7614 Sync the 2.19.0 created index data dir and shows better performance for 2.19.1, reducing the regression for 2.19.1
2.19.1 (commit cd8bcd2) 2.19.1 (commit cd8bcd2) 1 14.2359 14.2359 17.5136 18.3281 12.1831 12.703 16.1255 16.8726 No regression with cd8bcd2.
2.19.1(commit 95ff23f) 2.19.1(commit 95ff23f) 1 19816.9 22954.1 23655.6 23736.7 577.205 583.277 597.071 600.019 Tested with commit-specific server and index setup, saw regression with 95ff23f.
2.19.1(commit 95ff23f) 2.19.1 (commit cd8bcd2) 1 14.2123 15.2824 19.6778 35.8982 12.9926 13.9557 18.0252 34.473 For 95ff23f This is just an release notes commit (using the 2.19.0 code and increment the version to 2.19.1) and shows regression.
2.19.0 2.19.0 17 7.28436 7.84245 9.48493 9.58768 5.98135 6.20064 8.011 8.04267 No regression for 2.19.0.
2.19.0 2.19.0 10 7.01677 7.61107 8.42804 8.55695 5.55215 5.88638 7.4308 7.66245 No regression for 2.19.0.
2.19.0 2.19.0 1 81.2023 83.3823 162.871 166.001 79.8259 81.9172 162.342 164.741  
2.19.0 2.19.0 1 27.3674 29.1602 32.4761 76.728 25.054 27.2204 30.3831 74.6255 No regression for 2.19.0.
2.19.0 2.19.0 10 10.9645 11.4569 16.0222 16.3118 9.8105 10.2055 14.9072 15.311 Performs bad, showing regression
3.0.0 3.0.0 14 6.46991 7.07089 8.31111 8.80342 5.16757 5.48007 6.66206 7.06115 In one test 3.0.0 performed better than 2.19.0
3.0.0 3.0.0 10 5.98909 6.41897 7.10694 7.11835 4.6661 4.84908 6.04857 6.48713 In one test 3.0.0 performed better than 2.19.0
3.0.0 3.0.0 10 8.13432 8.76567 10.2911 10.8397 6.72059 7.0456 9.26147 9.95459  
3.0.0 3.0.0 23 8.331 8.7675 10.5001 11.1139 6.90405 7.04911 8.89292 9.39664  
3.0.0 3.0.0 10 9.39326 10.1931 12.0573 12.5614 8.04174 8.72924 10.3944 10.7029  
3.0.0 3.0.0 11 11.9051 12.8404 16.2201 30.6669 10.5874 11.3366 14.5694 29.4077 Regressed
3.0.0 3.0.0 10 10.9411 11.608 15.3543 15.6527 9.53754 10.1552 13.6784 13.791 Regressed
3.0.0 3.0.0 1 451624 523818 540048 541822 2294.85 2341.8 2528.26 2562.49 Showing huge regression.
3.0.0 3.0.0 1 455229 526198 542451 544229 2280.68 2325.45 2455.84 2463.92 Showing huge regression.
3.0.0 2.19.1 1 450528 521478 537234 539018 2269.86 2307.39 2582.84 2646.86 Copied the 2.19.1 index directory that showed regression in past for 2.19.1 to 3.0.0, even then 3.0.0 shows regression.
3.0.0 2.19.0 1 26.023 27.5519 35.2841 41.9613 23.7929 25.3071 32.878 39.6369 Copied the 2.19.0 index which does not show the regression, with this 3.0.0 also shows no regression
                       

@prudhvigodithi
Copy link
Member

Coming from my observations here #17404 (comment), While I debug more @mgodwan can you please check to see if there is any issue/changes with the indexing side thats causing the regression? In multiple tests using the index data directory that showed no regression on to 3.0.0 and 2.19.1 shows no regression. I'm surprised to see this even for 2.19.1, can you please check and see if you are seeing the results?

Thanks
@getsaurabh02 @expani

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Search:Performance
Projects
Status: Todo
Status: 🆕 New
Development

No branches or pull requests

4 participants