Cassandra - prepared statements discarded in the last minute because cache limit reached

        INFO  [ScheduledTasks:1] 2019-11-04 11:01:19,755  QueryProcessor.java:139 - 49 prepared statements discarded in the last minute because cache limit reached (32899072 bytes)

 prepared_statements_cache_size_mb:


Maximum size of the native protocol prepared statement cache

Valid values are either “auto” (omitting the value) or a value greater 0.

Note that specifying a too large value will result in long running GCs and possbily out-of-memory errors. Keep the value at a small fraction of the heap.

If you constantly see “prepared statements discarded in the last minute because cache limit reached” messages, the first step is to investigate the root cause of these messages and check whether prepared statements are used correctly - i.e. use bind markers for variable parts.

Do only change the default value, if you really have more prepared statements than fit in the cache. In most cases it is not neccessary to change this value. Constantly re-preparing statements is a performance penalty.

Default value (“auto”) is 1/256th of the heap or 10MB, whichever is greater

        与此同时,还有一个挺诡异的问题,在凌晨的时候,我们的监控系统突然疯狂的电话告警,我们上去服务器查看的时候,发现cassandra所在的服务器CPU超高,MEM却没有什么变化,而且等了一会就恢复正常啦,所以一早上班,查看cassandra的日志发现有以下不正常的WARNING:

        cassandra自己在做GC吗????导致这个问题的根本原因就是cassandra在GC,而且是发生了很长时间的GC,导致那个时刻CPU超高,而且整个连接数据库的请求都无法响应而失败了。

        可以参考这两个JIRA写的case:

https://issues.apache.org/jira/browse/CASSANDRA-9183

https://issues.apache.org/jira/browse/CASSANDRA-9218

微信公众号,搜索:zhangdaopin,也可方便快捷的看到本人的博客哦,谢谢~

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值