Broken SQL Connection pooling #10734
-
Environmental Info: Node(s) CPU architecture, OS, and Version: Cluster Configuration: Describe the bug:
I tried to increase the Expected behavior: Actual behavior: Additional context / logs:
excerpt from the server logs
many thanks for the help :) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Kine does use the default golang sql client connection pool support. There is nothing here that is K3s or Kine specific. Connection pooling does not help you if your database is slow. If a client makes a request from the apiserver that requires a query to the datastore, and there are no pooled connections available (because all the current connections are tied up waiting for an existing query to complete), it will open a new connection. You now have even more queries running, and the database just gets even slower. I would probably try to figure out why your database is running so slow. Is compaction failing? You should see this in your logs. If it is, you could try manually compacting, or just letting a single K3s server run for a while and see if it is able to compact successfully without additional client load. |
Beta Was this translation helpful? Give feedback.
-
thank you very much for the quick reply. I have already seen this issue here where you recommended running only one server in the hope that compacting will work. Unfortunately, this has not helped me so far. If a server is running (and therefore sending requests to the database at the same time) then queries are already very slow. Here is an example:
I have checked the logs of the k3s server with journalctl. it seems to me that the compact last ran correctly 20 days ago. Since then it seems that I have these problems. currently it is not running. Is there any way to manually trigger or perform this to make the database faster again?
|
Beta Was this translation helpful? Give feedback.
-
as you can see here on startup of the server there are many queries. When the server starts i also see the old errors again, befor the service dies i can see this error:
I can try to increase the max connections again to see it the server can read an "active" status |
Beta Was this translation helpful? Give feedback.
You can try running a manual compact query while k3s is down. This is mysql syntax; you might have to tweak it for postgres.