working around posix s faults
play

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()


  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>

  2. POSIX 1003.1-2004

  3. The API get�nam() get�id() get�ent()

  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?

  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!

  6. A Lookup $ getent passwd bob getpwnam("bob") libc /etc/passwd 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

  7. Want data from other sources I'm a computer! NIS DNS Hesiod AD LDAP

  8. The solution: Name Service Switch # /etc/nsswitch.conf passwd: compat files groups: compat files location of data shadow: compat files hosts: files dns type of data

  9. NSS $ getent passwd bob /etc/nsswitch.conf getpwnam("bob") passwd: files shadow: files GNU NSS group: files libc /etc/passwd root:x:0:0:root:/root:/bin/sh libnss_files.so 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

  10. NSS + LDAP $ getent passwd bob /etc/nsswitch.conf getpwnam("bob") passwd: files ldap shadow: files ldap GNU NSS group: files ldap libc LDAP Teh uid: bob libnss_ldap.so Network uidNumber: 101 gidNumber: 101 ...

  11. NSS + LDAP + NSCD $ getent passwd bob getpwnam("bob") /etc/nsswitch.conf passwd: files ldap GNU shadow: files ldap NSS libc group: files ldap LDAP NSCD Teh uid: bob Network uidNumber: 101 gidNumber: 101 ... libnss_ldap.so

  12. NSS is fast and never fails ... if only we had EAGAIN

  13. Effects of failure on NSS Access Behaviour Speed ... worse, it's often transient!

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

  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.

  16. 299,792,458 m/s Teh Network

  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!

  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 :-)

  19. If I had a nickel for every packet (A nickel is just under 6 australian cents.) API inefficient Uncacheable TTL

  20. Software is hard ...and dammit Jim, I'm a sysadmin, not a programmer!

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

  22. TM 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?

  23. Cron and a Script �/5 � � � � ldapsearch | awk > /etc/passwd

  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

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

  26. Questions? http://code.google.com/p/nsscache

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend