Log - session: bytes usage increases to 2.0 MiB (+10240)


#1

The logs are flooding with messages like below

2018-05-07 13:27:36	INFO	
[n4,client=127.0.0.1:42890,user=root] session: bytes usage increases to 2.0 MiB (+10240)
util/mon/bytes_usage.go:576
2018-05-07 13:27:36	INFO	
[n4,client=127.0.0.1:42890,user=root] session: bytes usage increases to 2.0 MiB (+10240)
util/mon/bytes_usage.go:576
2018-05-07 13:27:36	INFO	
[n4,client=127.0.0.1:42890,user=root] session: bytes usage increases to 2.0 MiB (+10240)
util/mon/bytes_usage.go:576
2018-05-07 13:27:36	INFO	
[n4,client=127.0.0.1:42890,user=root] session: bytes usage increases to 2.0 MiB (+10240)

Can someone let me know -

  1. What does these logs denote?
  2. If they are not that alarming can I disable them or reduce their frequency in log files?

Env - Cockroach 5 node cluster running 2.0.1 on Ubuntu 14.


(Andrew Dona-Couch) #2

Hi @tuk.

To answer your question 1: these messages are from our internal memory accounting. They indicate that we’re using a significant amount of memory to service queries (or we think we do, it may also be an accounting bug). They shouldn’t show up in normal use, but perhaps you’re running queries with large joins, or something else that would aggravate the memory usage?

We also shouldn’t be logging them repeatedly like that, but I think that would show up if you have many connections open in parallel that are each running such high-memory queries.

To answer question 2: what you’re looking for is the environment variable COCKROACH_NOTEWORTHY_SESSION_MEMORY_USAGE, which you can increase to set a higher threshold for this log message (the default is 1048576, or 1 MiB).

I think we’d be curious to know what queries you’re running that need that much memory, but on their own they aren’t something to worry about.

cc @knz


#3

@couchand - I have some filed some issue and is in discussion. May be this could be related to that. https://github.com/cockroachdb/cockroach/issues/25233


#4

@couchand - Just one more follow up query if a SELECT statement is returning a lot of rows then can this log come ? Just to add we are not doing any JOINS and we don’t have much concurrent connection.