这是indexloc提供的服务,不要输入任何密码
Skip to content

High CPU when using WS client in Kotlin #8967

@gneeri

Description

@gneeri

Version Information

Server Version:
CLI Version (for CLI related issue):
v2.10.1.cli-migrations-v3

Environment

OSS

What is the current behaviour?

Per the repro demonstration in this linked repository, enabling the useGraphQLWsProtocol option in the Apollo client creation code results in a very significant uptake in CPU usage.

After running the repro and monitoring the network traffic, it appears that the issue is related to the ping/pong messaging involved in the GraphQLWsProtocol. Per the attached PCAP files, the pings appear to originate from the server side, such that configuration changes to the client do not seem to have an impact (i.e., adding a high value to the pingIntervalMillis on the GraphQLWsProtocol.Factory appeared to have no effect).

What is the expected behaviour?

CPU usage should not rise significantly when using the GraphQLWsProtocol.

How to reproduce the issue?

Please see the repo indicated above.

Please provide any traces or logs that could help here.

Please see the attached PCAP files (note: the server was running on port 7070, per the repro).
PCAP_files.zip

Any possible solutions?

One option might be to significantly reduce the ping interval initiated by the server.

Keywords

Websocket CPU Ping

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions