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

receive: use s2 when decompressing snappy data, reduce CPU usage for incoming remote write requests by ~5-7% #4354

Merged
merged 2 commits into from
Jun 22, 2021

Commits on Jun 17, 2021

  1. receive: use s2 when decompressing snappy data

    Use https://github.com/klauspost/compress/tree/master/s2#s2-compression
    for decompressing Snappy data. I think if this pays off then we could
    also try using this in Prometheus for encoding?
    
    Benchmarks show these numbers:
    ```
    benchmark                                                                                       old ns/op     new ns/op     delta
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_500_of_them/OK-16                         1139713       1071864       -5.95%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_500_of_them/conflict_errors-16            1294286       1207937       -6.67%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_5000_of_them/OK-16                        11613568      10849901      -6.58%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_5000_of_them/conflict_errors-16           13100752      12478380      -4.75%
    BenchmarkHandlerReceiveHTTP/extremely_large_label_value_10MB,_10_of_them/OK-16                  96128949      89515761      -6.88%
    BenchmarkHandlerReceiveHTTP/extremely_large_label_value_10MB,_10_of_them/conflict_errors-16     96769948      90741611      -6.23%
    
    benchmark                                                                                       old allocs     new allocs     delta
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_500_of_them/OK-16                         4578           4578           +0.00%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_500_of_them/conflict_errors-16            7618           7617           -0.01%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_5000_of_them/OK-16                        45325          45324          -0.00%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_5000_of_them/conflict_errors-16           75133          75133          +0.00%
    BenchmarkHandlerReceiveHTTP/extremely_large_label_value_10MB,_10_of_them/OK-16                  81             82             +1.23%
    BenchmarkHandlerReceiveHTTP/extremely_large_label_value_10MB,_10_of_them/conflict_errors-16     203            202            -0.49%
    
    benchmark                                                                                       old bytes     new bytes     delta
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_500_of_them/OK-16                         1254474       1254280       -0.02%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_500_of_them/conflict_errors-16            1427791       1427618       -0.01%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_5000_of_them/OK-16                        13826832      13806752      -0.15%
    BenchmarkHandlerReceiveHTTP/typical_labels_under_1KB,_5000_of_them/conflict_errors-16           15412336      15412232      -0.00%
    BenchmarkHandlerReceiveHTTP/extremely_large_label_value_10MB,_10_of_them/OK-16                  120041647     120018331     -0.02%
    BenchmarkHandlerReceiveHTTP/extremely_large_label_value_10MB,_10_of_them/conflict_errors-16     119704515     119701011     -0.00%
    ```
    
    Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
    GiedriusS committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    587ede6 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2021

  1. CHANGELOG: add entry

    Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
    GiedriusS committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    258db7b View commit details
    Browse the repository at this point in the history