MongoDB traffic investigation. system.profile resizing

Hello folks, I need help with MongoDB traffic investigation and resizing system.profile in Percona Operator

Description:

I need to increase the size of the capped system.profile collection to capture more query history. Our cluster has intensive traffic, and most read load goes to secondaries, so the default 1 MB capped size is too small (we only see ~30 docs before rollover).

Environment:

  • Sharded cluster (2 shards)

  • Operator: 1.20.1

  • MongoDB: 7.0.18

  • PMM: 2.43.1

What I know:
MongoDB docs say:

To change the size of the system.profile collection on a secondary, you must stop the secondary, run it as a standalone, and then perform the steps above. When done, restart the standalone as a member of the replica set.

Questions:

  1. How can I perform this migration using the Percona Operator?

    • Is there a supported way to resize system.profile without manually breaking the replica set?
  2. Are there alternatives for traffic investigation that work well with Percona Operator and MongoDB 7? (QAN is super, but it can’t tell me the user/appName and where it came from primary or replica)

Expected Result:

  1. Resize system.profile on all shards (including secondaries) to something like 100 -200MB.
  2. Get a better picture of executed queries for troubleshooting index usage and query patterns.

Hi, you can follow a rolling update process similar to what is described for index builds on this post:

Regarding your question 2, PMM should be able to tell you the user/appName and where it came from primary or replica… did you run into any problem with the filters?

@Ivan_Groenewold thanks for the clear instruction.

For PMM - yes, I have problem with filters. There are no user name detected for the mongodb deployments:

also, i have an idea to add appName to the query metadata tab.

did you try selecting the cluster name first? that should update the User Name filter. If still running into a problem I suggest you open a ticket in our jira so dev team can have a look at your logs

that’s exactly what I did for screenshot. I have one PMM server for MySQL and MongoDB.

It doesn’t matter what filter I use for MongoDB it just doesn’t show users. For MySQL it works perfectly fine.