
Hi guys,I'm getting this issue on both write & readIs there any way to reduce the size of the rows, partitions for caching in memory. (In configuration scylla.yaml or something I'm not sure)
These row removals impacting on the read operation which lead to a very high read latency.
ThanksRegard,Phuc
--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/f19ca982-c3e3-4a86-b057-81c5cbd2ee51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,Which Scylla version are you using?
On Tue, Mar 12, 2019 at 1:33 AM Phuc Nguyen <phucpngu...@gmail.com> wrote:Hi guys,I'm getting this issue on both write & readIs there any way to reduce the size of the rows, partitions for caching in memory. (In configuration scylla.yaml or something I'm not sure)You can only disable the cache altogether using --enable-cache=0.When enabled, the cache will take all the free space, and shrink on external demand.These row removals impacting on the read operation which lead to a very high read latency.Are you sure the latency is due to removals, and not due to the fact that data is not in cache after it's evicted and thus reads need to go to disk now?In such a case, caching less would make the problem worse.
Hi Tomasz,
On Tuesday, March 12, 2019 at 4:25:24 PM UTC+8, Tomasz Grabiec wrote:Hi,Which Scylla version are you using?I'm using 3.0.3On Tue, Mar 12, 2019 at 1:33 AM Phuc Nguyen <phucpngu...@gmail.com> wrote:Hi guys,I'm getting this issue on both write & readIs there any way to reduce the size of the rows, partitions for caching in memory. (In configuration scylla.yaml or something I'm not sure)You can only disable the cache altogether using --enable-cache=0.When enabled, the cache will take all the free space, and shrink on external demand.These row removals impacting on the read operation which lead to a very high read latency.Are you sure the latency is due to removals, and not due to the fact that data is not in cache after it's evicted and thus reads need to go to disk now?In such a case, caching less would make the problem worse.Yes, as something I found on scylladb official site(https://www.scylladb.com/2018/07/26/how-scylla-data-cache-works/), the caching uses LRU to keep the row data remain to serve the next read operations when the partitions are large enough will trigger the rows evictions and row removals which making the high latency.Could I do anything to optimize the caching system for a lower latency & performance?
On Tue, Mar 12, 2019 at 9:36 AM Phuc Nguyen <phucpngu...@gmail.com> wrote:Hi Tomasz,
On Tuesday, March 12, 2019 at 4:25:24 PM UTC+8, Tomasz Grabiec wrote:Hi,Which Scylla version are you using?I'm using 3.0.3On Tue, Mar 12, 2019 at 1:33 AM Phuc Nguyen <phucpngu...@gmail.com> wrote:Hi guys,I'm getting this issue on both write & readIs there any way to reduce the size of the rows, partitions for caching in memory. (In configuration scylla.yaml or something I'm not sure)You can only disable the cache altogether using --enable-cache=0.When enabled, the cache will take all the free space, and shrink on external demand.These row removals impacting on the read operation which lead to a very high read latency.Are you sure the latency is due to removals, and not due to the fact that data is not in cache after it's evicted and thus reads need to go to disk now?In such a case, caching less would make the problem worse.Yes, as something I found on scylladb official site(https://www.scylladb.com/2018/07/26/how-scylla-data-cache-works/), the caching uses LRU to keep the row data remain to serve the next read operations when the partitions are large enough will trigger the rows evictions and row removals which making the high latency.Could I do anything to optimize the caching system for a lower latency & performance?Normally, eviction shouldn't significantly affect latency. How much of an impact are we talking about? What's your per-shard CPU utilization before and during eviction?
From your graph I can see that you have single-row partitions. How large are the rows?
Do you run with default block detector settings? You could try running with --blocked-reactor-notify-ms=2 --blocked-reactor-reports-per-minute=10000 to catch any task running longer than 2ms.
Maybe your CPUs run close to capacity and get overutilized when the server switches to eviction mode.
Can you share all your prometheus metrics, or access to grafana? It's not clear if eviction happens on read (synchronous) or during memtable flush (background).
On Tuesday, March 12, 2019 at 5:04:05 PM UTC+8, Tomasz Grabiec wrote:On Tue, Mar 12, 2019 at 9:36 AM Phuc Nguyen <phucpngu...@gmail.com> wrote:Hi Tomasz,
On Tuesday, March 12, 2019 at 4:25:24 PM UTC+8, Tomasz Grabiec wrote:Hi,Which Scylla version are you using?I'm using 3.0.3On Tue, Mar 12, 2019 at 1:33 AM Phuc Nguyen <phucpngu...@gmail.com> wrote:Hi guys,I'm getting this issue on both write & readIs there any way to reduce the size of the rows, partitions for caching in memory. (In configuration scylla.yaml or something I'm not sure)You can only disable the cache altogether using --enable-cache=0.When enabled, the cache will take all the free space, and shrink on external demand.These row removals impacting on the read operation which lead to a very high read latency.Are you sure the latency is due to removals, and not due to the fact that data is not in cache after it's evicted and thus reads need to go to disk now?In such a case, caching less would make the problem worse.Yes, as something I found on scylladb official site(https://www.scylladb.com/2018/07/26/how-scylla-data-cache-works/), the caching uses LRU to keep the row data remain to serve the next read operations when the partitions are large enough will trigger the rows evictions and row removals which making the high latency.Could I do anything to optimize the caching system for a lower latency & performance?Normally, eviction shouldn't significantly affect latency. How much of an impact are we talking about? What's your per-shard CPU utilization before and during eviction?It's almost 98%, impacting around 200mil of data reading operations
From your graph I can see that you have single-row partitions. How large are the rows?The rows have only 2 column: key(text), value and key column is primary key
Do you run with default block detector settings? You could try running with --blocked-reactor-notify-ms=2 --blocked-reactor-reports-per-minute=10000 to catch any task running longer than 2ms.I'm not sure but let me try.Maybe your CPUs run close to capacity and get overutilized when the server switches to eviction mode.Could you explain more detail about it?
Can you share all your prometheus metrics, or access to grafana? It's not clear if eviction happens on read (synchronous) or during memtable flush (background).Sure, I just opened the grafana to the world: http://54.169.83.176:3000/d/-sd5YEjmz/scylla-per-server-metrics-2-2?orgId=1&from=now-12h&to=now&refresh=30s&var-monitor_disk=md0&var-monitor_network_interface=eth0&var-by=shard&var-cluster=Test%20Cluster%20I3.4x%20AMI&var-dc=All&var-node=All&var-shard=All
--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/1e2bb5b1-e21f-4cff-931e-3928ceae67e3%40googlegroups.com.
Sorry, I just restarted the instance, pls try againA question: I'm having this workflow: almost write first, then run `nodetool compact` and all reads. Does it impacting to the current performance?
CREATE TABLE keyspace1.cache1 (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy', 'min_threshold': '2'}
AND compression = {'sstable_compression': 'LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 315360000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
On Tuesday, March 12, 2019 at 10:27:50 PM UTC+8, Tomasz Grabiec wrote:On Tue, Mar 12, 2019 at 3:18 PM Phuc Nguyen <phucpngu...@gmail.com> wrote:Sorry, I just restarted the instance, pls try againA question: I'm having this workflow: almost write first, then run `nodetool compact` and all reads. Does it impacting to the current performance?I don't understand what you're asking about, please elaborate.I meant there are 3 workloads:1) Most write operations2) Compaction3) Most read operationsBy following an order of 1, 2 then 3Maybe the ram is not enough memory for caching because of the write operations used almost space on memtable? So it could be one of some impactions affect to the performance results
Btw, I'm using this schemaCREATE TABLE keyspace1.cache1 (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy', 'min_threshold': '2'}
AND compression = {'sstable_compression': 'LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 315360000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';Could you access to my grafana board?
On Tue, Mar 12, 2019 at 3:35 PM Phuc Nguyen <phucpngu...@gmail.com> wrote:
On Tuesday, March 12, 2019 at 10:27:50 PM UTC+8, Tomasz Grabiec wrote:On Tue, Mar 12, 2019 at 3:18 PM Phuc Nguyen <phucpngu...@gmail.com> wrote:Sorry, I just restarted the instance, pls try againA question: I'm having this workflow: almost write first, then run `nodetool compact` and all reads. Does it impacting to the current performance?I don't understand what you're asking about, please elaborate.I meant there are 3 workloads:1) Most write operations2) Compaction3) Most read operationsBy following an order of 1, 2 then 3Maybe the ram is not enough memory for caching because of the write operations used almost space on memtable? So it could be one of some impactions affect to the performance resultsMemtables can use no more than half of the memory. When they are flushed, cache can grow in their place. Looking at your dashboard, cache is using 90% of memory.I can also see that your reads miss in cache, so perhaps your dataset really doesn't fit in memory?

Is the performance not as good as you'd expect?
On Tuesday, March 12, 2019 at 11:36:28 PM UTC+8, Tomasz Grabiec wrote:On Tue, Mar 12, 2019 at 3:35 PM Phuc Nguyen <phucpngu...@gmail.com> wrote:
On Tuesday, March 12, 2019 at 10:27:50 PM UTC+8, Tomasz Grabiec wrote:On Tue, Mar 12, 2019 at 3:18 PM Phuc Nguyen <phucpngu...@gmail.com> wrote:Sorry, I just restarted the instance, pls try againA question: I'm having this workflow: almost write first, then run `nodetool compact` and all reads. Does it impacting to the current performance?I don't understand what you're asking about, please elaborate.I meant there are 3 workloads:1) Most write operations2) Compaction3) Most read operationsBy following an order of 1, 2 then 3Maybe the ram is not enough memory for caching because of the write operations used almost space on memtable? So it could be one of some impactions affect to the performance resultsMemtables can use no more than half of the memory. When they are flushed, cache can grow in their place. Looking at your dashboard, cache is using 90% of memory.I can also see that your reads miss in cache, so perhaps your dataset really doesn't fit in memory?
I'm not really sure, but the whole dataset on disk only took 150GB size but I'm using i3.8xlarge with 244GB and, the read operations just read around 39GB(not all tables) which will not place all data in memory.
Is the performance not as good as you'd expect?Yes, it's not fast as the Cassandra one installed on c5.9x instance
Is it good for scale out to 3 nodes of i3.2x instead of 1 node i3.8x ?
Is it good for scale out to 3 nodes of i3.2x instead of 1 node i3.8x ?Assuming RF=1?
The code is here: https://github.com/scylladb/scylla/blob/master/row_cache.ccMaybe you data is highly compressible, so sstables get compressed and fit in the page cache. Our in-memory cache is not compressed.How large are your values?
CREATE KEYSPACE keyspace1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
CREATE TABLE keyspace1.cache1 (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy', 'min_threshold': '2'}
AND compression = {'sstable_compression': 'LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 315360000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
CREATE TABLE keyspace1.cache1 (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE KEYSPACE keyspace1 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true;
CREATE TABLE keyspace1.cache1 (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
AND comment = ''
AND compaction = {'class': 'SizeTieredCompactionStrategy', 'min_threshold': '2'}
AND compression = {'sstable_compression': 'LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 315360000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99.0PERCENTILE';
Doesn't it depend on the cell sizes too?
-
I see you have strong imbalance among the shards. What driver are
you using? You should use the shard-aware driver to spread
connections among the cores.
Yes, I later saw in a previous email.
Phuc, I saw that your writes only use one connection and so cause imbalance among the cores. You should use a shard-aware driver that will automatically balance your connections.
Also, if you intend to read all the keys, and don't care about the order, you should use a full scan. This will be a lot more efficient. See https://www.scylladb.com/2017/02/13/efficient-full-table-scans-with-scylla-1-6/.
Also, if you intend to read all the keys, and don't care about the order, you should use a full scan. This will be a lot more efficient. See https://www.scylladb.com/2017/02/13/efficient-full-table-scans-with-scylla-1-6/.
I didn't see reads in the monitoring link you sent, perhaps I
missed the correct time period. You should check the per-shard
distribution.
Yes, if you use this driver you will get your connections equally
distributed among shards.
Also, if you intend to read all the keys, and don't care about the order, you should use a full scan. This will be a lot more efficient. See https://www.scylladb.com/2017/02/13/efficient-full-table-scans-with-scylla-1-6/.
I'm not sure about this because I thought I did the right way on querying statements.
It depends on what you are trying to achieve. If you want to read
all of the data and if you don't care about the order, a full scan
is more efficient.
--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/671bf820-ed0c-4e2b-b66a-497e88287709%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Also, if you intend to read all the keys, and don't care about the order, you should use a full scan. This will be a lot more efficient. See https://www.scylladb.com/2017/02/13/efficient-full-table-scans-with-scylla-1-6/.
I'm not sure about this because I thought I did the right way on querying statements.
It depends on what you are trying to achieve. If you want to read all of the data and if you don't care about the order, a full scan is more efficient.
No. The PHP driver uses the C++ driver underneath, but
shard-aware support was not added to the C++ driver yet. You can
try to do that yourself using
https://github.com/scylladb/scylla/blob/master/docs/protocol-extensions.md.
Also, if you intend to read all the keys, and don't care about the order, you should use a full scan. This will be a lot more efficient. See https://www.scylladb.com/2017/02/13/efficient-full-table-scans-with-scylla-1-6/.
I'm not sure about this because I thought I did the right way on querying statements.
It depends on what you are trying to achieve. If you want to read all of the data and if you don't care about the order, a full scan is more efficient.
I'm using the query statement to check a key which is existing (select key, value where key IN (?,?,?)). Is it a full table scan also? (Yes, it's not ordering)
No, this is a single-key read. A full scan is "SELECT key, value
FROM table", but see the blog post about how to do that in
parallel. It will be a lot faster if you are interested in reading
all key/value pairs.
--Thanks,
--
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/671bf820-ed0c-4e2b-b66a-497e88287709%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "ScyllaDB users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scylladb-user...@googlegroups.com.
To post to this group, send email to scyllad...@googlegroups.com.
Visit this group at https://groups.google.com/group/scylladb-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/scylladb-users/c6d4f439-9df4-40e7-8f62-db136222ae67%40googlegroups.com.