Hi Folks , I read in the slack group that Connect...
# general
v
Hi Folks , I read in the slack group that Connection Pooling is not possible in Pinot . That reduces the capability of my multithreaded low latency java application which I use to read the count of documents and guarantee the arrival . Are there any alternatives . If no , then who can help in suggesting why a reader connection pool is not an option ? @Mayank
m
Are you referring to Pinot Java client?
Also link to the conversation where you read it?
cc: @saurabh dubey ^^
v
@Mayank Yes . Referring to Pinot Java Client .
s
Under the hood, pinot java client uses a singleton instance of async-http-client for all http calls. By default this client has connection pooling and keep-alive enabled. https://github.com/AsyncHttpClient/async-http-client/blob/master/client/src/main/resources/org/asynchttpclient/config/ahc-default.properties#L6
v
Well . If this is a read request only then why this is a singleton . Why the client should not be allowed to make multiple client request at a time ?
m
I think what Saurabh is saying is that the same connection can be reused (concurrently) to make multiple requests. So it should not lead to any concurrency issues? What’s the read qps and latency you want to target?
v
@Mayank SO in the link you have shared with me Saurav said - "`Connection` should be thread safe to use and share. Although, even if you create > 1
Connection
objects, they'll share a singleton
JsonAsyncHttpPinotClientTransport
instance, hence your application will only ever create 1 http client. Although reusing
Connection
should work too." And that response made me think that even if I make 10 connection in a connection pool in my application using java client ,internally there will be only one http clinet serving only one connection at a time . Is that correct ?
m
Yea, I think you can make concurrent requests. Are you running into issues with that?
v
@Mayank Sorry edited my question after your response above .Please have a look again .
m
@Vibhor Jaiswal, no one connection can serve multiple requests at the same time (at least that’s how I am reading @saurabh dubey’s response).
I’d recommend to go ahead and do a qps testing and let us know if you are hitting any scaling issues
v
ok
s
@Vibhor Jaiswal "`Connection` should be thread safe to use and share. Although, even if you create > 1
Connection
objects, they'll share a singleton
JsonAsyncHttpPinotClientTransport
instance, hence your application will only ever create 1 http client. Although reusing
Connection
should work too." Was referring to the
Connection
class (
org.apache.pinot.client.Connection
) objects within pinot client. Creation of a new instance of this class does not lead to an actual TCP connection being opened b/w the application and pinot brokers. The connection pooling that the http client allows is for the actual TCP connections (more specifically the netty channels since the client is netty based). I.e. you can create as many
org.apache.pinot.client.Connection
as you'd like, but the actual tcp connections being created will be limited by the client defaults, and will always be pooled.