Skip to content

Buffering capacity 16777216 exceeded #749

@Chaho12

Description

@Chaho12

Related Code

If result from Trino is large, larger than default 16mb, a buffering capacity error would occur by the http client.
A hard limit was imposed for logging, but this does not solve the issue.

Suggested Solution

  1. Increase proxy.http-client.max-content-length beyond your largest expected response. Ensure heap sizing matches.

Pro. Simple http client option to use.
Con. Gateway uses great amount of memory.

  1. Re-enable compression (keep/forward Accept-Encoding: gzip) to reduce payloads.

Add Gzip(or custom) format when making request.
https://github.com/trinodb/trino-gateway/blob/main/gateway-ha/src/main/java/io/trino/gateway/proxyserver/ProxyRequestHandler.java#L168-L176

  1. Change the proxy to stream responses instead of buffering, so large result sets don’t need to fit in memory.

@oneonestar Wdyt? On the long run, option 3 sounds best but I think option 2 is also needed.

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