diff --git a/.changesets/fix_query_hash_speedup.md b/.changesets/fix_query_hash_speedup.md deleted file mode 100644 index fe66cf05a3..0000000000 --- a/.changesets/fix_query_hash_speedup.md +++ /dev/null @@ -1,7 +0,0 @@ -### Improve performance of query hashing by using a precomputed schema hash ([PR #6622](https://github.com/apollographql/router/pull/6622)) - -The router now uses a simpler and faster query hashing algorithm with more predictable CPU and memory usage. This improvement is enabled by using a precomputed hash of the entire schema, rather than computing and hashing the subset of types and fields used by each query. - -For more details on why these design decisions were made, please see the [PR description](https://github.com/apollographql/router/pull/6622) - -By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/6622 \ No newline at end of file diff --git a/.changesets/fix_simon_rayonless_sysinfo.md b/.changesets/fix_simon_rayonless_sysinfo.md deleted file mode 100644 index a2b7e06a4b..0000000000 --- a/.changesets/fix_simon_rayonless_sysinfo.md +++ /dev/null @@ -1,12 +0,0 @@ -### Fix increased memory usage in `sysinfo` since Router 1.59.0 ([PR #6634](https://github.com/apollographql/router/pull/6634)) - -In version 1.59.0, Apollo Router started using the `sysinfo` crate to gather metrics about available CPUs and RAM. By default, that crate uses `rayon` internally to parallelize its handling of system processes. In turn, rayon creates a pool of long-lived threads. - -In a particular benchmark on a 32-core Linux server, this caused resident memory use to increase by about 150 MB. This is likely a combination of stack space (which only gets freed when the thread terminates) and per-thread space reserved by the heap allocator to reduce cross-thread synchronization cost. - -This regression is now fixed by: - -* Disabling `sysinfo`’s use of `rayon`, so the thread pool is not created and system processes information is gathered in a sequential loop. -* Making `sysinfo` not gather that information in the first place since Router does not use it. - -By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/6634 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c0e4a4608..a1a0379ba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,46 @@ All notable changes to Router will be documented in this file. This project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html). +# [1.59.2] - 2025-01-28 + +> [!IMPORTANT] +> +> This release contains important fixes which address resource utilization regressions which impacted Router v1.59.0 and v1.59.1. These regressions were in the form of: +> +> 1. A small baseline increase in memory usage; AND +> 2. Additional per-request CPU and memory usage for queries which included references to abstract types with a large number of implementations +> +> If you have enabled [Distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), this release contains changes which necessarily alter the hashing algorithm used for the cache keys. On account of this, you should anticipate additional cache regeneration cost when updating between these versions while the new hashing algorithm comes into service. + +## 🐛 Fixes + +### Improve performance of query hashing by using a precomputed schema hash ([PR #6622](https://github.com/apollographql/router/pull/6622)) + +The router now uses a simpler and faster query hashing algorithm with more predictable CPU and memory usage. This improvement is enabled by using a precomputed hash of the entire schema, rather than computing and hashing the subset of types and fields used by each query. + +For more details on why these design decisions were made, please see the [PR description](https://github.com/apollographql/router/pull/6622) + +By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/6622 + +### Fix increased memory usage in `sysinfo` since Router 1.59.0 ([PR #6634](https://github.com/apollographql/router/pull/6634)) + +In version 1.59.0, Apollo Router started using the `sysinfo` crate to gather metrics about available CPUs and RAM. By default, that crate uses `rayon` internally to parallelize its handling of system processes. In turn, rayon creates a pool of long-lived threads. + +In a particular benchmark on a 32-core Linux server, this caused resident memory use to increase by about 150 MB. This is likely a combination of stack space (which only gets freed when the thread terminates) and per-thread space reserved by the heap allocator to reduce cross-thread synchronization cost. + +This regression is now fixed by: + +* Disabling `sysinfo`’s use of `rayon`, so the thread pool is not created and system processes information is gathered in a sequential loop. +* Making `sysinfo` not gather that information in the first place since Router does not use it. + +By [@SimonSapin](https://github.com/SimonSapin) in https://github.com/apollographql/router/pull/6634 + # [1.59.1] - 2025-01-08 +> [!IMPORTANT] +> +> This release was impacted by a resource utilization regression which was fixed in [v1.59.2](#1592---2025-01-28). See the release notes for that release for more details. As a result, we recommend using v1.59.2 rather than v1.59.1 or v1.59.0. + ## 🐛 Fixes ### Fix transmitted header value for Datadog priority sampling resolution ([PR #6017](https://github.com/apollographql/router/pull/6017)) @@ -64,6 +102,10 @@ By [@BrynCooke](https://github.com/BrynCooke) in https://github.com/apollographq # [1.59.0] - 2024-12-17 +> [!IMPORTANT] +> +> This release was impacted by a resource utilization regression which was fixed in [v1.59.2](#1592---2025-01-28). See the release notes for that release for more details. As a result, we recommend using v1.59.2 rather than v1.59.1 or v1.59.0. + > [!IMPORTANT] > If you have enabled [distributed query plan caching](https://www.apollographql.com/docs/router/configuration/distributed-caching/#distributed-query-plan-caching), updates to the query planner in this release will result in query plan caches being regenerated rather than reused. On account of this, you should anticipate additional cache regeneration cost when updating to this router version while the new query plans come into service. diff --git a/Cargo.lock b/Cargo.lock index dae73bc66a..0f39611472 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,7 +204,7 @@ dependencies = [ [[package]] name = "apollo-federation" -version = "1.59.2-rc.0" +version = "1.59.2" dependencies = [ "apollo-compiler", "derive_more", @@ -257,7 +257,7 @@ dependencies = [ [[package]] name = "apollo-router" -version = "1.59.2-rc.0" +version = "1.59.2" dependencies = [ "access-json", "ahash", @@ -427,7 +427,7 @@ dependencies = [ [[package]] name = "apollo-router-benchmarks" -version = "1.59.2-rc.0" +version = "1.59.2" dependencies = [ "apollo-parser", "apollo-router", @@ -443,7 +443,7 @@ dependencies = [ [[package]] name = "apollo-router-scaffold" -version = "1.59.2-rc.0" +version = "1.59.2" dependencies = [ "anyhow", "cargo-scaffold", diff --git a/apollo-federation/Cargo.toml b/apollo-federation/Cargo.toml index 591294b806..e7aa3448bd 100644 --- a/apollo-federation/Cargo.toml +++ b/apollo-federation/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-federation" -version = "1.59.2-rc.0" +version = "1.59.2" authors = ["The Apollo GraphQL Contributors"] edition = "2021" description = "Apollo Federation" diff --git a/apollo-router-benchmarks/Cargo.toml b/apollo-router-benchmarks/Cargo.toml index 2fec2d2156..9c331511c3 100644 --- a/apollo-router-benchmarks/Cargo.toml +++ b/apollo-router-benchmarks/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-benchmarks" -version = "1.59.2-rc.0" +version = "1.59.2" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/Cargo.toml b/apollo-router-scaffold/Cargo.toml index 940c7e3e2e..977247ed7a 100644 --- a/apollo-router-scaffold/Cargo.toml +++ b/apollo-router-scaffold/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router-scaffold" -version = "1.59.2-rc.0" +version = "1.59.2" authors = ["Apollo Graph, Inc. "] edition = "2021" license = "Elastic-2.0" diff --git a/apollo-router-scaffold/templates/base/Cargo.template.toml b/apollo-router-scaffold/templates/base/Cargo.template.toml index aa79e7f93f..3f48e70842 100644 --- a/apollo-router-scaffold/templates/base/Cargo.template.toml +++ b/apollo-router-scaffold/templates/base/Cargo.template.toml @@ -22,7 +22,7 @@ apollo-router = { path ="{{integration_test}}apollo-router" } apollo-router = { git="https://github.com/apollographql/router.git", branch="{{branch}}" } {{else}} # Note if you update these dependencies then also update xtask/Cargo.toml -apollo-router = "1.59.2-rc.0" +apollo-router = "1.59.2" {{/if}} {{/if}} async-trait = "0.1.52" diff --git a/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml b/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml index e3902c6d67..3e95f60dce 100644 --- a/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml +++ b/apollo-router-scaffold/templates/base/xtask/Cargo.template.toml @@ -13,7 +13,7 @@ apollo-router-scaffold = { path ="{{integration_test}}apollo-router-scaffold" } {{#if branch}} apollo-router-scaffold = { git="https://github.com/apollographql/router.git", branch="{{branch}}" } {{else}} -apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.59.2-rc.0" } +apollo-router-scaffold = { git = "https://github.com/apollographql/router.git", tag = "v1.59.2" } {{/if}} {{/if}} anyhow = "1.0.58" diff --git a/apollo-router/Cargo.toml b/apollo-router/Cargo.toml index 3a7b590257..10c89d9c3c 100644 --- a/apollo-router/Cargo.toml +++ b/apollo-router/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apollo-router" -version = "1.59.2-rc.0" +version = "1.59.2" authors = ["Apollo Graph, Inc. "] repository = "https://github.com/apollographql/router/" documentation = "https://docs.rs/apollo-router" @@ -66,7 +66,7 @@ features = ["docs_rs"] access-json = "0.1.0" anyhow = "1.0.86" apollo-compiler.workspace = true -apollo-federation = { path = "../apollo-federation", version = "=1.59.2-rc.0" } +apollo-federation = { path = "../apollo-federation", version = "=1.59.2" } arc-swap = "1.6.0" async-channel = "1.9.0" async-compression = { version = "0.4.6", features = [ diff --git a/dockerfiles/tracing/docker-compose.datadog.yml b/dockerfiles/tracing/docker-compose.datadog.yml index c0a8be13d4..f0f6d3b8e8 100644 --- a/dockerfiles/tracing/docker-compose.datadog.yml +++ b/dockerfiles/tracing/docker-compose.datadog.yml @@ -3,7 +3,7 @@ services: apollo-router: container_name: apollo-router - image: ghcr.io/apollographql/router:v1.59.2-rc.0 + image: ghcr.io/apollographql/router:v1.59.2 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/datadog.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.jaeger.yml b/dockerfiles/tracing/docker-compose.jaeger.yml index 8dd7b884cf..1ea2fc3902 100644 --- a/dockerfiles/tracing/docker-compose.jaeger.yml +++ b/dockerfiles/tracing/docker-compose.jaeger.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router #build: ./router - image: ghcr.io/apollographql/router:v1.59.2-rc.0 + image: ghcr.io/apollographql/router:v1.59.2 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/jaeger.router.yaml:/etc/config/configuration.yaml diff --git a/dockerfiles/tracing/docker-compose.zipkin.yml b/dockerfiles/tracing/docker-compose.zipkin.yml index c2198a7ba5..ee9724d7ee 100644 --- a/dockerfiles/tracing/docker-compose.zipkin.yml +++ b/dockerfiles/tracing/docker-compose.zipkin.yml @@ -4,7 +4,7 @@ services: apollo-router: container_name: apollo-router build: ./router - image: ghcr.io/apollographql/router:v1.59.2-rc.0 + image: ghcr.io/apollographql/router:v1.59.2 volumes: - ./supergraph.graphql:/etc/config/supergraph.graphql - ./router/zipkin.router.yaml:/etc/config/configuration.yaml diff --git a/helm/chart/router/Chart.yaml b/helm/chart/router/Chart.yaml index 9fa61c47f6..4dc6448209 100644 --- a/helm/chart/router/Chart.yaml +++ b/helm/chart/router/Chart.yaml @@ -20,10 +20,10 @@ type: application # so it matches the shape of our release process and release automation. # By proxy of that decision, this version uses SemVer 2.0.0, though the prefix # of "v" is not included. -version: 1.59.2-rc.0 +version: 1.59.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v1.59.2-rc.0" +appVersion: "v1.59.2" diff --git a/helm/chart/router/README.md b/helm/chart/router/README.md index a4781de1b0..845b23393d 100644 --- a/helm/chart/router/README.md +++ b/helm/chart/router/README.md @@ -2,7 +2,7 @@ [router](https://github.com/apollographql/router) Rust Graph Routing runtime for Apollo Federation -![Version: 1.59.2-rc.0](https://img.shields.io/badge/Version-1.59.2--rc.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.59.2-rc.0](https://img.shields.io/badge/AppVersion-v1.59.2--rc.0-informational?style=flat-square) +![Version: 1.59.2](https://img.shields.io/badge/Version-1.59.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.59.2](https://img.shields.io/badge/AppVersion-v1.59.2-informational?style=flat-square) ## Prerequisites @@ -11,7 +11,7 @@ ## Get Repo Info ```console -helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.59.2-rc.0 +helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.59.2 ``` ## Install Chart @@ -19,7 +19,7 @@ helm pull oci://ghcr.io/apollographql/helm-charts/router --version 1.59.2-rc.0 **Important:** only helm3 is supported ```console -helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.59.2-rc.0 --values my-values.yaml +helm upgrade --install [RELEASE_NAME] oci://ghcr.io/apollographql/helm-charts/router --version 1.59.2 --values my-values.yaml ``` _See [configuration](#configuration) below._ diff --git a/licenses.html b/licenses.html index 51edb0313b..eb0c982eb6 100644 --- a/licenses.html +++ b/licenses.html @@ -6115,13 +6115,13 @@

Used by:

Apache License 2.0

Used by:

    -
  • anyhow
  • async-trait
  • basic-toml
  • dyn-clone
  • erased-serde
  • ghost
  • itoa
  • +
  • libc
  • linkme
  • paste
  • prettyplease
  • @@ -11933,8 +11933,6 @@

    Used by:

    Apache License 2.0

    Used by:

    ../../LICENSE-APACHE
    @@ -12586,6 +12584,10 @@

    Used by:

    Apache License 2.0

    Used by:

      +
    • android_system_properties
    • +
    • anyhow
    • +
    • apollo-compiler
    • +
    • apollo-parser
    • async-graphql-axum
    • async-graphql-derive
    • async-graphql-parser
    • @@ -12600,7 +12602,6 @@

      Used by:

    • graphql_query_derive
    • http-serde
    • ident_case
    • -
    • libc
    • libssh2-sys
    • linkme-impl
    • md5
    • @@ -12689,27 +12690,6 @@

      Used by:

      http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - -
    • -

      Apache License 2.0

      -

      Used by:

      - -
      Copyright 2016 Nicolas Silva
      -
      -Licensed under the Apache License, Version 2.0 (the "License");
      -you may not use this file except in compliance with the License.
      -You may obtain a copy of the License at
      -
      -    http://www.apache.org/licenses/LICENSE-2.0
      -
       Unless required by applicable law or agreed to in writing, software
       distributed under the License is distributed on an "AS IS" BASIS,
       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      @@ -17749,9 +17729,6 @@ 

      Used by:

    • icu_provider_macros
    • litemap
    • tinystr
    • -
    • writeable
    • -
    • yoke
    • -
    • yoke-derive
    • zerofrom
    • zerofrom-derive
    • zerovec
    • @@ -17796,6 +17773,62 @@

      Used by:

      not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. +
      +
    • +
    • +

      Unicode License v3

      +

      Used by:

      + +
      UNICODE LICENSE V3
      +
      +COPYRIGHT AND PERMISSION NOTICE
      +
      +Copyright © 2020-2024 Unicode, Inc.
      +
      +NOTICE TO USER: Carefully read the following legal agreement. BY
      +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
      +SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
      +TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
      +DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
      +
      +Permission is hereby granted, free of charge, to any person obtaining a
      +copy of data files and any associated documentation (the "Data Files") or
      +software and any associated documentation (the "Software") to deal in the
      +Data Files or Software without restriction, including without limitation
      +the rights to use, copy, modify, merge, publish, distribute, and/or sell
      +copies of the Data Files or Software, and to permit persons to whom the
      +Data Files or Software are furnished to do so, provided that either (a)
      +this copyright and permission notice appear with all copies of the Data
      +Files or Software, or (b) this copyright and permission notice appear in
      +associated Documentation.
      +
      +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
      +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
      +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
      +THIRD PARTY RIGHTS.
      +
      +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
      +BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
      +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
      +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
      +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
      +FILES OR SOFTWARE.
      +
      +Except as contained in this notice, the name of a copyright holder shall
      +not be used in advertising or otherwise to promote the sale, use or other
      +dealings in these Data Files or Software without prior written
      +authorization of the copyright holder.
      +
      +SPDX-License-Identifier: Unicode-3.0
      +
      +—
      +
      +Portions of ICU4X may have been adapted from ICU4C and/or ICU4J.
      +ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others.
       
    • diff --git a/scripts/install.sh b/scripts/install.sh index 84036c72de..46cac84a7b 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -11,7 +11,7 @@ BINARY_DOWNLOAD_PREFIX="https://github.com/apollographql/router/releases/downloa # Router version defined in apollo-router's Cargo.toml # Note: Change this line manually during the release steps. -PACKAGE_VERSION="v1.59.2-rc.0" +PACKAGE_VERSION="v1.59.2" download_binary() { downloader --check