Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG Monopolization of two resources CPU and MongoDB queries #281

Open
cesarjorgemartinez opened this issue Feb 1, 2023 · 0 comments
Open

Comments

@cesarjorgemartinez
Copy link

cesarjorgemartinez commented Feb 1, 2023

Partial related to issue: #193

Detected in:
Version 1.5.1 a bit of CPU consumption and MongoDB queries
Version 1.6.0 => notable increase CPU consumption and MongoDB queries

Two cases:
Using Docker => reach at maximum CPU usage by container instance
Using Kubernetes => reach at maximum CPU usage defined at the maximum resource definition

State:
Initial deployment without any data, empty.

Symptoms:
Using Docker: in a machine of 4 CPUs consuming permanently 50% of 400%
Using Kubernetes: Reach at maximum CPU usage defined at the maximum resource definition

Workaroud:
Explicit limit of CPU usage => but it is not acceptable

What happens in MongoDB?:
One query find almost every 1 millisecond over devices collection of own IOTA database:

{
	"op" : "query",
	"ns" : "iotagent-lightweightm2m.devices",
	"command" : {
		"find" : "devices",
		"filter" : {
			
		},
		"projection" : {
			
		},
		"returnKey" : false,
		"showRecordId" : false,
		"lsid" : {
			"id" : UUID("30098f68-09e6-4f49-b387-a8276dee9319")
		},
		"$clusterTime" : {
			"clusterTime" : Timestamp(1674756656, 1),
			"signature" : {
				"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
				"keyId" : 0
			}
		},
		"$db" : "iotagent-lightweightm2m"
	},
	"keysExamined" : 0,
	"docsExamined" : 0,
	"cursorExhausted" : true,
	"numYield" : 0,
	"nreturned" : 0,
	"locks" : {
		"ReplicationStateTransition" : {
			"acquireCount" : {
				"w" : NumberLong(1)
			}
		},
		"Global" : {
			"acquireCount" : {
				"r" : NumberLong(1)
			}
		},
		"Database" : {
			"acquireCount" : {
				"r" : NumberLong(1)
			}
		},
		"Collection" : {
			"acquireCount" : {
				"r" : NumberLong(1)
			}
		},
		"Mutex" : {
			"acquireCount" : {
				"r" : NumberLong(1)
			}
		}
	},
	"flowControl" : {
		
	},
	"responseLength" : 245,
	"protocol" : "op_msg",
	"millis" : 0,
	"rateLimit" : 1,
	"planSummary" : "COLLSCAN",
	"execStats" : {
		"stage" : "COLLSCAN",
		"nReturned" : 0,
		"executionTimeMillisEstimate" : 0,
		"works" : 2,
		"advanced" : 0,
		"needTime" : 1,
		"needYield" : 0,
		"saveState" : 0,
		"restoreState" : 0,
		"isEOF" : 1,
		"direction" : "forward",
		"docsExamined" : 0
	},
	"ts" : ISODate("2023-01-26T18:11:04.604Z"),
	"client" : "10.128.6.249",
	"allUsers" : [ ],
	"user" : ""
}

Additionally in 1.6.0:
In logs multiple circular references possibly related to:
https://jira.mongodb.org/browse/NODE-2536
https://www.mongodb.com/community/forums/t/warning-accessing-non-existent-property-count-of-module-exports-inside-circular-dependency/3183/13

Or others...

You are welcome to contribute any ideas to correct this problem

Regards,
Cesar Jorge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant