Skip to content

Degraded performance with Apollo Server and v1 #1724

@dackland

Description

@dackland

Describe the bug

Apollo Server with GraphQL Modules v1 appears to be twice as slow as it was with v0.

To Reproduce

I've created a simple repo with three basic servers to demonstrate the performance differences. A load testing script performs as many requests as possible within 10 seconds.

Server Median Request Duration Request Count
Apollo Standalone 236ms 42
Apollo + GQL Modules v0 229ms 43
Apollo + GQL Modules v1 460ms 22

Each server uses the same schema, resolver, and JSON dataset. See the repo for more details and instructions. The test uses a larger dataset (3MB), but we observed a similar 100% latency increase even with smaller payloads.

Expected behavior

Using Apollo Server with GraphQL Modules v1 is similar or better performance to v0.

Environment:

  • OS: macOS
  • graphql-modules: 1.4.2
  • NodeJS: 16.3.0

Additional context

Using createApolloExecutor (as implemented here) instead of createSchemaForApollo seems to address the performance problem. However, using the custom executor broke field usage and resolver tracing in Apollo Studio.

I noticed your benchmarks for Apollo Server are all using createApolloExecutor, so it isn't capturing the slowdown that seems to happen when using createSchemaForApollo.

The docs recommend createSchemaForApollo for Apollo Server, but the API Reference calls both createSchemaForApollo and createApolloExecutor experimental.

Is there a recommended way of using v1 with Apollo Server that is performant and works with Apollo Studio? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions