Research on MongoDB query performance
Previous: Mongodb VS Mysql query performance, tested the query performance of mongodb and mysql. Result Description mongodb The performance is OK, and it can be used instead of mysql. But this test is at the million level, and my scene is at the KW level. So it is necessary to test the effect of mongodb at the kw level. My test environment is 4G memory (a lot of memory is occupied by other programs), 2kw data, and the query randomly generates ids (query 20 ids at a time). The test in such an environment is not ideal, and it is disappointing. The average query time is 500ms (compared to mysql Not bad, especially under concurrent queries, the performance is poor. very low throughput). View its index size (query with db.mycoll.stats()): 2kw There are about 1.1G indexes in the data, and the stored data is about 11G. During the test, it was found that iowait accounts for about 50%, which seems to be the bottleneck of io. Also see mongodb Not much memory used (less than the size of the index, it seems the machine is not big enough to test). Change to a machine with available 6G memory. Under 50…