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

Stefan Miklosovic commented on CASSANDRA-19477:
-----------------------------------------------

[CASSANDRA-19477-4.1|https://github.com/instaclustr/cassandra/tree/CASSANDRA-19477-4.1]
{noformat}
java11_pre-commit_tests                         
  ✓ j11_build                                        1m 30s
  ✓ j11_cqlsh_dtests_py3                             5m 28s
  ✓ j11_cqlsh_dtests_py311                           5m 47s
  ✓ j11_cqlsh_dtests_py311_vnode                      6m 4s
  ✓ j11_cqlsh_dtests_py38                            5m 53s
  ✓ j11_cqlsh_dtests_py38_vnode                       6m 2s
  ✓ j11_cqlsh_dtests_py3_vnode                       5m 53s
  ✓ j11_cqlshlib_cython_tests                         9m 1s
  ✓ j11_cqlshlib_tests                                8m 6s
  ✓ j11_dtests                                      33m 38s
  ✓ j11_dtests_vnode                                 36m 1s
  ✓ j11_jvm_dtests                                  15m 44s
  ✓ j11_jvm_dtests_repeat                           38m 12s
  ✓ j11_jvm_dtests_vnode                            12m 39s
  ✓ j11_jvm_dtests_vnode_repeat                     38m 46s
  ✓ j11_unit_tests_repeat                            0m 32s
  ✕ j11_unit_tests                                   8m 33s
      org.apache.cassandra.cql3.MemtableSizeTest testSize[skiplist]
{noformat}

[java11_pre-commit_tests|https://app.circleci.com/pipelines/github/instaclustr/cassandra/4064/workflows/88c6d9da-308c-43a7-849b-a2b1a6b30307]


> Do not go to disk to get HintsStore.getTotalFileSize
> ----------------------------------------------------
>
>                 Key: CASSANDRA-19477
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19477
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Consistency/Hints
>            Reporter: Jon Haddad
>            Assignee: Stefan Miklosovic
>            Priority: Normal
>             Fix For: 4.1.x, 5.0-rc, 5.x
>
>         Attachments: flamegraph.cpu.html
>
>          Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> When testing a cluster with more requests than it could handle, I noticed 
> significant CPU time (25%) spent in HintsStore.getTotalFileSize.  Here's what 
> I'm seeing from profiling:
> 10% of CPU time spent in HintsDescriptor.fileName which only does this:
>  
> {noformat}
> return String.format("%s-%s-%s.hints", hostId, timestamp, version);{noformat}
> At a bare minimum here we should create this string up front with the host 
> and version and eliminate 2 of the 3 substitutions, but I think it's probably 
> faster to use a StringBuilder and avoid the underlying regular expression 
> altogether.
> 12% of the time is spent in org.apache.cassandra.io.util.File.length.  It 
> looks like this is called once for each hint file on disk for each host we're 
> hinting to.  In the case of an overloaded cluster, this is significant.  It 
> would be better if we were to track the file size in memory for each hint 
> file and reference that rather than go to the filesystem.
> These fairly small changes should make Cassandra more reliable when under 
> load spikes.
> CPU Flame graph attached.
> I only tested this in 4.1 but it looks like this is present up to trunk.
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to