All About Storeconfigs

60
Storeconfigs All About Brice Figureau masterzen (#puppet)

description

Storeconfigs is not a popular feature among Puppet admins, because most don’t know how to use it or fear performance issues. Attend this talk to know how to enhance your Puppet deployments with easy cross-nodes interactions and collaborations, while conserving system efficiency.

Transcript of All About Storeconfigs

Page 1: All About Storeconfigs

StoreconfigsAll About

Brice Figureaumasterzen (#puppet)

Page 2: All About Storeconfigs

Who am I?

Page 3: All About Storeconfigs
Page 4: All About Storeconfigs

Puppet Community Developerplanetpuppet.org maintainer

Page 5: All About Storeconfigs
Page 6: All About Storeconfigs

Whatʼs Storeconfigs?

Page 7: All About Storeconfigs

Storeconfigs stores to an RDBMSuses Railsʼ Active Record

Page 8: All About Storeconfigs

2 Possible Usages

Inventory Export/Collect

Page 9: All About Storeconfigs

Export/CollectNode collaborations

Page 10: All About Storeconfigs

Syntax: export

@@resource { ...}

Page 11: All About Storeconfigs

Syntax: collect

Resource <<| query |>>

Page 12: All About Storeconfigs

Collect: Query•Resource Parameters•Tags•and, or

Page 13: All About Storeconfigs

Tip

Always tag exported resources

Page 14: All About Storeconfigs

The BIG Picture

masterDB

collector 1

Exporter

collector 2

Page 15: All About Storeconfigs

Simple exampleWeb server replication, deployment server

Page 16: All About Storeconfigs

Simple exampleWeb server replication, web server part

Page 17: All About Storeconfigs

Intermediate exampleBuilding /etc/resolv.conf from exported snippets

Page 18: All About Storeconfigs

Intermediate exampleBuilding /etc/resolv.conf, aggregating snippets

Page 19: All About Storeconfigs

Advanced ExampleTinydns master

Page 20: All About Storeconfigs

Advanced ExampleTinydns master

Page 21: All About Storeconfigs

Advanced ExampleTinydns slave

Page 22: All About Storeconfigs

Limitations

Page 23: All About Storeconfigs

Inner Workings

Page 24: All About Storeconfigs

Inner Workings1. Read all resources, tags for a node (slow)

Page 25: All About Storeconfigs

Inner Workings2. Compare with in-memory catalog (fast)

Page 26: All About Storeconfigs

Inner Workings3. Store/remove missing/extraneous resources/tags (slow)

Page 27: All About Storeconfigs

Inner WorkingsDB schema

Page 28: All About Storeconfigs

Performance Impact

Page 29: All About Storeconfigs

Performance ImpactCollecting is fast

Page 30: All About Storeconfigs

Performance ImpactStoreconfigs write can be slow

Page 31: All About Storeconfigs

Performance Impact

0

6

13

19

25

Time (seconds)

Off On1st run (1950 resources)

Page 32: All About Storeconfigs

Performance Impact

0

2

4

6

8

Time (seconds)

Off OnSubsequent runs (1950 resources)

Page 33: All About Storeconfigs

First Run Impact

Page 34: All About Storeconfigs

First Run ImpactFailure

err: Could not retrieve catalog: execution expired

Page 35: All About Storeconfigs

Scaling: some rough math1 HDD = 250 IOP/s

Page 36: All About Storeconfigs

Scaling: some rough mathAll nodes have 500 resources4 params/ resources4 tags/resources=> 4500 writes=> 1000 IOP

Page 37: All About Storeconfigs

Scaling: some rough mathMaster concurrency: 5

Page 38: All About Storeconfigs

Scaling: some rough mathIOP/s left per node:

250/5 = 50 IOP/s

Page 39: All About Storeconfigs

Scaling: some rough mathTime per node

1000 IOP = 20s

Page 40: All About Storeconfigs

Scaling: some rough mathAnd for a 500 nodes setup...

500/5 = 100 “runs”

Page 41: All About Storeconfigs

Scaling: some rough mathWith a sleep time of 30min

30 min = 1800s1800s/20s = 90

90 nodes per 30 min

Page 42: All About Storeconfigs

Scaling: some rough mathHouston we have a problem

90 nodes when we needed 100

Page 43: All About Storeconfigs

Scaling the back-endDedicated RDBMS server(s)

Page 44: All About Storeconfigs

Scaling the back-endPowerful I/O subsystem (RAID,BBU...)

Page 45: All About Storeconfigs

Scaling the back-endDB setup tuning

Page 46: All About Storeconfigs

Scaling the back-endMySQL, scaling for insertsinnodb_buffer_pool_size = 70% of physical RAM

Page 47: All About Storeconfigs

Scaling the back-endMySQL, scaling for insertsinnodb_log_file_size = up to 5% of physical RAM

Page 48: All About Storeconfigs

Scaling the back-endMySQL, scaling for insertsinnodb_flush_method = O_DIRECT

Page 49: All About Storeconfigs

Scaling the back-endMySQL, scaling for insertsinnodb_flush_log_at_trx_commit = 2

Page 50: All About Storeconfigs

0.25 to the help!

Page 51: All About Storeconfigs

0.25 to the help!Async Storeconfigs - no more thundering herd

Page 52: All About Storeconfigs

0.25: Async Storeconfigs

masterDB

node

puppetqdMessage Queue

Page 53: All About Storeconfigs

0.25: Thin StoreconfigsOnly exported resources, tags and facts

Page 54: All About Storeconfigs

0.25: Thin Storeconfigs

0

1

3

4

6

Time (seconds)

Off On1st run (1950 resources)

Page 55: All About Storeconfigs

Storeconfigs future?

Page 56: All About Storeconfigs

More AR adapters

Page 57: All About Storeconfigs

More AR tuning (pooling)

Page 58: All About Storeconfigs

Non RDBMS back-ends

Page 59: All About Storeconfigs

Non RDBMS back-ends•Tokyo Cabinet/Tyrant

•Mongo DB

Page 60: All About Storeconfigs

Questions ?Please speak loud and slowly and excuse me

by advance if I donʼt understand a word of your question.

Being French has some advantages (like health care access or a cute if not stupid accent)it also has drawbacks, especially our educational system for

learning foreign languages simply sucks :-D