-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
roachtest: measure connections/node and memory consumption #25404
Comments
@knz from the SQL perspective, approximately how much memory do you expect an idle sql client conn to consume? |
Back in 2016 when I chose the upfront allocation constant ( I see the value has been bumped to 21K since -- apparently even the simplest SQL queries will use up to 10K (I'm not entirely surprised by that), and the initial bump from the baseline 10K to 20K by the first query in every session used to be logged and thus make the log file too chatty. Since then we have reduced the logging so perhaps we could reduce the base allocation (needs to be calibrated again) |
Note my previous answer is only about heap allocs on behalf of the SQL session once it's established.
I did not count the size of the goroutine, especially its stack.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Our target is 3K active connections per node, but with relatively small datasets per connection (i.e. these aren't big, sweeping transactions that touch a lot of rows). If we could do 5MiB/connection, that'd be ~15GiB for all 3K connections, and roughly half the available RAM on the node. I'd expect an idle connection to consume in the tens to hundreds of KiB of RAM. |
Last time I checked that's where we are indeed. |
@knz how can I measure that on my cluster? I'm getting frequent node crashes (kernel OOM killer) with well under 2000 connections on a 32GiB node. |
ping @knz |
How to measure per-connection memory usage?
Then you have it, memory usage per client + baseline. |
Folding this into #10320. |
Repurposing this issue somewhat. We want to give baseline expectations on how many client connections per node a cluster can handle. Certainly this will depend on the workload, the configured sql memory, and background operations in the cluster (memory is really the limiting factor here), but we should at least obtain (and uphold) ballpark estimates for simple workloads, such as
SELECT 1
(i.e. basically idling).kv
(with small data)@knz outlined the following approach for measuring basic per-connection memory usage:
Doing this on a single node cluster is a good first step, but we should also do this on real clusters to a ccount for their increased memory consumption due to coordination.
Original post below.
Reported on Gitter by user @erichocean. My working assumption is that this is the lack of memory management in the storage layer, something that we should try to verify via heap profiles. This is the same cluster as in #25403.
The text was updated successfully, but these errors were encountered: