Skip to content

Gigabytes of ram usage with Cassandra or Scylla with lz4/snappy enabled.  #1617

@ashtonian

Description

@ashtonian

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

Cassandra: 4.0.3
Scylla: 4.6.1

What version of Gocql are you using?

v1.0.0

What version of Go are you using?

1.18

What did you do?

Enable snappy or lz4 compression.

What did you expect to see?

Similar ram profile as with compression disabled.

What did you see instead?

Massive uptick in ram usage.


Have an api call it opens ~20k concurrent requests to scylla/cassandra cluster, and fetches a total of ~50mb of data from the cluster.

Here is a recording of the usage stats via statsviz for each. I attempted to use pprof but it only list ~200mb of usage and its all from the json serializer which is expected. The other interesting thing is it seems to take the gc a while to actually collect, not sure if thats just go doing its thing or if there is something holding it.

goto pprof ./mem_profiles/heap.30.out
Type: inuse_space
Time: Apr 11, 2022 at 5:42pm (CDT)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 223.81MB, 96.94% of 230.88MB total
Dropped 71 nodes (cum <= 1.15MB)
Showing top 10 nodes out of 53
      flat  flat%   sum%        cum   cum%
  119.95MB 51.96% 51.96%   119.95MB 51.96%  github.com/goccy/go-json/internal/decoder.(*mapDecoder).mapassign
   87.94MB 38.09% 90.04%   210.89MB 91.34%  github.com/goccy/go-json.unmarshal
    5.51MB  2.38% 92.43%     5.51MB  2.38%  runtime.allocm
    4.47MB  1.94% 94.37%     4.47MB  1.94%  reflect.unsafe_NewArray
    2.50MB  1.08% 95.45%     2.50MB  1.08%  reflect.makemap
       2MB  0.87% 96.31%        2MB  0.87%  github.com/jackc/pgtype.scanPlanString.Scan
    1.44MB  0.62% 96.94%     1.44MB  0.62%  github.com/goccy/go-json/internal/decoder.init.0
         0     0% 96.94%     2.51MB  1.09%  database/sql.(*Rows).Next
         0     0% 96.94%     2.51MB  1.09%  database/sql.(*Rows).Next.func1
         0     0% 96.94%   210.89MB 91.34%  database/sql.(*Rows).Scan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions