索引构建情况分析、mongoDB安全(四)
1. mongostat工具
|
1
2
3
|
> use jeromeswitched to db jerome> for(i=0;i<100000;i++)db.jerome.insert({x:i}) |
2. profile集合
|
1
2
3
4
5
6
7
8
9
10
11
12
|
> db.getProfilingStatus() #查看profile设置{ "was" : 0, "slowms" : 100 }> db.setProfilingLevel(2) #设置级别{ "was" : 0, "slowms" : 100, "ok" : 1 }> db.getProfilingStatus(){ "was" : 2, "slowms" : 100 }> show tables #查看生成的集合jeromejerome_2locationsystem.indexessystem.profile |
|
1
2
3
4
|
> db.system.profile.find().sort({$naturl:-1}).limit(3){ "op" : "query", "ns" : "jerome.system.indexes", "query" : { "expireAfterSeconds" : { "$exists" : true } }, "ntoreturn" : 0, "ntoskip" : 0, "nscanned" : 11, "nscannedObjects" : 11, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(206), "w" : NumberLong(0) }, "timeAcquiringMicros" : { "r" : NumberLong(4), "w" : NumberLong(7) } }, "nreturned" : 0, "responseLength" : 20, "millis" : 0, "execStats" : { "type" : "COLLSCAN", "works" : 13, "yields" : 0, "unyields" : 0, "invalidates" : 0, "advanced" : 0, "needTime" : 12, "needFetch" : 0, "isEOF" : 1, "docsTested" : 11, "children" : [ ] }, "ts" : ISODate("2015-06-06T09:12:23.021Z"), "client" : "0.0.0.0", "allUsers" : [ { "user" : "__system", "db" : "local" } ], "user" : "__system@local" }{ "op" : "command", "ns" : "jerome.$cmd", "command" : { "profile" : -1 }, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(0), "w" : NumberLong(21) }, "timeAcquiringMicros" : { "r" : NumberLong(0), "w" : NumberLong(8) } }, "responseLength" : 58, "millis" : 0, "execStats" : { }, "ts" : ISODate("2015-06-06T09:12:23.051Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" }{ "op" : "query", "ns" : "jerome.system.namespaces", "query" : { }, "ntoreturn" : 0, "ntoskip" : 0, "nscanned" : 16, "nscannedObjects" : 16, "keyUpdates" : 0, "numYield" : 0, "lockStats" : { "timeLockedMicros" : { "r" : NumberLong(235), "w" : NumberLong(0) }, "timeAcquiringMicros" : { "r" : NumberLong(7), "w" : NumberLong(7) } }, "nreturned" : 16, "responseLength" : 640, "millis" : 0, "execStats" : { "type" : "COLLSCAN", "works" : 18, "yields" : 0, "unyields" : 0, "invalidates" : 0, "advanced" : 16, "needTime" : 1, "needFetch" : 0, "isEOF" : 1, "docsTested" : 16, "children" : [ ] }, "ts" : ISODate("2015-06-06T09:12:34.167Z"), "client" : "127.0.0.1", "allUsers" : [ ], "user" : "" } |
3. 日志
4.explain分析
mongoDB安全
索引构建情况分析、mongoDB安全(四)的更多相关文章
- MongoDB数据库索引构建情况分析
前面的话 本文将详细介绍MongoDB数据库索引构建情况分析 概述 创建索引可以加快索引相关的查询,但是会增加磁盘空间的消耗,降低写入性能.这时,就需要评判当前索引的构建情况是否合理.有4种方法可以使 ...
- MySQL全面瓦解25:构建高性能索引(案例分析篇)
回顾一下上面几篇索引相关的文章: MySQL全面瓦解22:索引的介绍和原理分析 MySQL全面瓦解23:MySQL索引实现和使用 MySQL全面瓦解24:构建高性能索引(策略篇) 索引的十大原则 1. ...
- MongoDB系列四(索引).
一.索引简介 再来老生常谈一番,什么是索引呢?数据库索引与书籍的索引类似.有了索引就不需要翻整本书,数据库可以直接在索引中查找,在索引中找到条目以后,就可以直接跳转到目标文档的位置,这能使查找速度提高 ...
- 根文件系统的构建与分析(四)之瑞士军刀busybox生成系统基本命令
根文件系统的构建与分析(四) 转载请注明 http://blog.csdn.net/jianchi88 Author:Lotte 邮箱:baihaowen08@126.com ls /bin, ...
- SqlServer之like、charindex、patindex 在有无索引的情况下分析
1.环境介绍 测试环境 SQL2005 测试数据 200W条 2.环境准备 2.1建表 CREATE TABLE [dbo].[Depratments]( [Dep_id] [int] ...
- .NET应用架构设计—面向对象分析与设计四色原型模式(彩色建模、领域无关模型)(概念版)
阅读目录: 1.背景介绍 2.问自己,UML对你来说有意义吗?它帮助过你对系统进行分析.建模吗? 3.一直以来其实我们被一个缝隙隔开了,使我们对OOAD遥不可及 4.四色原型模式填补这个历史缝隙,让我 ...
- SQL Server 索引维护(1)——如何获取索引使用情况
前言: 在前面一文中,已经提到了三类常见的索引问题,那么问题来了,当系统出现这些问题时,该如何应对? 简单而言,需要分析现有系统的行为,然后针对性地对索引进行处理: 对于索引不足的情况:检查缺少索引的 ...
- 复旦大学2016--2017学年第二学期高等代数II期末考试情况分析
一.期末考试成绩班级前十五名 林晨(93).朱民哲(92).何陶然(91).徐钰伦(91).吴嘉诚(91).于鸿宝(91).宁盛臻(90).杨锦文(89).占文韬(88).章俊鑫(87).颜匡萱(87 ...
- 《构建之法》第四&十七章读书笔记
<构建之法>第四&十七章读书笔记 一. 前言 再次阅读<构建之法>,愈发被其中生动有趣的举例吸引.作为一本给予软件工程学生的书籍,其不以枯燥的理论知识 ...
随机推荐
- 转:linux/unix命令行终端的光标及字符控制快捷键
from:http://linux.chinaunix.net/techdoc/system/2007/11/23/973027.shtml 在使用linux/unix的命令行终端时,有时候会碰到键盘 ...
- javascript 中如何判断是否是JSON格式的字符串
var stringToJson = function(value){ try{ eval('('+value+')'); return angular.fromJson(value); } catc ...
- eclipse中启动tomcat,localhost:8080无法访问
问题 eclipse中启动tomcat,项目可以正常运行,但是localhost:8080无法访问. 关闭eclipse中的Tomact,直接从tomcat/bin 下的startup.bat启动,l ...
- Windows环境下,从零开始搭建Nodejs+Express+Ejs框架(一)---安装nodejs
第一步,安装nodejs https://nodejs.org/en/download/ 这个是nodejs的官网,由于操作系统是win7 64位的,所以,我下载的是node-v8.11.1-x64的 ...
- GDAL打开mdb文件失败解决方法
使用GDAL打开mdb文件时提示下面错误信息: ERROR 1: Unable to initialize ODBC connection to DSN for DRIVER=Microsoft Ac ...
- Docker: Failed to get D-Bus connection: No connection to service
Issue: When you execute systemctl command in docker container, you may receive following error. Erro ...
- TCP发送源码学习(3)--tcp_transmit_skb
一.tcp_transmit_skb static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, g ...
- Android中Sqlite数据库进行增删改查
今天这篇文章写Sqlite数据库,通过一个小案例来完整讲一下数据库常见的CRUD操作. 先对知识点总结: SQLite数据库 轻量级关系型数据库 创建数据库需要使用的api:SQLiteOpenHel ...
- Cassandra 3.x官方文档(1)---关于Cassandra
写在前面 cassandra3.x官方文档的非官方翻译.翻译内容水平全依赖本人英文水平和对cassandra的理解.所以强烈建议阅读英文版cassandra 3.x 官方文档.此文档一半是翻译,一半是 ...
- logstash分析日志
待处理日志格式如下: [totalCount: 298006556, count: 287347623, queryCount: 259027994, exeCount: 28319629, tota ...