Reputation: 95
I have a MongoDB cluster setup with one primary and 2 Secondaries in a single shard setup. Every night we have a high load but one day and most of the read APIs have a SECONDARY_PREFERRED read preference.
But the load not balanced as shown below:
X-Axis -> time Y-Axis -> number of queries
Green -> Secondary one Yellow -> Secondary two
And the CPU of the corresponding machines
X-Axis -> time Y-Axis -> % of CPU IDLE
Green -> Secondary one Yellow -> Secondary two
We are using Mongo Java Driver Why would the query be distributed unevenly?
Upvotes: 0
Views: 111
Reputation: 14510
The graphs show that load on the machines (i.e. CPU usage) is balanced most of the time.
Drivers attempt to choose less loaded nodes as described here.
There is no requirement either on server side or on driver side that CPU usage on all secondaries is exactly identical at all times.
Every night we have a high load but one day and most of the read APIs have a SECONDARY_PREFERRED read preference.
This sentence doesn't make any sense. What does night load have to do with read apis during day?
Upvotes: 1