You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jon Haddad (Jira)" <ji...@apache.org> on 2024/11/23 00:20:00 UTC

[jira] [Comment Edited] (CASSANDRA-15452) Improve disk access patterns during compaction (big format)

    [ https://issues.apache.org/jira/browse/CASSANDRA-15452?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17900530#comment-17900530 ] 

Jon Haddad edited comment on CASSANDRA-15452 at 11/23/24 12:19 AM:
-------------------------------------------------------------------

I ran another test - this time disabling key cache (because key cache migration takes up an absurd amount of time) and ran another test. Here's some flame graphs showing where the time is spent:

Before, with release version, 45% of process time is spent in pread:

!screenshot-3.png|width=878,height=514!

After, with the patch, only 20% of time is spent waiting on pread:

!screenshot-4.png|width=609,height=360!


was (Author: rustyrazorblade):
I ran another test - this time disabling key cache (because key cache migration takes up an absurd amount of time) and ran another test.  Here's some flame graphs showing where the time is spent:

Before, with release version, 45% of process time is spent in pread:

 !screenshot-3.png! 


After, with the patch, only 20% of time is spent waiting on pread:

 !screenshot-4.png! 





> Improve disk access patterns during compaction (big format)
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-15452
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15452
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Legacy/Local Write-Read Paths, Local/Compaction
>            Reporter: Jon Haddad
>            Assignee: Jordan West
>            Priority: Normal
>             Fix For: 4.1.x, 5.0.x, 5.x
>
>         Attachments: everyfs.txt, image-2024-11-22-16-17-23-194.png, iostat-5.0-head.output, iostat-5.0-patched.output, iostat-ebs-15452.png, iostat-ebs-head.png, iostat-instance-15452.png, iostat-instance-head.png, results.txt, screenshot-1.png, screenshot-2.png, screenshot-3.png, screenshot-4.png, sequential.fio, throughput-1.png, throughput.png
>
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> On read heavy workloads Cassandra performs much better when using a low read ahead setting.   In my tests I've seen an 5x improvement in throughput and more than a 50% reduction in latency.  However, I've also observed that it can have a negative impact on compaction and streaming throughput. It especially negatively impacts cloud environments where small reads incur high costs in IOPS due to tiny requests.
>  # We should investigate using POSIX_FADV_DONTNEED on files we're compacting to see if we can improve performance and reduce page faults. 
>  # This should be combined with an internal read ahead style buffer that Cassandra manages, similar to a BufferedInputStream but with our own machinery.  This buffer should read fairly large blocks of data off disk at at time.  EBS, for example, allows 1 IOP to be up to 256KB.  A considerable amount of time is spent in blocking I/O during compaction and streaming. Reducing the frequency we read from disk should speed up all sequential I/O operations.
>  # We can reduce system calls by buffering writes as well, but I think it will have less of an impact than the reads



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org