Escolar Documentos
Profissional Documentos
Cultura Documentos
Alvin Richards
alvin@10gen.com
So you’re ready to deploy !
some points to consider
Agenda
• A word on performance
• Sizing Your Hardware
• memory / cpu / disk io
• Software
• os / filesystem
• Installing MongoDB / Upgrades
• EC2 Notes
• Security
• Backup
• Durability
• Upgrading
• Monitoring
• Scaling out
A Word on Performance
• Ensure your queries are being executed correctly
• Enable profiling
• db.setProfilingLevel(n)
• n=1: slow operations, n=2: all operations
• Viewing profile information
• db.system.profile.find({info: /test.foo/})
•http://www.mongodb.org/display/DOCS/Database+Profiler
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sda2 0.50 4761.19 6.47 837.31 75.62 43681.59 51.86 38.38 42.33 0.46 38.41
• MongoDB is filesystem-neutral:
• ext3, ext4, XFS are most used
• ext4 / XFS preferred (posix_fallocate())
• improved performance for file allocation
MongoDB Version Policy
• Upgrading database
• Install new version of MongoDB
• Stop previous version
• Start new version
• MUST
• fsync - flushes buffers to disk
• lock - blocks writes
db.runCommand({fsync:1,lock:1})
• Write acknowledged
when in memory on
master only
Durability - Master + Slaves
• W=2
• Write acknowledged when
in memory on master + slave
• Will survive failure of a
single node
Durability - Master + Slaves +
fsync
• W=n
• Write acknowledged when in
memory on master + slaves
• Pick a “majority” of nodes
• fsync in batches (since it
blocking)
Slave delay
• Protection against app
faults
• Protection against
administration mistakes
• Slave runs X amount of
time behind
Scale out
read
mongos
/
rep_a1 rep_a2 rep_a3 config
server
mongos
/
rep_b1 rep_b2 rep_b3 config
server
mongos
/
rep_c2 rep_c2 rep_c3 config
server
write
Monitoring
• mongostat
• Built in UI, use --rest and port #
+1000
• Plugins for:
• Munin, Cacti, Nagios, Zabbix...
• Hosted options
• Server Density, Cloudkick...
• Primary function:
• Measure stats over time
• Tells you what is going on with
your system
Management
• Mongo shell
• 3rd party tools
• Fang of Mongo
• Futon4Mongo
• Mongo3
• MongoHub
• MongoVUE
• Mongui
• Myngo
• Opricot
• PHPMoAdmin
• RockMongo
download at mongodb.org
We’re Hiring !
alvin@10gen.com