Working around POSIX's faults Improving the reliability of Linux - - PowerPoint PPT Presentation

working around posix s faults
SMART_READER_LITE
LIVE PREVIEW

Working around POSIX's faults Improving the reliability of Linux - - PowerPoint PPT Presentation

Working around POSIX's faults Improving the reliability of Linux named services (NSS) for large institutions Jamie Wilkinson <jaq@google.com> V Hoffman <vasilios@google.com> POSIX 1003.1-2004 The API getnam() getid()


slide-1
SLIDE 1

Working around POSIX's faults

Improving the reliability of Linux named services (NSS) for large institutions

Jamie Wilkinson <jaq@google.com> V Hoffman <vasilios@google.com>

slide-2
SLIDE 2

POSIX 1003.1-2004

slide-3
SLIDE 3

The API

getnam() getid() getent()

slide-4
SLIDE 4

API gets called all the time!

login: jaq Password: % ls -l total 1 drwx------ 2 jaq users 4096 Jan 8 10:20 Desktop/ % host linux.conf.au linux.conf.au has address 221.133.213.165 % sudo -i Password: % cd ~<TAB> ...where does the data come from?

slide-5
SLIDE 5

Databases were plain text files

root:x:0:0:root:/root:/bin/bash alice:x:101:100:alice:/home/alice:/usr/bin/vi bob:x:102:100:bob:/home/bob:/usr/bin/emacs ed:x:103:100:ed:/home/ed:/bin/ed leet:x:103:100:leet:/home/leet:/dev/kmem

... then resources started to centralise!

slide-6
SLIDE 6

$ getent passwd bob libc

root:x:0:0:root:/root:/bin/sh jane:x:1:1:jane:/home/jane:/bin/sh bob:x:2:2:bob:/home/bob:/bin/sh alice:x:3:3:alice:/home/alice:/bin/sh

/etc/passwd

getpwnam("bob")

A Lookup

slide-7
SLIDE 7

Want data from other sources

I'm a computer! DNS LDAP NIS AD Hesiod

slide-8
SLIDE 8

The solution: Name Service Switch

# /etc/nsswitch.conf passwd: compat files groups: compat files shadow: compat files hosts: files dns type of data location of data

slide-9
SLIDE 9

$ getent passwd bob GNU libc NSS libnss_files.so

root:x:0:0:root:/root:/bin/sh jane:x:1:1:jane:/home/jane:/bin/sh bob:x:2:2:bob:/home/bob:/bin/sh alice:x:3:3:alice:/home/alice:/bin/sh

/etc/passwd passwd: files shadow: files group: files

getpwnam("bob")

/etc/nsswitch.conf

NSS

slide-10
SLIDE 10

$ getent passwd bob GNU libc NSS libnss_ldap.so

passwd: files ldap shadow: files ldap group: files ldap getpwnam("bob")

/etc/nsswitch.conf

NSS + LDAP

LDAP Teh Network

uid: bob uidNumber: 101 gidNumber: 101 ...

slide-11
SLIDE 11

$ getent passwd bob GNU libc NSS libnss_ldap.so

passwd: files ldap shadow: files ldap group: files ldap getpwnam("bob")

/etc/nsswitch.conf

NSS + LDAP + NSCD

LDAP Teh Network

uid: bob uidNumber: 101 gidNumber: 101 ...

NSCD

slide-12
SLIDE 12

NSS is fast and never fails

... if only we had EAGAIN

slide-13
SLIDE 13

Effects of failure on NSS

Access Behaviour Speed ... worse, it's often transient!

slide-14
SLIDE 14

General causes of failure

Networks, services are unreliable Reliability is expensive ... at the end of the day, NSS still expects 100% reliability

slide-15
SLIDE 15

Performance impact on the user

0.1 second : instantly responsive 1 second : thought interrupted ... how do you increase the speed of light?

Miller, R. B. (1968). Response time in man-computer conversational transactions.

  • Proc. AFIPS Fall Joint Computer Conference Vol. 33, 267-277.
slide-16
SLIDE 16

299,792,458 m/s

Teh Network

slide-17
SLIDE 17

Lots of network traffic

10,000 users 1,000 groups = 6 MB for passwd database e.g. ls -l /home, cd ~<TAB> = 1 MB for 10k member group ... more than 0.1 seconds!

slide-18
SLIDE 18

Volume of queries

~7000 LDAP queries/day per host Uneven Traffic Peak Traffic ... for a small controlled LAN you may not see this enough to care :-)

slide-19
SLIDE 19

If I had a nickel for every packet

API inefficient Uncacheable TTL

(A nickel is just under 6 australian cents.)

slide-20
SLIDE 20

Software is hard

...and dammit Jim, I'm a sysadmin, not a programmer!

slide-21
SLIDE 21

Requirements for a solution

Goodbye Network Reduce Complexity Persistance SLA ... but I'm just a lowly tape monkey!

slide-22
SLIDE 22

That 70s Show

root:x:0:0:root:/root:/bin/bash alice:x:101:100:alice:/home/alice:/usr/bin/vi bob:x:102:100:bob:/home/bob:/usr/bin/emacs ed:x:103:100:ed:/home/ed:/bin/ed leet:x:103:100:leet:/home/leet:/dev/kmem

... look familiar?

TM

slide-23
SLIDE 23

Cron and a Script

/5 ldapsearch | awk > /etc/passwd

slide-24
SLIDE 24

NSS Cache

# /etc/nsscache.conf [DEFAULT] # Default NSS data source module name source = ldap # Default NSS data cache module name cache = nssdb # NSS maps to be cached maps = passwd, group, shadow

slide-25
SLIDE 25

TODO

Automount Support Performance Local Rewrites Pay attention to code.google.com Ponies

slide-26
SLIDE 26

Questions?

http://code.google.com/p/nsscache