Top Banner
35

MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

Jan 27, 2017

Download

Technology

MongoDB
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters
Page 2: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

MongoDB Support Cases: The Blockbusters

Daniel Coupal Technical Services Engineer

Palo Alto

Page 3: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

3

Support Team

Page 4: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

4

Goal of the Presentation

•  Remember 3 things from this presentation •  Make 1 change in your application or

deployment •  Good return on your hour spent in this

presentation

Page 5: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

5

#1 - “Toto, I've a feeling we're not in Kansas anymore”

Page 6: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

6

#1 - “Toto, I've a feeling we're not in Kansas anymore”

ü The Wizard of OZ (1939)

Page 7: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

7

#1 – The NoSQL World is different

Page 8: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

8

#1 – The NoSQL World is different

Relational World NoSQL World 1 - Model the data 1 - Define the access to the data 2 - Write the queries to access the data

2 - Model the data

Page 9: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

9

#2 - “Houston, we have a problem”

Page 10: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

10

#2 - “Houston, we have a problem”

ü Apollo 13 (1995)

Page 11: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

11

#2 – Have a Test Environment

•  Best –  identical cluster –  restore production data in test/staging/QA

environment

•  Acceptable –  less shards with identical hardware

•  Less desirable –  smaller hardware –  non representative data

Page 12: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

12

#3 – “Elementary, my dear Watson”

Page 13: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

13

#3 – “Elementary, my dear Watson”

ü The Adventures of Sherlock Holmes (1905, 1921, 1939, 1984)

Page 14: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

14

#3 – Look for Clues of Bad Queries (slow queries in mongod log)

•  2.6 format •  2015-09-23T07:06:15.465-0400 [conn21987] query mydb.coll1

query: { tr: { $lte: "2014-08-24-day" }, a: "", b: "min" } planSummary: COLLSCAN ntoreturn:0 ntoskip:0 nscanned:13798085 nscannedObjects:13798085 keyUpdates:0 numYields:267371 locks(micros) r:105591398 nreturned:0 reslen:20 812656ms

•  3.0 format •  2015-10-15T19:48:15.095+0000 I QUERY [conn1844] query

mydb.coll2 query: { $readPreference: { mode: "primary" }, $query: {key: "ZrzfmfFlUV3i8iARTyXWD0Qxa8I=" } } planSummary: COLLSCAN ntoskip:0 nscanned:0 nscannedObjects:83256 keyUpdates:0 writeConflicts:0 numYields:650 nreturned:0 reslen:20 locks:{ Global: { acquireCount: { r: 1302 } }, Database: { acquireCount: { r: 651 } }, Collection: { acquireCount: { r: 651 } } } 121ms

Page 15: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

15

#3 – Look for Clues of Bad Queries

•  mtools for plots and stats on queries

Page 16: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

16

#3 – Look for Clues of Bad Queries

•  CloudManager –  Suggested indexes

Page 17: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

17

#4 - “Round up the usual suspects”

Page 18: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

18

#4 - “Round up the usual suspects”

ü Casablanca (1942)

Page 19: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

19

#4 – Settings in Production Notes

•  Hardware –  Using NAS –  Using other FS than xfs on Linux for Wired Tiger –  Using other FS than ext4 or xfs on Linux for MMapV1 –  Maxed out spinning disks

•  OS Settings –  ulimits too low –  too high readahead for disks –  Transparent Huge Pages on –  NUMA on

Page 20: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

20

#4 – Settings in Production Notes

•  Tools –  Production notes –  Mdiag (in Github)

Page 21: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

21

#5 - “You’re gonna need a bigger boat”

Page 22: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

22

#5 - “You’re gonna need a bigger boat”

ü Jaws (1975)

Page 23: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

23

#5 – Appropriate Hardware for OpsManager

•  Correctly sizing right at the beginning –  Consulting package –  Open a Commercial Support ticket

•  Beware of changes in the initial estimates

Page 24: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

24

#6 - “Bond, James Bond”

Page 25: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

25

#6 - “Bond, James Bond”

ü Dr. No (1962)

Page 26: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

26

#6 - Cloud/Ops Manager Agents always initiate communications

db.movies.find({“series”:”James Bond”}) .sort({“date”:1}) .limit(1)

Page 27: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

27

#6 - Cloud/Ops Manager Agents always initiate communications

Agent Hi, I am part of the 007 group.

Server Go collect information about the hosts goldfinger, scaramanga and doctorno.

Agent Here are their status and metrics for goldfinger and scaramanga.

Agent doctorno is now permanently unreachable.

Page 28: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

28

#7 – “You've got to ask yourself one question: 'Do I feel lucky?’ “

Page 29: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

29

#7 – “You've got to ask yourself one question: 'Do I feel lucky?’ “

ü Dirty Harry (1971)

Page 30: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

30

#7 - Knowledge is King

•  Use the right resources –  MongoDB.com/presentations –  Conferences: MongoDB Days/MongoDB World –  Consulting packages –  Commercial Support –  Free Support (Google groups and Stack Overflow) –  Training classes

Page 31: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

Conclusion

Page 32: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

32

Take Away

•  Remember 3 things from this presentation •  Make 1 change in your application or

deployment •  Good return on your hour spent in this

presentation

Page 33: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

Questions… “You talking to me?”

Page 34: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters

Thank you and “May the Force be with you”

Page 35: MongoDB Days Silicon Valley: MongoDB Support Cases: The Blockbusters