MongoDB server version: 3.4.10
OS: Debian 4.9.65-3+deb9u1~bpo8+1 (2017-12-23) x86_64 GNU/Linux
CPU: 12 cores
Database size: 61GB (no replication, no sharding)
Collection records: 32 Millions (only one collection in the database)
On server peak hours something hinky happens. Some queries on the database takes from 10s to 50s! When I get htop, all of a sudden can see that mongod has used ONLY 40% of server RAM and about 14GB of memory is free, cpu usage is used about 10% to 20%! When I see those queries I can see that it has used `IXSCAN` as its winning plan and fetched like 4000 records which belongs to the user, which is normal.
Why `mongod` has not used all of the memory and causes disk IO? It has been mentioned in the documentation that mongod will consume all the memory on the server!
I should note that I have benchmarked disk IO using `hdparm` and result was like below:
This misbehaviour seems as a bug not normal behaviour.