### Real-time Profiling a MongoDB Cluster```
This article explores the concept of real-time profiling a MongoDB cluster, which helps in understanding how operations are distributed among servers in a sharded cluster. To achieve this, a script is used to set up a standard sharded cluster for demonstration purposes. The script creates a collection named `sharded_collection`, sharded on a key named `shard_key`, and disables the balancer to ensure predictable shard distribution. The script then inserts documents with specific shard keys and runs queries from Python to test how the cluster behaves. The profiling tool is used to analyze the performance of these queries, showing how targeted queries scale out better than scatter-gather queries. Additionally, the article discusses how read preferences can be used to read from secondaries, and how updates are handled in a sharded collection. It emphasizes the importance of understanding operation distribution for scaling a sharded cluster.