There is linearly increasing latency observed with multiple concurrent aggregations on different collections.
Multiple mongodb collections are created with 100,000 documents in each collection and 10,000 columns in each document. There is a python script which executes aggregate queries in a multi-threaded fashion. Each thread invokes an aggregate on a separate collection. (The code of script is attached with this ticket).
When the script is executed, the amount of time it takes to complete the aggregation is proportional to the number of threads. i.e. the latency linearly increases with number of queries concurrently executed. If single aggregation query takes 'x' amount of time, running 'n' queries concurrently takes almost 'n*x' amount of time.
The expectation was that the multi-threaded queries would take roughly the same amount of time as the single-threaded one. Is this the known limitation of mongodb? Is there any configuration parameter in mongodb to control concurrency?