SlideShare a Scribd company logo
1 of 207
2011/2/22
MongoDB




MyBike    MongoDB
MongoDB


1
Mitsukuni Sato
a.k.a. @key3

• BeProud
•
  •                   …
• MyBike.JP
• MongoDB

               :
Python / Django / PHP /
BSON
BSON
MongoDB
JSON      …
BSON
MongoDB
JSON             …


MongoDB shell version: 1.6.6-pre-
connecting to: test
> foo = { name : 'Mitsukuni Sato' }
{ "name" : "Mitsukuni Sato" }
> db.people.save(foo)
> db.people.find()
{ "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato" }
db.collection_name.find(   )
db.collection_name.find(                               )




> db.people.find({ name : "Mitsukuni Sato" })
{ "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato" }
db.collection_name.save(BSON   )
db.collection_name.save(BSON                                                  )

> user = db.people.findOne({ name : "Mitsukuni Sato" })
{ "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato" }
> user.age = 33
33
> db.people.save(user)
> user = db.people.findOne({ name : "Mitsukuni Sato" })
{
     "_id" : ObjectId("4d63d9c48cbc8019697a25de"),
     "name" : "Mitsukuni Sato",
     "age" : 33
}
GridFS
1:n master / slave
1:n master / slave
1:n master / slave
vs
vs



HDD
vs



HDD
vs



HDD
vs



HDD
GridFS


         4MB
…
source code
source code
pre-compiled binary
source code
pre-compiled binary
 .deb (Debian / Ubuntu)
 RPM (CentOS / Fedora)
 MacOSX
 FreeBSD
MySQL
MySQL

        1/10
MySQL

        1/10
MySQL

        1/10
mongodump & mongorestore


       mongostat


         mongo
mongodump & mongorestore


       mongostat


         mongo
mongodump & mongorestore


       mongostat


         mongo
compaction



 1GB
ruby, python, C++, Java, Perl, C#
ruby, python, C++, Java, Perl, C#
http://www.mongodb.org/display/DOCS/Drivers
ruby, python, C++, Java, Perl, C#
http://www.mongodb.org/display/DOCS/Drivers
Python + Django
Python + Django

 django-mongokit
Python + Django

 django-mongokit

 django-mongodb-engine
Python + Django

 django-mongokit

 django-mongodb-engine

 django-storages (GridFS)
MySQL
MySQL
MySQL
MySQL
MySQL




        django-mongokit
Model        Document
MySQL + MongoDB
MySQL + MongoDB
MySQL + MongoDB
MySQL + MongoDB

            metadata



             object
MySQL + MongoDB

                        metadata



                         object




django-mongodb-engine
Document   GridFS

   django-mongokit

django-mongodb-engine
Document   GridFS

   django-mongokit

django-mongodb-engine


         RDB
Document   GridFS

   django-mongokit

django-mongodb-engine


         RDB
            django-mongokit
Document   GridFS

   django-mongokit

django-mongodb-engine


         RDB
            django-mongokit
Document    GridFS

   django-mongokit

django-mongodb-engine


         RDB
            django-mongokit


            django-mongodb-engine
ManyToMany
ManyToMany
 tag=A & tag=B
ManyToMany
 tag=A & tag=B
ManyToMany
 tag=A & tag=B
ManyToMany
 tag=A & tag=B
1.7.5   Write Ahead Log
…
240,000

                      220,000

                      200,000
                      180,000



mongod                160,000
                      140,000

                      120,000


primary



            Y
                      100,000

                      80,000
                      60,000

                      40,000
                      20,000

                           0
                                0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800

                                                                                  X
                      240,000

                      220,000

                      200,000

                      180,000

                      160,000


mongod                140,000
            bread/s




                      120,000



slave (1)
                      100,000

                       80,000

                       60,000

                       40,000

                       20,000

                            0
                                0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800

                                                                                  X

                      240,000

                      220,000

                      200,000

                      180,000

                      160,000



mongod
                      140,000
            bread/s




                      120,000

                      100,000


slave (2)             80,000

                      60,000

                      40,000

                      20,000

                           0
                                0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800

                                                                                  X
100


                90

                80

                70


                60


mongod    (%)   50




primary
                40


                30

                20

                10

                 0
                      0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800
100


                90

                80

                70


                60


mongod    (%)   50




primary
                40


                30

                20

                10

                 0
                      0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800
100


                  90

                  80

                  70


                  60


mongod      (%)   50




primary
                  40


                  30

                  20

                  10

                   0
                        0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800




          nice
100


                  90

                  80

                  70


                  60


mongod      (%)   50




primary
                  40


                  30

                  20

                  10

                   0
                        0   45   90   135   180   225   270   315   360   405   450   495   540   585   630   675   720   765   800




          nice

                                                                          …
Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified
Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the
removed node end?
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2]
Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset
Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state
Mon Feb 21 06:55:01 [conn25] replSet RECOVERING
Mon Feb 21 06:55:01 [conn25] replSet PRIMARY
Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally
Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo",
version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" },
{ _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to
respond)
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY
(snip)
Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY
Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified
Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the
removed node end?
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2]
Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset
Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state
Mon Feb 21 06:55:01 [conn25] replSet RECOVERING
Mon Feb 21 06:55:01 [conn25] replSet PRIMARY
Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally
Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo",
version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" },
{ _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to
respond)
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY
(snip)
Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY




                                                                  3GB
Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified
Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the
removed node end?
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2]
Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset
Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state
Mon Feb 21 06:55:01 [conn25] replSet RECOVERING
Mon Feb 21 06:55:01 [conn25] replSet PRIMARY
Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally
Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo",
version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" },
{ _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to
respond)
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY
(snip)
Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY




                                                                  3GB

                                 6      30
Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified
Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the
removed node end?
Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2]
Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset
Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state
Mon Feb 21 06:55:01 [conn25] replSet RECOVERING
Mon Feb 21 06:55:01 [conn25] replSet PRIMARY
Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally
Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo",
version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" },
{ _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to
respond)
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up
Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY
(snip)
Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY




                                                                  3GB

                                 6      30
disk allocation
disk allocation

 pre allocation
disk allocation

 pre allocation

 dd zero padding
       OK
…
…
…
…




20
…




20
Amazon EC2 large

MongoDB 1.6.5
16 connections from worker


write 12000 qps
select 100000qps
MyBike.JP
MyBike.JP
MyBike.JP




            http://mybike.jp
MyBike.JP




            http://mybike.jp
MyBike.JP




            http://mybike.jp
MyBike.JP




            http://mybike.jp
GridFS
GridFS
7300 objects
1GB
Python
Python

 pymongo
Python

 pymongo
Python

 pymongo
Python

 pymongo




         …
nginx
nginx

nginx-gridfs
nginx

nginx-gridfs
GridFS
GridFS

 django-storages
GridFS

 django-storages
GridFS

 django-storages
malloc
malloc

32bit
malloc

            32bit

Wed Feb 9 16:52:09 [initandlisten]    mmap() failed for /var/lib/mongodb/
$tmp_repairDatabase_0/mybike.4 len:536870912 errno:12 Cannot allocate memory
Wed Feb 9 16:52:09 [initandlisten]       mmap failed with out of memory, if
you're using 32-bits, then you probably need to upgrade to 64
Wed Feb 9 16:52:09 [initandlisten] warning: exception cloning object in
mybike.fs.chunks can't map file memory - mongo requires 64 bit build for larger
datasets obj:{ _id: ObjectId('4d44a08c4ae613113700033f'), files_id:
ObjectId('4d44a08c4ae613113700033e'), data: BinData, n: 0 }
Wed Feb 9 16:52:09 [initandlisten]       mmap failed with out of memory, if
you're using 32-bits, then you probably need to upgrade to 64
32bit
32bit
32bit
32bit
32bit

2GB
32bit
32bit

2GB
32bit
32bit

2GB
mongodb stop && mongodb start
mongodb stop && mongodb start
init script
init script
10gen   Debian
init script
10gen   Debian

        …
init script
10gen   Debian

        …

mongodb stop && mongodb start
init script
10gen   Debian

        …

mongodb stop && mongodb start

 stop
init script
10gen   Debian

        …

mongodb stop && mongodb start

 stop
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to flush oplog...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to close sockets...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: waiting for fs preallocator...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: closing all files...
Mon   Feb   21   06:18:04   [conn1] end connection 127.0.0.1:52525
Mon   Feb   21   06:18:05       closeAllFiles() finished

Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock...
Mon Feb 21 06:18:05 dbexit: really exiting now
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to flush oplog...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to close sockets...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: waiting for fs preallocator...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: closing all files...
Mon   Feb   21   06:18:04   [conn1] end connection 127.0.0.1:52525
Mon   Feb   21   06:18:05       closeAllFiles() finished

Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock...
Mon Feb 21 06:18:05 dbexit: really exiting now
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to flush oplog...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to close sockets...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: waiting for fs preallocator...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: closing all files...
Mon   Feb   21   06:18:04   [conn1] end connection 127.0.0.1:52525
Mon   Feb   21   06:18:05       closeAllFiles() finished

Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock...
Mon Feb 21 06:18:05 dbexit: really exiting now
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to flush oplog...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to close sockets...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: waiting for fs preallocator...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: closing all files...
Mon   Feb   21   06:18:04   [conn1] end connection 127.0.0.1:52525
Mon   Feb   21   06:18:05       closeAllFiles() finished

Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock...
Mon Feb 21 06:18:05 dbexit: really exiting now
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to flush oplog...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to close sockets...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: waiting for fs preallocator...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: closing all files...
Mon   Feb   21   06:18:04   [conn1] end connection 127.0.0.1:52525
Mon   Feb   21   06:18:05       closeAllFiles() finished

Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock...
Mon Feb 21 06:18:05 dbexit: really exiting now




                 mongodb restart
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to flush oplog...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: going to close sockets...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: waiting for fs preallocator...
Mon   Feb   21   06:18:04   [interruptThread] shutdown: closing all files...
Mon   Feb   21   06:18:04   [conn1] end connection 127.0.0.1:52525
Mon   Feb   21   06:18:05       closeAllFiles() finished

Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock...
Mon Feb 21 06:18:05 dbexit: really exiting now




                 mongodb restart
slave
slave

  primary
slave

  primary

slave   primary
slave

  primary

slave   primary

primary / slave
QA
BPStudy #42  MongoDB and MyBike.JP and Me

More Related Content

Viewers also liked

Recycling council of bc
Recycling council of bcRecycling council of bc
Recycling council of bcAlex
 
Tracking social media campaigns @ editech
Tracking social media campaigns @ editechTracking social media campaigns @ editech
Tracking social media campaigns @ editechRobot Media
 
Business seminar
Business seminarBusiness seminar
Business seminarcoughdrop
 
Andyscoggcamp revised
Andyscoggcamp revisedAndyscoggcamp revised
Andyscoggcamp revisedcoughdrop
 
melssCRM Case Study - Maruthi Power Control
melssCRM Case Study - Maruthi Power ControlmelssCRM Case Study - Maruthi Power Control
melssCRM Case Study - Maruthi Power ControlmelssCRM
 
Tagging architecture on MyBike.JP
Tagging architecture on MyBike.JPTagging architecture on MyBike.JP
Tagging architecture on MyBike.JPMitsukuni Sato
 
Gaceta oficial nº 40.965
Gaceta oficial nº 40.965Gaceta oficial nº 40.965
Gaceta oficial nº 40.965David Bastardo
 
Find out about your task
Find out about your taskFind out about your task
Find out about your taskPaula Ortega
 
Infographic: The Brazilian Games Market
Infographic: The Brazilian Games MarketInfographic: The Brazilian Games Market
Infographic: The Brazilian Games MarketIngenico ePayments
 
e2e Projects
e2e Projectse2e Projects
e2e Projectssujite2e
 
melssCRM Introduction
melssCRM IntroductionmelssCRM Introduction
melssCRM IntroductionmelssCRM
 
[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712Sunghun Bae
 
Fete proposal
Fete proposalFete proposal
Fete proposalcoughdrop
 

Viewers also liked (13)

Recycling council of bc
Recycling council of bcRecycling council of bc
Recycling council of bc
 
Tracking social media campaigns @ editech
Tracking social media campaigns @ editechTracking social media campaigns @ editech
Tracking social media campaigns @ editech
 
Business seminar
Business seminarBusiness seminar
Business seminar
 
Andyscoggcamp revised
Andyscoggcamp revisedAndyscoggcamp revised
Andyscoggcamp revised
 
melssCRM Case Study - Maruthi Power Control
melssCRM Case Study - Maruthi Power ControlmelssCRM Case Study - Maruthi Power Control
melssCRM Case Study - Maruthi Power Control
 
Tagging architecture on MyBike.JP
Tagging architecture on MyBike.JPTagging architecture on MyBike.JP
Tagging architecture on MyBike.JP
 
Gaceta oficial nº 40.965
Gaceta oficial nº 40.965Gaceta oficial nº 40.965
Gaceta oficial nº 40.965
 
Find out about your task
Find out about your taskFind out about your task
Find out about your task
 
Infographic: The Brazilian Games Market
Infographic: The Brazilian Games MarketInfographic: The Brazilian Games Market
Infographic: The Brazilian Games Market
 
e2e Projects
e2e Projectse2e Projects
e2e Projects
 
melssCRM Introduction
melssCRM IntroductionmelssCRM Introduction
melssCRM Introduction
 
[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712[UDIS_6_2nd] Data Journalism_20140712
[UDIS_6_2nd] Data Journalism_20140712
 
Fete proposal
Fete proposalFete proposal
Fete proposal
 

Similar to BPStudy #42 MongoDB and MyBike.JP and Me

2008 O Level Analysis
2008 O Level Analysis2008 O Level Analysis
2008 O Level Analysismoe_maldives
 
74_08
74_0874_08
74_08env74
 
【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書env74
 
【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書env74
 
VaR of Operational Risk
VaR of Operational RiskVaR of Operational Risk
VaR of Operational RiskRahmat Mulyana
 
SPICE MODEL of SF5S4 (Standard Model) in SPICE PARK
SPICE MODEL of SF5S4 (Standard Model) in SPICE PARKSPICE MODEL of SF5S4 (Standard Model) in SPICE PARK
SPICE MODEL of SF5S4 (Standard Model) in SPICE PARKTsuyoshi Horigome
 
Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...Mansukh Investment & Trading Solutions
 
slide
slideslide
slidekoh-t
 
Adamasa.marketing plan.new2.powerpoint
Adamasa.marketing plan.new2.powerpointAdamasa.marketing plan.new2.powerpoint
Adamasa.marketing plan.new2.powerpointSTIFORP
 
SPICE MODEL of DF10SC4M (Standard Model) in SPICE PARK
SPICE MODEL of DF10SC4M (Standard Model) in SPICE PARKSPICE MODEL of DF10SC4M (Standard Model) in SPICE PARK
SPICE MODEL of DF10SC4M (Standard Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARKSPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARKTsuyoshi Horigome
 
SPICE MODEL of RN1107FS in SPICE PARK
SPICE MODEL of RN1107FS in SPICE PARKSPICE MODEL of RN1107FS in SPICE PARK
SPICE MODEL of RN1107FS in SPICE PARKTsuyoshi Horigome
 
Duty Computation 0ther
Duty Computation 0therDuty Computation 0ther
Duty Computation 0thercavijayprakash
 
SPICE MODEL of RN1105FV in SPICE PARK
SPICE MODEL of RN1105FV in SPICE PARKSPICE MODEL of RN1105FV in SPICE PARK
SPICE MODEL of RN1105FV in SPICE PARKTsuyoshi Horigome
 
Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...Mansukh Investment & Trading Solutions
 
Blind elephant black hat 2010 v2
Blind elephant   black hat 2010 v2Blind elephant   black hat 2010 v2
Blind elephant black hat 2010 v2Jaime Restrepo
 
SPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARKTsuyoshi Horigome
 
Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...Mansukh Investment & Trading Solutions
 

Similar to BPStudy #42 MongoDB and MyBike.JP and Me (20)

Particle size
Particle sizeParticle size
Particle size
 
2008 O Level Analysis
2008 O Level Analysis2008 O Level Analysis
2008 O Level Analysis
 
74_08
74_0874_08
74_08
 
【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書
 
【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書【国立大学法人 福島大学】平成20年環境報告書
【国立大学法人 福島大学】平成20年環境報告書
 
VaR of Operational Risk
VaR of Operational RiskVaR of Operational Risk
VaR of Operational Risk
 
SPICE MODEL of SF5S4 (Standard Model) in SPICE PARK
SPICE MODEL of SF5S4 (Standard Model) in SPICE PARKSPICE MODEL of SF5S4 (Standard Model) in SPICE PARK
SPICE MODEL of SF5S4 (Standard Model) in SPICE PARK
 
Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 24 September 2012-Mansukh Investment and Trading Solu...
 
slide
slideslide
slide
 
Adamasa.marketing plan.new2.powerpoint
Adamasa.marketing plan.new2.powerpointAdamasa.marketing plan.new2.powerpoint
Adamasa.marketing plan.new2.powerpoint
 
SPICE MODEL of DF10SC4M (Standard Model) in SPICE PARK
SPICE MODEL of DF10SC4M (Standard Model) in SPICE PARKSPICE MODEL of DF10SC4M (Standard Model) in SPICE PARK
SPICE MODEL of DF10SC4M (Standard Model) in SPICE PARK
 
SPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARKSPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARK
SPICE MODEL of TPCA8004-H (Standard+BDS Model) in SPICE PARK
 
Virtualization
VirtualizationVirtualization
Virtualization
 
SPICE MODEL of RN1107FS in SPICE PARK
SPICE MODEL of RN1107FS in SPICE PARKSPICE MODEL of RN1107FS in SPICE PARK
SPICE MODEL of RN1107FS in SPICE PARK
 
Duty Computation 0ther
Duty Computation 0therDuty Computation 0ther
Duty Computation 0ther
 
SPICE MODEL of RN1105FV in SPICE PARK
SPICE MODEL of RN1105FV in SPICE PARKSPICE MODEL of RN1105FV in SPICE PARK
SPICE MODEL of RN1105FV in SPICE PARK
 
Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 12 September 2012-Mansukh Investment and Trading Solu...
 
Blind elephant black hat 2010 v2
Blind elephant   black hat 2010 v2Blind elephant   black hat 2010 v2
Blind elephant black hat 2010 v2
 
SPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARKSPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARK
SPICE MODEL of TPCA8011-H (Professional+BDP Model) in SPICE PARK
 
Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...
Go Ahead for F&O Report 05 September 2012-Mansukh Investment and Trading Solu...
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

BPStudy #42 MongoDB and MyBike.JP and Me

  • 2. MongoDB MyBike MongoDB
  • 4.
  • 5.
  • 6. Mitsukuni Sato a.k.a. @key3 • BeProud • • … • MyBike.JP • MongoDB : Python / Django / PHP /
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. BSON
  • 13. BSON MongoDB JSON … MongoDB shell version: 1.6.6-pre- connecting to: test > foo = { name : 'Mitsukuni Sato' } { "name" : "Mitsukuni Sato" } > db.people.save(foo) > db.people.find() { "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato" }
  • 14.
  • 15.
  • 16.
  • 18. db.collection_name.find( ) > db.people.find({ name : "Mitsukuni Sato" }) { "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato" }
  • 19.
  • 20.
  • 22. db.collection_name.save(BSON ) > user = db.people.findOne({ name : "Mitsukuni Sato" }) { "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato" } > user.age = 33 33 > db.people.save(user) > user = db.people.findOne({ name : "Mitsukuni Sato" }) { "_id" : ObjectId("4d63d9c48cbc8019697a25de"), "name" : "Mitsukuni Sato", "age" : 33 }
  • 23.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. 1:n master / slave
  • 31. 1:n master / slave
  • 32. 1:n master / slave
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42. vs
  • 47. GridFS 4MB
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 57. source code pre-compiled binary .deb (Debian / Ubuntu) RPM (CentOS / Fedora) MacOSX FreeBSD
  • 58.
  • 59. MySQL
  • 60. MySQL 1/10
  • 61. MySQL 1/10
  • 62. MySQL 1/10
  • 63.
  • 64. mongodump & mongorestore mongostat mongo
  • 65. mongodump & mongorestore mongostat mongo
  • 66. mongodump & mongorestore mongostat mongo
  • 67.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73. ruby, python, C++, Java, Perl, C#
  • 74. ruby, python, C++, Java, Perl, C# http://www.mongodb.org/display/DOCS/Drivers
  • 75. ruby, python, C++, Java, Perl, C# http://www.mongodb.org/display/DOCS/Drivers
  • 76.
  • 78. Python + Django django-mongokit
  • 79. Python + Django django-mongokit django-mongodb-engine
  • 80. Python + Django django-mongokit django-mongodb-engine django-storages (GridFS)
  • 81.
  • 82. MySQL
  • 83. MySQL
  • 84. MySQL
  • 85. MySQL
  • 86. MySQL django-mongokit Model Document
  • 90. MySQL + MongoDB metadata object
  • 91. MySQL + MongoDB metadata object django-mongodb-engine
  • 92.
  • 93. Document GridFS django-mongokit django-mongodb-engine
  • 94. Document GridFS django-mongokit django-mongodb-engine RDB
  • 95. Document GridFS django-mongokit django-mongodb-engine RDB django-mongokit
  • 96. Document GridFS django-mongokit django-mongodb-engine RDB django-mongokit
  • 97. Document GridFS django-mongokit django-mongodb-engine RDB django-mongokit django-mongodb-engine
  • 98.
  • 104.
  • 105.
  • 106.
  • 107. 1.7.5 Write Ahead Log
  • 108.
  • 109.
  • 110.
  • 111.
  • 112.
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 118.
  • 119.
  • 120. 240,000 220,000 200,000 180,000 mongod 160,000 140,000 120,000 primary Y 100,000 80,000 60,000 40,000 20,000 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800 X 240,000 220,000 200,000 180,000 160,000 mongod 140,000 bread/s 120,000 slave (1) 100,000 80,000 60,000 40,000 20,000 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800 X 240,000 220,000 200,000 180,000 160,000 mongod 140,000 bread/s 120,000 100,000 slave (2) 80,000 60,000 40,000 20,000 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800 X
  • 121. 100 90 80 70 60 mongod (%) 50 primary 40 30 20 10 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800
  • 122. 100 90 80 70 60 mongod (%) 50 primary 40 30 20 10 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800
  • 123. 100 90 80 70 60 mongod (%) 50 primary 40 30 20 10 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800 nice
  • 124. 100 90 80 70 60 mongod (%) 50 primary 40 30 20 10 0 0 45 90 135 180 225 270 315 360 405 450 495 540 585 630 675 720 765 800 nice …
  • 125. Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25 Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the removed node end? Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2] Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state Mon Feb 21 06:55:01 [conn25] replSet RECOVERING Mon Feb 21 06:55:01 [conn25] replSet PRIMARY Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo", version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" }, { _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to respond) Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY (snip) Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY
  • 126. Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25 Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the removed node end? Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2] Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state Mon Feb 21 06:55:01 [conn25] replSet RECOVERING Mon Feb 21 06:55:01 [conn25] replSet PRIMARY Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo", version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" }, { _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to respond) Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY (snip) Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY 3GB
  • 127. Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25 Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the removed node end? Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2] Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state Mon Feb 21 06:55:01 [conn25] replSet RECOVERING Mon Feb 21 06:55:01 [conn25] replSet PRIMARY Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo", version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" }, { _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to respond) Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY (snip) Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY 3GB 6 30
  • 128. Mon Feb 21 06:55:00 [initandlisten] connection accepted from 127.0.0.1:59385 #25 Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig config object parses ok, 3 members specified Mon Feb 21 06:55:00 [conn25] replSet TODO : don't allow removal of a node until we handle it at the removed node end? Mon Feb 21 06:55:00 [conn25] replSet replSetReconfig [2] Mon Feb 21 06:55:00 [conn25] replSet info saving a newer config version to local.system.replset Mon Feb 21 06:55:01 [conn25] replSet relinquishing primary state Mon Feb 21 06:55:01 [conn25] replSet RECOVERING Mon Feb 21 06:55:01 [conn25] replSet PRIMARY Mon Feb 21 06:55:01 [conn25] replSet replSetReconfig new config saved locally Mon Feb 21 06:55:01 [conn25] query admin.$cmd ntoreturn:1 command: { replSetReconfig: { _id: "foo", version: 2, members: [ { _id: 0, host: "ip-10-118-13-29" }, { _id: 1, host: "ip-10-202-30-58" }, { _id: 2.0, host: "ip-10-195-11-64" } ] } } reslen:53 1036ms Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-195-11-64 is now down (or slow to respond) Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet info ip-10-118-13-29 is now up Mon Feb 21 06:55:01 [ReplSetHealthPollTask] replSet ip-10-118-13-29 SECONDARY (snip) Mon Feb 21 07:01:30 [ReplSetHealthPollTask] replSet ip-10-195-11-64 SECONDARY 3GB 6 30
  • 129.
  • 131. disk allocation pre allocation
  • 132. disk allocation pre allocation dd zero padding OK
  • 133.
  • 134.
  • 135.
  • 136.
  • 137. … 20
  • 138. … 20
  • 139. Amazon EC2 large MongoDB 1.6.5 16 connections from worker write 12000 qps select 100000qps
  • 141.
  • 143. MyBike.JP http://mybike.jp
  • 144. MyBike.JP http://mybike.jp
  • 145. MyBike.JP http://mybike.jp
  • 146. MyBike.JP http://mybike.jp
  • 147.
  • 148.
  • 149. GridFS
  • 150. GridFS
  • 152.
  • 153.
  • 154.
  • 155. Python
  • 160.
  • 161.
  • 162.
  • 163.
  • 164. nginx
  • 167.
  • 168.
  • 169. GridFS
  • 173.
  • 174.
  • 175. malloc
  • 177. malloc 32bit Wed Feb 9 16:52:09 [initandlisten] mmap() failed for /var/lib/mongodb/ $tmp_repairDatabase_0/mybike.4 len:536870912 errno:12 Cannot allocate memory Wed Feb 9 16:52:09 [initandlisten] mmap failed with out of memory, if you're using 32-bits, then you probably need to upgrade to 64 Wed Feb 9 16:52:09 [initandlisten] warning: exception cloning object in mybike.fs.chunks can't map file memory - mongo requires 64 bit build for larger datasets obj:{ _id: ObjectId('4d44a08c4ae613113700033f'), files_id: ObjectId('4d44a08c4ae613113700033e'), data: BinData, n: 0 } Wed Feb 9 16:52:09 [initandlisten] mmap failed with out of memory, if you're using 32-bits, then you probably need to upgrade to 64
  • 178.
  • 179. 32bit
  • 184.
  • 185. mongodb stop && mongodb start
  • 186. mongodb stop && mongodb start
  • 188. init script 10gen Debian
  • 189. init script 10gen Debian …
  • 190. init script 10gen Debian … mongodb stop && mongodb start
  • 191. init script 10gen Debian … mongodb stop && mongodb start stop
  • 192. init script 10gen Debian … mongodb stop && mongodb start stop
  • 193.
  • 194. Mon Feb 21 06:18:04 [interruptThread] shutdown: going to flush oplog... Mon Feb 21 06:18:04 [interruptThread] shutdown: going to close sockets... Mon Feb 21 06:18:04 [interruptThread] shutdown: waiting for fs preallocator... Mon Feb 21 06:18:04 [interruptThread] shutdown: closing all files... Mon Feb 21 06:18:04 [conn1] end connection 127.0.0.1:52525 Mon Feb 21 06:18:05 closeAllFiles() finished Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock... Mon Feb 21 06:18:05 dbexit: really exiting now
  • 195. Mon Feb 21 06:18:04 [interruptThread] shutdown: going to flush oplog... Mon Feb 21 06:18:04 [interruptThread] shutdown: going to close sockets... Mon Feb 21 06:18:04 [interruptThread] shutdown: waiting for fs preallocator... Mon Feb 21 06:18:04 [interruptThread] shutdown: closing all files... Mon Feb 21 06:18:04 [conn1] end connection 127.0.0.1:52525 Mon Feb 21 06:18:05 closeAllFiles() finished Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock... Mon Feb 21 06:18:05 dbexit: really exiting now
  • 196. Mon Feb 21 06:18:04 [interruptThread] shutdown: going to flush oplog... Mon Feb 21 06:18:04 [interruptThread] shutdown: going to close sockets... Mon Feb 21 06:18:04 [interruptThread] shutdown: waiting for fs preallocator... Mon Feb 21 06:18:04 [interruptThread] shutdown: closing all files... Mon Feb 21 06:18:04 [conn1] end connection 127.0.0.1:52525 Mon Feb 21 06:18:05 closeAllFiles() finished Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock... Mon Feb 21 06:18:05 dbexit: really exiting now
  • 197. Mon Feb 21 06:18:04 [interruptThread] shutdown: going to flush oplog... Mon Feb 21 06:18:04 [interruptThread] shutdown: going to close sockets... Mon Feb 21 06:18:04 [interruptThread] shutdown: waiting for fs preallocator... Mon Feb 21 06:18:04 [interruptThread] shutdown: closing all files... Mon Feb 21 06:18:04 [conn1] end connection 127.0.0.1:52525 Mon Feb 21 06:18:05 closeAllFiles() finished Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock... Mon Feb 21 06:18:05 dbexit: really exiting now
  • 198. Mon Feb 21 06:18:04 [interruptThread] shutdown: going to flush oplog... Mon Feb 21 06:18:04 [interruptThread] shutdown: going to close sockets... Mon Feb 21 06:18:04 [interruptThread] shutdown: waiting for fs preallocator... Mon Feb 21 06:18:04 [interruptThread] shutdown: closing all files... Mon Feb 21 06:18:04 [conn1] end connection 127.0.0.1:52525 Mon Feb 21 06:18:05 closeAllFiles() finished Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock... Mon Feb 21 06:18:05 dbexit: really exiting now mongodb restart
  • 199. Mon Feb 21 06:18:04 [interruptThread] shutdown: going to flush oplog... Mon Feb 21 06:18:04 [interruptThread] shutdown: going to close sockets... Mon Feb 21 06:18:04 [interruptThread] shutdown: waiting for fs preallocator... Mon Feb 21 06:18:04 [interruptThread] shutdown: closing all files... Mon Feb 21 06:18:04 [conn1] end connection 127.0.0.1:52525 Mon Feb 21 06:18:05 closeAllFiles() finished Mon Feb 21 06:18:05 [interruptThread] shutdown: removing fs lock... Mon Feb 21 06:18:05 dbexit: really exiting now mongodb restart
  • 200.
  • 201.
  • 202. slave
  • 205. slave primary slave primary primary / slave
  • 206. QA

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n
  96. \n
  97. \n
  98. \n
  99. \n
  100. \n
  101. \n
  102. \n
  103. \n
  104. \n
  105. \n
  106. \n
  107. \n
  108. \n
  109. \n
  110. \n
  111. \n
  112. \n
  113. \n
  114. \n
  115. \n
  116. \n
  117. \n
  118. \n
  119. \n
  120. \n
  121. \n
  122. \n
  123. \n
  124. \n
  125. \n
  126. \n
  127. \n
  128. \n
  129. \n
  130. \n
  131. \n
  132. \n
  133. \n
  134. \n
  135. \n
  136. \n
  137. \n
  138. \n
  139. \n
  140. \n
  141. \n
  142. \n
  143. \n
  144. \n
  145. \n
  146. \n
  147. \n
  148. \n
  149. \n
  150. \n
  151. \n
  152. \n
  153. \n
  154. \n
  155. \n
  156. \n
  157. \n
  158. \n
  159. \n
  160. \n
  161. \n
  162. \n
  163. \n
  164. \n
  165. \n
  166. \n
  167. \n
  168. \n
  169. \n
  170. \n
  171. \n
  172. \n
  173. \n
  174. \n
  175. \n
  176. \n
  177. \n
  178. \n
  179. \n
  180. \n
  181. \n
  182. \n
  183. \n
  184. \n
  185. \n
  186. \n
  187. \n
  188. \n
  189. \n
  190. \n
  191. \n
  192. \n
  193. \n
  194. \n
  195. \n