-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client service uses all ports #74
Comments
Hello. Code in the first snippet looks correct. From what I understand - you don't use Connection Pool. Is that correct? What driver version do you use? Also, second snippet doesn't close the connections. While first one - does. |
Yes first one close connection every batch insert in second one I try to reuse connections if they are not closed. Yes I don't use Connection Pool and I try clickhouse4j 1.1.1 and 1.4.1 with same results. |
If you want to reuse the connection I would recommend you to use the Connection pool. Because connections are not threadsafe and managing multiple connections would be a tricky task. While connection pools keeps them keep-alive, managing them and makes access to them threadsafe. Also, few comments regarding you code: You don't need to make connection and prepared statement as |
@rado-r do you use the code without |
@rado-r I did a quick fix - https://github.com/blynkkk/clickhouse4j/releases/download/clickhouse4j-1.4.1/clickhouse4j-1.4.2-SNAPSHOT.jar Could you please check? |
@rado-r hello. do you have any updates? Also, what Java version do you have? |
@doom369 thank's for very fast response I test it and now it is fixed. I test old released version with connection pool (Hikari) but it don't releases ports too but it was only hundreds of ports. After this fix it is 0 ports. So gread job. We use Java 8. |
@rado-r so you used the provided build and it is fixes the issue, is that correct? How many open connections did you saw? Were they in |
@doom369 yes provided build fix the issue.
|
What do you think when it will be on maven? |
We will try to release today. However, this situation is very strange. Because in this driver we rely on Could you please provide also exact version of JVM and OS? |
It should be
in docker |
Hi,
We are testing ClickHouse with your connector and you did a great job with it. But we have a problem. When we run service in AWS as docker and try to insert a lot of records (2 billion) I don't know what is happening but connector gradually uses all ports in docker and never release it.
I try to close every connection in try catch and get a new connection for every batch insert. And I try to get new connection only if it was closed it was better because service uses fewer ports but still it was thousands of ports.
Can someone help? Is It known problem or do I something wrong?
The text was updated successfully, but these errors were encountered: