[ https://issues.apache.org/jira/browse/CASSANDRA-13001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17946121#comment-17946121 ]
Dmitry Konstantinov edited comment on CASSANDRA-13001 at 4/21/25 7:00 PM: -------------------------------------------------------------------------- The current heap cost of a single slow query record is about 376 bytes (if query string size = 122 bytes), the current default for the number of rows to store: 50'000, so it means ~ 18 MiB of heap space can be consumed. # I suggest to reduce the default to 10'000 or even to 5'000 rows and/or use a percentage of heap to evaluate the default. While it can look quite small for production-sized databases - it may affect dev/test instances with a small amount of resources # when we serialize and deserialize SlowOperation via JSON we duplicate keyspace and table String objects (it is visible on the attached heap dump view). We can reduce overheads (for about 30% in my example) by deduplicating them after a deserialization !image-2025-04-21-13-55-47-590.png|width=400! was (Author: dnk): The current heap cost of a single slow query record is about 376 bytes (if query string size = 122 bytes), the current default for the number of rows to store: 50'000, so it means ~ 18 MiB of heap space can be consumed. # I suggest to reduce the default to 10'000 or even to 5'000 rows and/or use a percentage of heap to evaluate the default. While it can look quite small for production-sized databases - it may affect dev/test instances with a small amount of resources # when we serialize and deserialize SlowOperation via JSON we duplicate keyspace and table String objects (it is visible on the attached heap dump view). We can reduce overheads (for about 30% in my example) by deduplicating them !image-2025-04-21-13-55-47-590.png|width=400! > slow query logging to virtual table via logback appender > -------------------------------------------------------- > > Key: CASSANDRA-13001 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13001 > Project: Apache Cassandra > Issue Type: New Feature > Components: Legacy/Observability > Reporter: Jon Haddad > Assignee: Stefan Miklosovic > Priority: Normal > Fix For: 5.x > > Attachments: > 0001-Add-basic-pluggable-logging-to-debug.log-and-table.patch, > 0001-Add-multiple-logging-methods-for-slow-queries-CASSAN.patch, > image-2025-04-21-13-55-47-590.png > > Time Spent: 3.5h > Remaining Estimate: 0h > > Currently CASSANDRA-12403 logs slow queries as DEBUG to a file. It would be > better to have this as an interface which we can log to alternative > locations, such as to a table on the cluster or to a remote location (statsd, > graphite, etc). -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org