Skip to content

gRPC Client Threads Concept  #6340

@abhilash93

Description

@abhilash93

Client Thread Consuming & Queue Logic Questions

I have a server stream rpc call

example
rpc telemetrySubscribe(SubscriptionRequest) returns (stream OpenConfigData)
(https://github.com/nileshsimaria/jtimon/blob/master/telemetry/telemetry.proto)

I have grpc Client request created using java and used the StreamObserver onNext

I am trying to understand threading and queuing concept on the client side.

  • What happens if message on the server side are queuing up fast and the client is been consuming it slow. After 2 hour the TCP connection closed, as the server message are getting queued (GRPC_ARG_KEEPALIVE_TIME_MS is 7200000 (2 hours))

  • I have written my processing logic in onNext, will this cause it to slow down the consuming of messages?

  • How is the order of the message maintained in the client, if cachedPool is used?

  • Will overriding the executor with to more number of thread pool withExecutor(Executors.newFixedThreadPool(20) help?

  • I have also tried using MoreExecutors.newSequentialExecutor(Executors.newSingleThreadExecutor()), will this slow down the client consuming of messages?

  • What is the efficient executor in MoreExecutors to process messages sequential and fast?

  • Will client host device CPU/Memory constrains restrict the number messages being consumed per min?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions