'mongodb'에 해당되는 글 22건

  1. Mongodb configuration option
  2. MongoDB performance SSDs vs Spindle SAS Drives
  3. MongoDB visual studio 2010에서 빌드하기
  4. Fluentd loves MongoDB, at MongoDB SV User Group, July 17, 2012
  5. Augmenting RDBMS with MongoDB for ecommerce
  6. MongoDB 2.2 RC0 has been released
  7. Replica-set windowsos vs centos test
  8. [펌] MongoDb Architecture
  9. 성능 정보 수집하기
  10. 스트레스 테스트 batch request/sec 정보 공유

Mongodb configuration option

몽고DB에 옵션들이 어떤게 있을까? 아래의 경로의 소스를 보면 대략 보인다. 슬슬 mongo.conf 파일에 아래의 옵션들을 넣고 테스트나 해봐야겠다. ㅋㅋㅋ

\mongodb-src-r2.2.0-rc0\src\mongo\db\db.cpp

http://docs.mongodb.org/manual/reference/configuration-options/
http://docs.mongodb.org/manual/administration/configuration/


    StringBuilder dbpathBuilder;
    dbpathBuilder << "directory for datafiles - defaults to " << dbpath;

    general_options.add_options()
    ("auth", "run with security")
    ("cpu", "periodically show cpu and iowait utilization")
    ("dbpath", po::value() , dbpathBuilder.str().c_str())
    ("diaglog", po::value(), "0=off 1=W 2=R 3=both 7=W+some reads")
    ("directoryperdb", "each database will be stored in a separate directory")
    ("ipv6", "enable IPv6 support (disabled by default)")
    ("journal", "enable journaling")
    ("journalCommitInterval", po::value(), "how often to group/batch commit (ms)")
    ("journalOptions", po::value(), "journal diagnostic options")
    ("jsonp","allow JSONP access via http (has security implications)")
    ("noauth", "run without security")
    ("nohttpinterface", "disable http interface")
    ("nojournal", "disable journaling (journaling is on by default for 64 bit)")
    ("noprealloc", "disable data file preallocation - will often hurt performance")
    ("noscripting", "disable scripting engine")
    ("notablescan", "do not allow table scans")
    ("nssize", po::value()->default_value(16), ".ns file size (in MB) for new databases")
    ("profile",po::value(), "0=off 1=slow, 2=all")
    ("quota", "limits each database to a certain number of files (8 default)")
    ("quotaFiles", po::value(), "number of files allowed per db, requires --quota")
    ("repair", "run repair on all dbs")
    ("repairpath", po::value() , "root directory for repair files - defaults to dbpath" )
    ("rest","turn on simple rest api")
#if defined(__linux__)
    ("shutdown", "kill a running server (for init scripts)")
#endif
    ("slowms",po::value(&cmdLine.slowMS)->default_value(100), "value of slow for profile and console log" )
    ("smallfiles", "use a smaller default file size")
    ("syncdelay",po::value(&cmdLine.syncdelay)->default_value(60), "seconds between disk syncs (0=never, but not recommended)")
    ("sysinfo", "print some diagnostic system information")
    ("upgrade", "upgrade db if needed")
    ;

#if defined(_WIN32)
    CmdLine::addWindowsOptions( windows_scm_options, hidden_options );
#endif

    replication_options.add_options()
    ("oplogSize", po::value(), "size to use (in MB) for replication op log. default is 5% of disk space (i.e. large is good)")
    ;

    ms_options.add_options()
    ("master", "master mode")
    ("slave", "slave mode")
    ("source", po::value(), "when slave: specify master as ")
    ("only", po::value(), "when slave: specify a single database to replicate")
    ("slavedelay", po::value(), "specify delay (in seconds) to be used when applying master ops to slave")
    ("autoresync", "automatically resync if slave data is stale")
    ;

    rs_options.add_options()
    ("replSet", po::value(), "arg is [/]")
    ;

    sharding_options.add_options()
    ("configsvr", "declare this is a config db of a cluster; default port 27019; default dir /data/configdb")
    ("shardsvr", "declare this is a shard db of a cluster; default port 27018")
    ("noMoveParanoia" , "turn off paranoid saving of data for moveChunk.  this is on by default for now, but default will switch" )
    ;

    hidden_options.add_options()
    ("fastsync", "indicate that this instance is starting from a dbpath snapshot of the repl peer")
    ("pretouch", po::value(), "n pretouch threads for applying replicationed operations") // experimental
    ("command", po::value< vector >(), "command")
    ("cacheSize", po::value(), "cache size (in MB) for rec store")
    ("nodur", "disable journaling")
    // things we don't want people to use
    ("nohints", "ignore query hints")
    ("nopreallocj", "don't preallocate journal files")
    ("dur", "enable journaling") // old name for --journal
    ("durOptions", po::value(), "durability diagnostic options") // deprecated name
    // deprecated pairing command line options
    ("pairwith", "DEPRECATED")
    ("arbiter", "DEPRECATED")
    ("opIdMem", "DEPRECATED")
   


