https://slatedb.io logo
Hey there - we're testing out SlateDB
# general
f
Hey there - we're testing out SlateDB for some internal workloads. Does anyone have any general scaling stats for single slate instances? We are running into issues once a single slatedb instance gets into the 10s of GBs (s3 size), for example. Typically compaction is a bottleneck and we start to get some level of backpressure on writes. Tuning seems somewhat challenging atm. Is there any guidance on general parms and tuning to be aware of? Right now, we are just running synthetic workloads with put/get 50:50 ratio and some level of deletes thrown in there
c
👋 moving convo here to keep #general quiet
cc @Pierre
The first and most obvious question: Is your SlateDB client running inside AWS? Or is it on your laptop?
f
We're running internally in our company infra, we have an S3 compatible endpoint we use and then our own object storage service
c
I see.. 🤔
It's all in the same network in the same zone?
f
Latencies are a bit higher than what we observe through s3
c
(to steal cloud terminology)
f
Our p99 latency might be 1.5x what you may see running internally on aws. Maybe 2x at times if that makes a big difference
c
K, what about throughput: What's the bandwidth you see uploading/downloading to/from your S3-equivalent
f
We're doing some aggregation prior to calling slatedb, we see our p99 object size in the 4-8MB range and let me see how many of those we're doing per second...
c
It'd be good to know outside of slatedb how fast the store is
like just a raw upload/download
f
We're typically in the 1-2 second range for puts and around 1s or faster for gets at p99
Throughput looks like 5-10MB / second
Some periods going to zero right now, which I assume is the backpressure kicking in possibly
p
That's awful
c
I want to clarify that 5-10MB/s. Is that the performance you see from your object store when uploading/downloading files directly to it?
Or is that the performance you see when reading/writing to your SlateDB client.. (there could be a ton of actual bandwidth going on under the hood for compaction in that case)
Some kind of raw measurement of network utilization on the node the client is running on would be really nice
We just added throughput logs for compaction in
main
, but they're not released yet
f
5-10MB / second is coming from an upstream client, so that's what we are passing through to slate
c
I see, so you're reading 5-10MB/s from somewhere, then sending that data to SlateDB as put's (and gets?)
f
Yea, it's just synthetic data we're putting. Get throughput is <1MB/sec
c
(sorry for all these questions, but really trying to understand the contours of the problem)
Are you seeing backpressure log lines in the logs?
f
yes, on the backpressure.
mem_size is ~1GB, wal size bytes is .35GB, imm_memtable .7GB and max unflushed is 1GB
I believe 1GB is the limit we have currently. Everything else should should be on defaults
c
Can you paste your complete Settings? It's printed when the process begins
(make sure to redact bucket URLs and such)
p
I think that'd be really helpful
Because if the throughput to / from the object store is just low... 😛
f
Hmm, we have no throughput limitations to our internal OS from slatedb. Generally a pretty large host with a 10G link. Could latency be an issue?
c
It's possible.. Is
await_durability=true
for writes
I think: 1. Pasting config log line here 2. Showing us
ifstat
or equivalent network utilization while the SlateDB process is running would be helpful
also, which version are you running on? 😅
f
yes await_durable is true
c
This is quite likely the problem
But let's take one thing at a time
Or "problem"
If you can get 1 & 2, we can go from there
f
0.8.2 is our version, let me get the configs exactly...
c
Gotcha. That's a bit old now, but should be okay-ish. I'd recommend bumping to 0.9.2 if you can. I don't think it'll affect your current issue, though.
f
"flush_interval": "100ms", "manifest_poll_interval":"1s", "manifest_update_timeout" :"300s", "min_filter _keys":1000, "filter _bits_per_key":10, "10_sst_size_bytes" :67108864, "10_max_ssts" :62500, "max_unflushed_bytes": 1073741824, "compactor _options": ("poll _interval": "5s", "manifest_update_timeout": "300 ", "max_sst_size" :268435456, "max_concurrent_compactions" :4), "compression_codec" :null, "object_store_cache_options":{"root_folder":"/data/cache", "max_cache_size_bytes" :1099511627776, "part_size_bytes" : 4194384, "cache_puts":false, "preload_disk_cache_on_startup" :nul], "scan_interval": "3600s"), "garbage-collector_options" :null, "default_ttl": null...
c
Seems incomlete (null..)
f
that should end with a }]
c
I suspect what's happening is: 1. "flush_interval": "100ms" 2. await_durable=true 3. every put() call is waiting 0-100ms for the flush interval to kick in PLUS whatever your object store latency is
How many threads are calling put() on the DB? is it just a single thread?
The backpressure does indicate compaction pressure, tjho
So let's see what
ifstat
says 🙂
f
Could be a few - is that write_batch_count?
c
"10_max_ssts" :62500
🤯
hmm that's a 1 not an
l
.. 🤔
f
I had to do some nlp to get the config startup log, so it should be l0...
I think we bumped that way high due to backpressure on max l0 ssts we were seeing, but probably doesn't help much at some point...
p
Seems like we don't need compaction anymore
c
Yea it should delay t he backpressure for quite a while
But it won't make the underlying problem go away if you run long enough
Let's see what ifstat says... and I really would love to take SlateDB out of the equation and see what your raw throughput is from the machine to your object store..
f
That shouldn't be a bottleneck. We should technically be able to saturate the source node before we hit any bottlenecks against our OS
but maybe there is some other limit there so I can entertain that idea 🙂
c
Yea, since this stuff is proprietary, though, it's hard for me to reason about. Hard numbers help a lot. "saturate the node" could mean it's saturated at 1 meg a second or 10 gigs a second. 😛
f
Yea, in the 10Gbps range
c
K that's good to know. Then I'm curious what the ifstat shows
@Frank S you might want to apply [this patch](https://github.com/slatedb/slatedb/pull/1027) to 0.9.2 and run it. It'll give you more throughput info for each compaction.
Another wacky question: are you running rust, or are you running through a binding such as go or python
f
General rx seems to be peaking out at 5Gbps and tx around 512Mbps or so
Running through through go binding
c
No known issues
f
Any issues with the go bindings?
c
Gotcha.
I just don't think it's been used as thorougly. It's a very thin binding, though.
This seems reasonable.
not great, though
🤔
To clarify: 512Mbps = megaBITs right?
wanna make sure we're talking the same 8th 😛
f
Yea
Is it worthwhile running compaction on a separate host?
c
Ehhh.. I don't think we're at that point yet. You should be able to get better than 5-10mb/s
So total tx on the box is seeing 64MB/s.. that's pretty low
The rx seems quite high.. or at least good enough
Makes me wonder if @Pierre 's cache intuition was correct
p
That's why I require it on zerofs, even 1GB makes a huge difference
c
I do see it appears to be configured
Copy code
"object_store_cache_options":{"root_folder":"/data/cache", "max_cache_size_bytes" :1099511627776, "part_size_bytes" :
4194384, "cache_puts":false, "preload_disk_cache_on_startup" :nul]
p
(Be careful that it's not on some slow networked block device)
c
It looks like you have it set to 1TB?
would you mind doing a
du -h /data/cache
and seeing how big the cache is on disk?
It might also be worth trying with
"cache_puts":true
I mean.. a 1TB cache with a 1TB database size should be fully cached 🤣
So seeing 5gbps rx is...odd
@Frank S Another wacky question: did you guys test bumping up
max_concurrent_compactions
? (it defaults to 4)
f
Hmm interesting, not sure why that was tweaked. That's just local disk cache right? I think we are filling that
I'll give this a try too
c
object_store_cache_options
is local disk cache. It caches object store objects .. partitioned int 4MiB blocks.
I would expect /data/cache
du -h
to show 500GB-1TB
Curious if it does
f
yea, it gets up there pretty quick with these configs
I think we're hitting this limit
that's another problem it looks like
c
"this limit" = ?
f
max_cache_size_bytes
although, I am not sure if it's all because of that. Have 1TB configured in this mount point
c
Gotcha
The log lines in the patch I shared above will be interseting--it'll show per-compaction job write throughput
Is your read load random, or are you likely to read data you just wrote?
f
For the reads, I am doing scans continuously and picking up gets from there
So get latency is generally pretty good with the occasional spike to load from OS
c
Oh you're doing range scans (scan()) ?
f
actually, the start key is always random
have a cache for the load gen to keep recently seen keys and pull from that randomly, if nothing just come up with a random key
Okay, i will bump the version to get those stats and get back here sometime tomorrow or next couple of days. Will also experiment with those other configs. I appreciate the thoughtful review here!
c
@Frank S Likewise! We'll get you straightened out. Thanks for providing the telemetry. The tl;dr is that it should and does work at the scale you're working with.
Just a matter of getting things tuned up and understanding the characteristics of your environment since it's a bit non-traditional (go + proprietary object store)
I need to head to the store and whatnot, but I'm always around 🙂
f
Yep, awesome! Thank you!