baking-in transparency

49
Baking-In Transparency Saturday, October 8, 11

Upload: matt-simmons

Post on 05-Dec-2014

366 views

Category:

Technology


0 download

DESCRIPTION

This is from an invited talk I gave at the Pittsburgh Perl Workshop a few years back. It's not often that I get a chance to talk to developers, so I thought I'd take advantage of it and yell at them a bit ;-)

TRANSCRIPT

Page 1: Baking-In Transparency

Baking-In Transparency

Saturday, October 8, 11

Page 2: Baking-In Transparency

About Me

• Matt Simmons

• 11+ year System Administrator

• http://www.standalone-sysadmin.com

• @standaloneSA

[email protected]

Saturday, October 8, 11

Page 3: Baking-In Transparency

Baking-In Transparency

Saturday, October 8, 11

Page 4: Baking-In Transparency

The Situation

Saturday, October 8, 11

Page 5: Baking-In Transparency

Devs make things

• Small discrete programs

• Large complex programs

• Immense interconnected software suites

Saturday, October 8, 11

Page 6: Baking-In Transparency

Ops makes things go

• Script using small discrete programs

• Administer large complex programs

• Cluster immense interconnected software suites

Saturday, October 8, 11

Page 7: Baking-In Transparency

There is a

direct relationship

between the software that developers write and the

software that gets implemented by operations.

Saturday, October 8, 11

Page 8: Baking-In Transparency

The Problems

Saturday, October 8, 11

Page 9: Baking-In Transparency

Software needs to be monitored

"When performance is measured, performance improves. When performance is measured and reported back, the rate of improvement accelerates."

--Pearson’s Law

Saturday, October 8, 11

Page 10: Baking-In Transparency

“You can’t manage what you can’t measure”--Robert Kaplan

Why?

Saturday, October 8, 11

Page 11: Baking-In Transparency

Software needs to be managedClearly we need to

“Management by objective works - if you know the objective. 90% of the time, you don’t.”

--Peter Drucker

Saturday, October 8, 11

Page 12: Baking-In Transparency

Clearly we need to measure...

But what do we measure?

And what metrics do we use?

How do we obtain the measurements?

Saturday, October 8, 11

Page 13: Baking-In Transparency

Software Engineers measure...• Programmer Productivity

• code size/efficiency

• Defect Density

• Bugs / module size

• Requirement Stability

• “feature creep”

What do we measure?

Saturday, October 8, 11

Page 14: Baking-In Transparency

Operations measures...• Resource Utilization

• Diskspace, Bandwidth, etc

• Infrastructure Stability

• Service Uptime, MTBF, etc

• Performance

• CPU / Memory efficiency, etc

What do we measure?

Saturday, October 8, 11

Page 15: Baking-In Transparency

What metrics do we use?

It depends.

Duh.

Saturday, October 8, 11

Page 16: Baking-In Transparency

The metrics that Ops needs to monitor are not always easy to obtain...

Saturday, October 8, 11

Page 17: Baking-In Transparency

...even though they’re really important

• Reliability

• Repeatability

• Root Cause Identification

Saturday, October 8, 11

Page 18: Baking-In Transparency

...so not only is monitoring important...

Saturday, October 8, 11

Page 19: Baking-In Transparency

Monitoring is hard.

Saturday, October 8, 11

Page 20: Baking-In Transparency

Monitoring is hard.correctly

V

Saturday, October 8, 11

Page 21: Baking-In Transparency

Why is monitoring hard?

• Monitoring Software Suites are complex

• Infrastructures are complex

• Processes and applications are opaque to our futile requests to determine and track internal state

Saturday, October 8, 11

Page 22: Baking-In Transparency

Processes and applications are opaque to our futile

requests to determine and track internal state

Saturday, October 8, 11

Page 23: Baking-In Transparency

The Solution(s)

Saturday, October 8, 11

Page 24: Baking-In Transparency

Dev/Ops working together gives

• Team Interrelationships

• Knowledge Sharing

• Cross Training

• Tool Sharing

Saturday, October 8, 11

Page 25: Baking-In Transparency

But more specifically...

Methods of monitoring software can be

BUILT INTO THE SOFTWARE

Saturday, October 8, 11

Page 26: Baking-In Transparency

How things are designed now

Question:

Answer:

A well-designed program encounters an error. What happens?

It handles the error, and continues processing requests

Saturday, October 8, 11

Page 27: Baking-In Transparency

How things are designed now

Question:

Answer:

A poorly-designed program encounters an error. What happens?

It crashes and burns

Saturday, October 8, 11

Page 28: Baking-In Transparency

Which of those is easier to monitor?Question:

Saturday, October 8, 11

Page 29: Baking-In Transparency

Obviously, dying to alert the monitoring system is overkill.

(pun firmly intended)

Saturday, October 8, 11

Page 30: Baking-In Transparency

How do we make our statuses available to the monitoring system, then?

It depends on the kind of software

Saturday, October 8, 11

Page 31: Baking-In Transparency

Remember these?

• Small discrete programs

• Large complex programs

• Immense interconnected software suites

Saturday, October 8, 11

Page 32: Baking-In Transparency

Small Discrete Programs

• Possibly a utility

• Usually scripted or run manually

• Typically short-term run time

Saturday, October 8, 11

Page 33: Baking-In Transparency

Small Discrete Programs: Monitoring

• Screen output

• Return codes

• Catch signals

• Great example: ping & SIGQUIT

• SIGUSR1 & SIGUSR2

Saturday, October 8, 11

Page 34: Baking-In Transparency

Signal Handling in Perl

sub USR1_handler { drop_state_file();

}

$SIG{‘USR1’} = ‘USR1_handler’;

Saturday, October 8, 11

Page 35: Baking-In Transparency

Large Complex Programs

• Probably a daemon or interactive program

• Long running, needs to be stable

• Subject to resource change over time

• May need to retain state across restarts

• May have a web component

Saturday, October 8, 11

Page 36: Baking-In Transparency

Large Complex Programs:Reporting

• No screen output (except debugging)

• Logging

• SNMP Agent/Traps

• (seriously, read ‘man snmpd.conf’)

• Named Pipes (FIFO)

• State Output to DB (if appropriate)

Saturday, October 8, 11

Page 37: Baking-In Transparency

Net-SNMP Embedded Perl

perl use Data::Dumper;

perl sub myroutine { print "got called:",Dumper(@_),"\n";

}

perl $agent->register('mylink', '.1.3.6.1.8765', \&myroutine);

Saturday, October 8, 11

Page 38: Baking-In Transparency

Immense Interconnected Software Suites

(or Large Suites)

Saturday, October 8, 11

Page 39: Baking-In Transparency

Large Suites

• Definitely retain state across restarts

• Probably requires centralized controller

• May use sockets to communicate

• Probably has a web component

Saturday, October 8, 11

Page 40: Baking-In Transparency

Large Suites:Reporting

• Monitoring coordinated by the “central” node or program

• Aggregation of state

• Provide layer of abstraction from any in-suite monitoring or reporting

• Provide XML/CSV in addition to human-parsable HTML pages

Everything under “Large Programs”, plus...

Saturday, October 8, 11

Page 41: Baking-In Transparency

What we’re really doing is IPC

So what other methods exist? Lots.

Saturday, October 8, 11

Page 42: Baking-In Transparency

Unix IPC

• Sockets

• RPC

• Message Queues

• FIFO

• Shared Memory

• And Many More...

Saturday, October 8, 11

Page 43: Baking-In Transparency

They shouldn’t all be used...

Saturday, October 8, 11

Page 44: Baking-In Transparency

What is important is that you use SOMETHING

Saturday, October 8, 11

Page 45: Baking-In Transparency

What is best?

To crush your enemies, see them driven before you, and to hear the

lamentation of their women?

Saturday, October 8, 11

Page 46: Baking-In Transparency

What is best?

• An application that is easily and openly monitored

• A developer that considers monitoring in all phases of design and development

• A developer who writes their own monitoring checks

Saturday, October 8, 11

Page 47: Baking-In Transparency

Do us all a favor...

When you develop software, be it scripts, utilities, programs, or suites, please please please...

Saturday, October 8, 11

Page 48: Baking-In Transparency

Do us all a favor...

When you develop software, be it scripts, utilities, programs, or suites, please please please...

Consider how we Ops folks will manage and monitor it.

Saturday, October 8, 11

Page 49: Baking-In Transparency

Thank you for your time.

Matt SimmonsstandaloneSA on Twitter

[email protected]://www.standalone-sysadmin.com

Baking-In Transparency

Saturday, October 8, 11