Loom, Postgres, Hikari

Does anyone already solve problem with virtual threads and hikari + postgres? A create semaphore for connections but it didn't help well
22 Replies
JavaBot
JavaBot3mo ago
This post has been reserved for your question.
Hey @Иисус! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st3mo ago
What exactly happens? What do you expect to happen? Do you want to limit concurrency or something else?
JavaBot
JavaBot3mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Иисус
ИисусOP3mo ago
I already add semaphore wrapper around getConnection to limit one time request connection But sometimes I catch error like this
Caused by: java.net.SocketException: Socket closed

at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
... 22 more
Caused by: java.net.SocketException: Socket closed

at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
... 22 more
dan1st
dan1st3mo ago
seems like the DB connection is closed
Иисус
ИисусOP3mo ago
Guys cherry pic my branch without wrapper and get situation like this: 10 pool connection and 100_000 connection requests Does hikari close connection after using?
dan1st
dan1st3mo ago
normally not but idk how you are using hikari
Иисус
ИисусOP3mo ago
Common hikari pool But make wrapper around method for get connection
dan1st
dan1st3mo ago
Can you show the wrapper? Why exactly do you need the wrapper/limit concurrency over it? Can hikari not deal with it?
Иисус
ИисусOP3mo ago
yeah, but currently I am not at home
dan1st
dan1st3mo ago
no problem
Иисус
ИисусOP3mo ago
Yeah, hikari cant treat well with project loom
dan1st
dan1st3mo ago
in what way? Scalability issue/pinning?
Иисус
ИисусOP3mo ago
I create 300_000 parallel database requests in 30 seconds Goal 3_000_000 Increase connection pool I can't, company already allocate 150 on all 15 pods I guess it bigger, but I don't know how much camunda do n+1 work
dan1st
dan1st3mo ago
ok that looks like some connection issue with the DB maybe or whatever Can you reproduce that locally with a local database?
Иисус
ИисусOP3mo ago
I try with 10_000_000 entities but I don't catch any errors! I configure my app like on production but... No, no any exceptions My morning was very fun, manager call me and another two dev leads and say about this problem, but we cant reproduce it on test environments
dan1st
dan1st3mo ago
Can you show the full stack trace? The exception is the issue you are asking about, right?
Иисус
ИисусOP3mo ago
Yeah, I can share this tomorrow when will have access to servers)
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
sooluckyseven
sooluckyseven2mo ago
so you make 10_000 query / sec and yout goal is 100_000 query / sec is your network card bandwidth large enough? parallel database requests is it really 300_000 parallel requests or is it only #core x 2 like HikariCP set.
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
bassemrizk
bassemrizk2mo ago
I will check for you

Did you find this page helpful?