'Etc' 카테고리의 다른 글

MongoDB Use Cases  (0) 2012.08.27
Sizing Up the TempDB Database  (0) 2012.08.23
MongoDB performance SSDs vs Spindle SAS Drives  (0) 2012.08.07
MongoDB visual studio 2010에서 빌드하기  (0) 2012.08.03
mongodb c++ lib WriteConcen  (0) 2012.07.30

몽고DB 성능에 많이 미치는 저장 하드웨어에 따른 몽고DB 성능 정보가 올라왔네요. 요즘 대부분 SSD를 많이 사용들 하더군요.


MSSQL에서는 SSD를 tempdb용으로 많이 쓰는듯해요. 근데, 몽고DB는? 흠흠.


원본 링크 

http://blog.serverdensity.com/mongodb-performance-ssds-vs-spindle-sas-drives/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+serverdensity+%28Server+Density+Blog%29


 

몽고디비 빌드하기 위해서 아래의 사이트에서 빌드를 위한 소스 및 기타 빌드관련 프로그램들을 다운로드 받아야 한다. 나는 DBA이고, C++ 개발 경험도 조금 가지고 있어 소스를 파악해 가면서 몽고디비를 깊게 파봐야 같다.

 

몽고디비 빌드를 위해서 아래의 사이트에서 알려주는 대로 설치만 하면 된다.

http://www.mongodb.org/display/DOCS/Building+with+Visual+Studio+2010
https://github.com/TellagoDevLabs/Hermes/wiki/Downloading-the-source-code-and-compiling-it-using-visual-studio-2010

 

빌드 버전 : 2.2.0-rc0 (7/19/2012)
Win7-64






1. mongoDB 소스 다운로드

   http://www.mongodb.org/downloads


Source tab의 zip파일의 링크를 클릭하면  12M 정도의 소스가 다운로드 된다. 다운로드 후 압축을 풀어준다. 난 C:\mongo_src\라는 곳에 압축을 해제하였다.

 


2. 그 외 빌드를 위한 유틸리티 및 모듈 다운로드


가) 파이썬 설치

http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win32-py2.7.exe/download 


다운로드 된 파일 python-2.7.2.exe 을 설치 한다. C:\Python27\ 경로에 설치되었는지 확인하자. 경로가 틀리면 원활하게 되지 않는다.

 

나) Scons

http://sourceforge.net/projects/scons/files/scons/2.1.0/scons-2.1.0.win32.exe/download.


scons-2.1.0.win32.exe 설치

 

다) Boost

http://sourceforge.net/projects/sevenzip/files/7-Zip/9.20/7z920-x64.msi/download


c:\boost\ 디렉토리에

 

3. 솔루션 파일을 생성(Visual Studio 2010)


가) 1번에서 소스 파일을 압축 해제했던 경로로 이동하여 빌드 명령을 실행하자.

64bit version으로  솔루션 파일을 생성시키는 명령


C:\mongo_src\scons --64 


빌드 실행 명령 옵션

scons                   // build mongod

scons mongoclient.lib   // build C++ client driver library

scons all               // build all end user components

scons .                 // build all including unit tests and C++ driver zip file

scons --64              // build the 64 bit version

scons --dd              // build with debug symbols

scons -jX               // perform X steps in parallel (e.g. -j16 will compile 16 files at once)

 

나) 솔루션 파일을 찾자.

C:\mongo_src\src\mongo\db\db_10.sln

 

솔루션 파일을 더블클릭하여 실행.

 

 



몽고DB와 RDBMS와 결합^^.... 요즘에 이렇게들 많이 쓰네요. 

