Tra i tool nativi di monitoraggio performance di MongoDb quelli principalmente usati sono due:
1) mongostat -> fornisce dati real time sul processo mongod o mongos in esame, in particolare ci indica il numero di insert /update/delete etc
2) mongotop -> fornisce dati sul processo mongod o mongos separati per namespace (quindi per database e nome collection)indicando tempo totale di esecuzione e poi tempo impiegato per lettura e per scrittura
Entrambi i comandi agiscono ogni secondo e si bloccano premendo CTRL+C.
Esempio output mongostat
Da questo output si deduce che sono in corso delle insert sul db.
Esempio output mongotop sullo stesso db a batch in corso
2016-02-20T16:44:26.936+0100 connected to: 127.0.0.1
ns total read write 2016-02-20T16:44:27+01:00
test.awards 63ms 0ms 63ms
admin.system.roles 0ms 0ms 0ms
admin.system.version 0ms 0ms 0ms
certificationTest.crud 0ms 0ms 0ms
certificationTest.log_events 0ms 0ms 0ms
certificationTest.ninni 0ms 0ms 0ms
certificationTest.sliceTest 0ms 0ms 0ms
certificationTest.system.indexes 0ms 0ms 0ms
certificationTest.system.namespaces 0ms 0ms 0ms
prova.persona 0ms 0ms 0ms
ns total read write 2016-02-20T16:44:28+01:00
test.awards 51ms 0ms 51ms
admin.system.roles 0ms 0ms 0ms
admin.system.version 0ms 0ms 0ms
certificationTest.crud 0ms 0ms 0ms
certificationTest.log_events 0ms 0ms 0ms
certificationTest.ninni 0ms 0ms 0ms
certificationTest.sliceTest 0ms 0ms 0ms
certificationTest.system.indexes 0ms 0ms 0ms
certificationTest.system.namespaces 0ms 0ms 0ms
prova.persona 0ms 0ms 0ms
Dal mongotop vediamo sempre che sono in corso operazioni di write e in più abbiamo l'evidenza del fatto che il namespace interessato è test.awards (quindi db test e collection awards)
1) mongostat -> fornisce dati real time sul processo mongod o mongos in esame, in particolare ci indica il numero di insert /update/delete etc
2) mongotop -> fornisce dati sul processo mongod o mongos separati per namespace (quindi per database e nome collection)indicando tempo totale di esecuzione e poi tempo impiegato per lettura e per scrittura
Entrambi i comandi agiscono ogni secondo e si bloccano premendo CTRL+C.
Esempio output mongostat
insert query update delete getmore command flushes mapped vsize res faults qr|qw ar|aw netIn netOut conn time
4413 *0 *0 *0 0 1|0 0 400.0M 1000.0M 131.0M 0 0|0 0|0 600k 257k 2 16:40:29
4176 *0 *0 *0 0 1|0 0 400.0M 1000.0M 132.0M 0 0|0 0|0 568k 244k 2 16:40:30
4376 *0 *0 *0 0 1|0 0 400.0M 1000.0M 132.0M 0 0|0 0|0 595k 255k 2 16:40:31
4122 *0 *0 *0 0 1|0 0 400.0M 1000.0M 133.0M 0 0|0 0|0 561k 241k 2 16:40:32
4413 *0 *0 *0 0 1|0 0 400.0M 1000.0M 131.0M 0 0|0 0|0 600k 257k 2 16:40:29
4176 *0 *0 *0 0 1|0 0 400.0M 1000.0M 132.0M 0 0|0 0|0 568k 244k 2 16:40:30
4376 *0 *0 *0 0 1|0 0 400.0M 1000.0M 132.0M 0 0|0 0|0 595k 255k 2 16:40:31
4122 *0 *0 *0 0 1|0 0 400.0M 1000.0M 133.0M 0 0|0 0|0 561k 241k 2 16:40:32
Da questo output si deduce che sono in corso delle insert sul db.
Esempio output mongotop sullo stesso db a batch in corso
2016-02-20T16:44:26.936+0100 connected to: 127.0.0.1
ns total read write 2016-02-20T16:44:27+01:00
test.awards 63ms 0ms 63ms
admin.system.roles 0ms 0ms 0ms
admin.system.version 0ms 0ms 0ms
certificationTest.crud 0ms 0ms 0ms
certificationTest.log_events 0ms 0ms 0ms
certificationTest.ninni 0ms 0ms 0ms
certificationTest.sliceTest 0ms 0ms 0ms
certificationTest.system.indexes 0ms 0ms 0ms
certificationTest.system.namespaces 0ms 0ms 0ms
prova.persona 0ms 0ms 0ms
ns total read write 2016-02-20T16:44:28+01:00
test.awards 51ms 0ms 51ms
admin.system.roles 0ms 0ms 0ms
admin.system.version 0ms 0ms 0ms
certificationTest.crud 0ms 0ms 0ms
certificationTest.log_events 0ms 0ms 0ms
certificationTest.ninni 0ms 0ms 0ms
certificationTest.sliceTest 0ms 0ms 0ms
certificationTest.system.indexes 0ms 0ms 0ms
certificationTest.system.namespaces 0ms 0ms 0ms
prova.persona 0ms 0ms 0ms
Dal mongotop vediamo sempre che sono in corso operazioni di write e in più abbiamo l'evidenza del fatto che il namespace interessato è test.awards (quindi db test e collection awards)
Nessun commento:
Posta un commento