I’m facing slowness in mongodb because of the listDatabase command fired by the monitoring tool . Can any of you please suggest why the listDatabase command takes more time and sometimes it hangs when concurrency increase
listdatabase_strace.log (49.8 KB)
. Any inputs so that I can check further.
Command: strace -i -t -f mongo --quiet --eval "rs.slaveOk() , printjson(db.adminCommand({'listDatabases':1}))"
MongoDB Version : 3.2.1 - We know, this is a very old version and on it to upgrade .
Total Database count = ~1000
Strace logs :
[pid 9403] 13:01:48 [00007ffa738fb68c] futex(0x2f4644c, FUTEX_WAIT_PRIVATE, 5, NULL <unfinished ...>
[pid 9405] 13:01:48 [00007ffa738fedac] sendto(3, "b\0\0\0\2\0\0\0\0\0\0\0\332\7\0\0admin\0listDataba"..., 98, MSG_NOSIGNAL, NULL, 0) = 98
[pid 9405] 13:01:48 [00007ffa738fec2c] recvfrom(3,
"\205\355\0\0K\223I\7\2\0\0\0\333\7\0\0", 16, MSG_NOSIGNAL, NULL, NULL) = 16
[pid 9405] 13:04:22 [00007ffa738fec2c] recvfrom(3, **"p\355\0\0\4databases\0A\355\0\0\0030\0005\0\0\0\2name\0"..., 60789, MSG_NOSIGNAL, NULL, NULL) = 60789**
[pid 9405] 13:04:22 [0000000001049787] mmap(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffa6a3ff000
[pid 9405] 13:04:22 [0000000001049787] mmap(0x7ffa6a300000, 1044480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffa6a300000
Attaching strace logs :