MongoDB 2.2 Release 되었습니다. 많이 향상되었는데 그중에 Redis나 기타 캐쉬형 nosql에서 볼 수 있는 expire data collection이 추가되었다는게 제일 흥미롭네요..

 

 Changes

  • 집계 프레임워크
  • 동시성 개선(DB level locking)
  • 캐쉬 형태로 있는 Expire Data Collection(TTL Collections)
  • 쿼리 옵티마이져 개선
  • Replica-Set, Sharding Cluster 개선

 

Download

 

window7 vs centos 간 Replica-Set 세팅은 어떻게 될까? 이런 궁굼증으로 서버 세팅하고 바로 insert Stress test를 해보았습니다.


*. 테스트 시나리오

1. 300개의 연결 쓰레드

2. 300개의 쓰레드가 90000번의 작업 수행

3. 1KB Document Size

4. C++ Test App



*. centos 테스트

10번 수행 한 결과 별 무리 없이 테스트 진행이 되었다.


*. windows os 테스트

10번 수행 중 3회의 경우 socket send 함수에서 blocking 발생하였다. 아래의 로그는 윈도우 PC서버에서 발생한 로그이다.


Mon Jul 16 14:31:14 [conn28] Socket recv() errno:10054 An existing connection was forcibly closed by the remote host. 테스트IP

Mon Jul 16 14:31:14 [conn28] SocketException: remote:  테스트IP:63217 error: 9001 socket exception [1] server [ 테스트IP:63217] 

과연 무슨 문제인가??

흠... 

'Etc' 카테고리의 다른 글

MongoDB 2.2 RC0 has been released  (0) 2012.07.20
Online Conference: Deep Dive with MongoDB  (0) 2012.07.17
[펌] MongoDb Architecture  (0) 2012.07.12
성능 정보 수집하기  (0) 2012.07.12
스트레스 테스트 batch request/sec 정보 공유  (0) 2012.07.11

[펌] MongoDb Architecture

'Etc' 카테고리의 다른 글

Online Conference: Deep Dive with MongoDB  (0) 2012.07.17
Replica-set windowsos vs centos test  (0) 2012.07.16
성능 정보 수집하기  (0) 2012.07.12
스트레스 테스트 batch request/sec 정보 공유  (0) 2012.07.11
MongoDB 성능 모니터링  (0) 2012.07.11

성능 정보 수집하기

몽고DB 성능 정보를 저장하고 방법에 대해 알아볼까 합니다. 몽고DB 다양한 성능 모니터링을 있는 툴들이 많은데, 자세히 troublshooting 하기 위해서는 shell 명령어나 utility 이용하여 수집할 있습니다

 

1. 성능 정보 수집 방법


가. c#
으로 serverStatus 정보를 얻어와 몽고DB 저장하기

https://github.com/mongodb/docs/blob/master/source/reference/server-status.txt

 db.runCommand( { "serverStatus" : 0 });


나. Mongostat utility 이용하여 상태 정보를 저장

http://docs.mongodb.org/manual/reference/mongostat/?highlight=mongostat


30초마다 Perflog.txt 파일에 기록

C:\mongodb\bin>mongostat --host 127.0.0.1:27017 30 --noheaders > perflog.txt

 

2. 성능 정보 추출


몽고
DB 있는 서버 상태 정보를 추출하여 파일로 기록
http://docs.mongodb.org/manual/reference/mongoexport/#cmdoption-mongoexport--fieldFile

mongoexport -h 127.0.0.1:27017 -d PefDB -c serverStatus --csv -f "dur.commits" > output.csv


이제는 성능 정보 추출하여 분석하는 일만 남았겠죠?

 

요즘 Stress 테스트중에 있는데 batch Request/sec 정보 공유합니다.

 

#. 테스트 환경

 

#. 테스트 방식

  • CentOS mongodb(2.1.2) StandAlone 환경구성으로 1K Document 게임로그를 20분간 반복 수행
  • 900개의 Connection 개체를 생성하여 Stress 데이터를 insert 요청  

 

#. Batch Request/Sec

   : document size에 따라 수치는 달라질 수 있음.
        11000~14000



'Etc' 카테고리의 다른 글

[펌] MongoDb Architecture  (0) 2012.07.12
성능 정보 수집하기  (0) 2012.07.12
MongoDB 성능 모니터링  (0) 2012.07.11
인메모리DB, 틈새에서 대세로? memSQL  (2) 2012.06.26
Redis 사용  (0) 2012.06.07