Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
MongoDB has a top utility like top linux command that displays how much time spent on read, write and total on every name space (collection).


To run mongotop you just need to run:

mongotop


The output is something like below:

root@hs-1:~# mongotop
2018-01-09T13:42:42.177+0000 connected to: 127.0.0.1

ns total read write 2018-01-09T13:42:43Z
users.profile 28ms 28ms 0ms
authz.tokens 7ms 7ms 0ms
mielin.obx 3ms 3ms 0ms
conduc.contacts 1ms 1ms 0ms
admin.system.roles 0ms 0ms 0ms


The above query will run every second, to increase the interval use mongotop YOUR_INTERVAL_INSECOND.

If you want the result in json use mongotop --json.

If you want to return the result once and exit use mongotop --row-count

#mongodb #mongo #mongotop #read #write
See live disk IO status by using iostat:

iostat -dx 1

The output has many columns. The part I'm interested in for now is r/s which refers to read per second and w/s which is write per
second. To see size per second in read and write see columns rkB/s, wkB/s in their corresponding order.

NOTE: if you don't have iostat on your linux os install it on debian by issuing apt-get install sysstat command.


#linux #debian #iostat #read_per_second #write_per_second #sysstat