Teaching Penguins to Tell Time

Similar documents
IBM Client Center z/vm 6.2 Single System Image (SSI) & Life Guest Relocation (LGR) DEMO

Enterprise Workload Manager Overview and Implementation

z/vm Resource Manager

SHARE in Pittsburgh Session 15801

Best Practices for WebSphere Application Server on System z Linux

Dynamic Routing: Exploiting HiperSockets and Real Network Devices

z/vm and TCP/IP for z/vm Overview

Session V61. Systems Management on z/vm Christine Casey z/vm Development - IBM Endicott, NY. IBM System z Expo September 17-21, 2007 San Antonio, TX

Dynamic Routing: Exploiting HiperSockets and Real Network Devices

Distributed Systems. Clock Synchronization: Physical Clocks. Paul Krzyzanowski

WebSphere Application Server Base Performance

z/vm 6.3 Installation or Migration or Upgrade Hands-on Lab Sessions

z/vm Data Collection for zpcr and zcp3000 Collecting the Right Input Data for a zcp3000 Capacity Planning Model

z/vm 6.3 A Quick Introduction

VM Parallel Access Volume (PAV) and HyperPAV Support

IBM Tivoli Directory Server for z/os. Saheem Granados, CISSP IBM Monday, August 6,

Advanced Technical Skills (ATS) North America. John Burg Brad Snyder Materials created by John Fitch and Jim Shaw IBM Washington Systems Center

The Art of Squeezing Penguins

z/os Data Set Encryption In the context of pervasive encryption IBM z systems IBM Corporation

Accessing LINUX file systems from CMS. Metropolitan VM Users Association January 24, 2005

z/osmf 2.1 User experience Session: 15122

CPU MF Counters Enablement Webinar

zmanager: Platform Performance Manager Hiren Shah IBM March 14,

PROGxx and LLA Enhancements z/os 1.12

Clock-Synchronisation

Thomas Petrolino IBM Poughkeepsie Session 17696

IBM Multi-Factor Authentication in a Linux on IBM Z environment - Example with z/os MFA infrastructure

DFSMSdss Best Practices in an SMS Environment

zenterprise exposed! Experiences with zenterprise Unified Resource Manager

Greg Daynes z/os Software Deployment

Introduction to. z/vm and Linux on System z. Malcolm Beattie Linux Technical Consultant, IBM UK. From a presentation by Ralf Schiefelbein, IBM Germany

Linux on zseries Journaling File Systems

SAP on IBM z Systems. Customer Conference. April 12-13, 2016 IBM Germany Research & Development

9708: Shaping the Future of IBM Documentation Delivery and Management

AIM Enterprise Platform Software IBM z/transaction Processing Facility Enterprise Edition 1.1.0

Distributed Systems. 05. Clock Synchronization. Paul Krzyzanowski. Rutgers University. Fall 2017

z/vm Paging with SSD and Flash- Type Disk Devices

Using FlashCopy in the DB2 Utilities

Managing LDAP Workloads via Tivoli Directory Services and z/os WLM IBM. Kathy Walsh IBM. Version Date: July 18, 2012

ZVM20: z/vm PAV and HyperPAV Support

Now Available in z/os V2R2 JES3: OUTDISP

How Smarter Systems Deliver Smarter Economics and Optimized Business Continuity

KVM for IBM z Systems

zpcr Capacity Sizing Lab

Overview of cryptography and enhancements on z/vse 4.3

IEBCOPY Teaching an Old Dog New Tricks

TPF Users Group Fall 2008 Title: z/tpf Support for OpenLDAP

Framework for Doing Capacity Sizing on System z Processors

Virtual Security Zones on z/vm

Virtual Security Zones

V6R1 System i Navigator: What s New

IBM Application Runtime Expert for i

Websphere zos Mettle Test 2003 Can Your Enterprise Server Do This?

IBM System Storage DS8870 Release R7.3 Performance Update

Session zse4187 Virtual Security Zones on z/vm

zpcr Capacity Sizing Lab

Using WebSphere Application Server Optimized Local Adapters (WOLA) to Integrate COBOL and zaap-able Java

Optimize Your Heterogeneous SOA Infrastructure

Server Time Protocol for IBM System z9, zseries 990 and 890; non-raised-floor support for System z9 BC

Mary Komor Development Tools Subcommittee

Running Docker applications on Linux on the Mainframe

Getting Started What?? Plan of Action Features and Function Short demo

TPF Users Group Code Coverage in TPF Toolkit

SETTING UP AN NTP SERVER AT THE ROYAL OBSERVATORY OF BELGIUM

Framework for Doing Capacity Sizing for System z Processors

Virtualize Everything but Time

Virtual Security Zones on z/vm

TPF Users Group - Fall 2009 TPF Toolkit Updates

Infor Lawson on IBM i 7.1 and IBM POWER7+

Infor M3 on IBM POWER7+ and using Solid State Drives

Mobile access to the existing z/vse application

A Pragmatic Path to Compliance. Jaffa Law

Scalability and stability of libvirt: Experiences with very large hosts

Running Linux-HA on a IBM System z

z/architecture Overview and z/vm 64-bit Support Internals

Run vsphere in a box on your laptop, to learn, demonstrate, and test vcenter, ESX4/ESXi4, VMotion, HA, and DRS.

zpcr Capacity Sizing Lab

High Availability for Linux on IBM System z Servers

Exploit Condition Handling in Language Environment

zpcr Capacity Sizing Lab

Finding your Way The z/vm Website, Documentation and Other Hints for the New User

Bruce Dailey IBM Performance Toolkit for VM Development

IBM System Storage IBM :

z/vm Live Guest Relocation - Planning and Use

TPF Debugger / Toolkit update PUT 12 contributions!

z/vm: The Value of zseries Virtualization Technology for Linux

High Availability and Scalability with System z and z/os

Behind the Glitz - Is Life Better on Another Database Platform?

Precision Time Protocol, and Sub-Microsecond Synchronization

z/vse 5.2 Tapeless Initial Installation

Josh Wisniewski Development Tools Subcommittee

Implementing a NTP-Based Time Service within a Distributed Middleware System

Linux on System z Performance Update - Part 2 Networking and Crypto

Lawson M3 7.1 Large User Scaling on System i

Licensed Program Specifications

System z: Checklist for Establishing Group Capacity Profiles

IBM Mainframe Life Cycle History

Linux for zseries and VSE

SAP NetWeaver Identity Management Identity Center Minimum System Requirements

Hardware Cryptography and z/tpf

Transcription:

Teaching Penguins to Tell Time Rob van der Heij IBM Netherlands rvdheij@nl.ibm.com L77 May 2004

Trademarks The following are trademarks of the International Business Machines Corporation in the United States and/or other countries. BookManager* DB2* DFSMS/MVS* DFSMS/VM* e-business logo* Enterprise Storage Server ESCON* FICON GDDM* IBM* IBM logo* Language Environment* Multiprise* MVS NetRexx OpenEdition* OpenExtensions OS/390* Parallel Sysplex* PR/SM QMF RACF* RAMAC* S/390* S/390 Parallel Enterprise Server VisualAge* VisualGen* VM/ESA* VSE/ESA VTAM* z/architecture z/os z/vm zseries The following are trademarks or registered trademarks of other companies. Lotus, Notes, and Domino are trademarks or registered trademarks of Lotus Development Corporation; LINUX is a registered trademark of Linus Torvalds; Penguin (Tux) compliments of Larry Ewing; Tivoli is a trademark of Tivoli Systems Inc.; Java and all Java-related trademarks and logos are trademarks of Sun Microsystems, Inc., in the United States and other countries; UNIX is a registered trademark of The Open Group in the United States and other countries; Microsoft, Windows and Windows NT are registered trademarks of Microsoft Corporation; SET and Secure Electronic Transaction are trademarks owned by SET Secure Electronic Transaction LLC. * All other products may be trademarks or registered trademarks of their respective companies. Notes: Performance is in Internal Throughput Rate (ITR) ratio based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput that any user will experience will vary depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve throughput improvements equivalent to the performance ratios stated here. IBM hardware products are manufactured from new parts, or new and serviceable used parts. Regardless, our warranty terms apply. All customer examples cited or described in this presentation are presented as illustrations of the manner in which some customers have used IBM products and the results they may have achieved. Actual environmental costs and performance characteristics will vary depending on individual customer configurations and conditions. This publication was produced in the United States. IBM may not offer the products, services or features discussed in this document in other countries, and the information may be subject to change without notice. Consult your local IBM business contact for information on the product or services available in your area. All statements regarding IBM's future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only. Information about non-ibm products is obtained from the manufacturers of those products or their published announcements. IBM has not tested those products and cannot confirm the performance, compatibility, or any other claims related to non-ibm products. Questions on the capabilities of non-ibm products should be addressed to the suppliers of those products. Prices subject to change without notice. Contact your IBM representative or Business Partner for the most current pricing in your geography. 2 L77 Teaching Penguins to Tell Time May 2004

Agenda Why do we care? Hardware Clocks Time zones and UTC Network Time Protocol NTP and Linux on z/vm 3 L77 Teaching Penguins to Tell Time May 2004

Why care about correct time? For isolated systems correct time is convenient Time stamps on files Reliable backup and restore Applications that can pick up system date and time 4 L77 Teaching Penguins to Tell Time May 2004

Why care about correct time? Distributed applications require the same time File sharing (e.g. edit and make on different systems) Security (e.g. Kerberos tokens) Convenient for debugging and tracking Most systems get the time from someone else No infinite accuracy possible Required quality of clock depends on application 5 L77 Teaching Penguins to Tell Time May 2004

Who has the correct time? Universal Time 1 (UT1) Computed from astronomical observations Speeds up and slows down with earth rotation International Atomic Time (TAI) Based on Cesium-133 radiation Coordinated Universal Time (UTC) Derived from TAI Adjusted to UT1 with occasional leap seconds 6 L77 Teaching Penguins to Tell Time May 2004

Daytime Protocol Public Internet Service Provided by several organizations (e.g. NIST) Documented in RFC 867 Query to UDP or TCP port 13 Format of response is different per server pipe tcpclient 192.43.244.18 13 linger 1 deblock linend 0a xlate a2e cons 53108 04-04-13 10:08:46 50 0 0 432.8 UTC(NIST) * Julian Day DST Network delay Clock Health (error < 5 s) Leap seconds 7 L77 Teaching Penguins to Tell Time May 2004

Time Zones 8 L77 Teaching Penguins to Tell Time May 2004

Time zones and UTC Linux system clock is in UTC Number of seconds since 1970 Local time computed from System Time GNU C Runtime Library routines Defined by zone info in /etc/localtime Offset to UTC Beginning and end of DST 9 L77 Teaching Penguins to Tell Time May 2004

Quality of Clocks System clock is at best approximation of UTC Delay, jitter, offset, drift High quality time keeping is expensive Trade-off between various type of error Quartz controlled clocks Typical frequency offset in the range of 10 s PPM 1 ppm ~ 30 s / yr Variation of several PPM due to temperature changes When not corrected, may add up to seconds per day 10 L77 Teaching Penguins to Tell Time May 2004

The Ideal Broken Clock Clock differs from true time Constant base offset Different frequency (skew) Drift due to aging True Time Offset + Skew + Drift Offset +Skew Jitter 11 L77 Teaching Penguins to Tell Time May 2004

PC Clock Real Time Clock with battery backup Keeps time while PC powered off Cheap and not very accurate (e.g. several seconds per day off) Low precision (one second) Not suitable for system timing 12 L77 Teaching Penguins to Tell Time May 2004

PC Clock Software Clock in Linux Initialized from the RTC during boot process Incremented by timer interrupts High resolution based on CPU clock frequency Exploits CPU cycle counter Can be adjusted through NTP Used to compensate RTC drift Be careful with adjusting RTC Error 0.06 0.05 0.04 0.03 0.02 0.01 0 Time 13 L77 Teaching Penguins to Tell Time May 2004

PC Clock Software Clock in Windows Initialized from RTC during boot Incremented by timer interrupts Corrected frequently using RTC RTC and Software Clock in local time rather than UTC Complications with DST Dual Boot PC Linux must be aware RTC is in local time 14 L77 Teaching Penguins to Tell Time May 2004

zseries Clock Hardware Time-of-Day (TOD) Clock Reasonable stable and high precision Very cheap to read (STCK instruction in SIE) Frequently set manually by Operator at IPL Not synchronized to official time Linux Software Clock Initially based on the TOD Clock Even with a stable clock wrong all day Attractive to synchronize with external source 15 L77 Teaching Penguins to Tell Time May 2004

Network Time Protocol Framework to synchronize clocks Defined in RFC 1305 (v3) and RFC 2030 (v4) Format allows for very high precision Formalizes quality of time reference Stratum: Number of hops to a primary reference Precision: Accuracy of the clock Implementations available for many platforms Many high quality public time servers 16 L77 Teaching Penguins to Tell Time May 2004

Network Time Protocol UDP Packet to port 123 Contains several timestamps to compute delays and error Timestamps in 32 + 32 bits (0.2 ns resolution) Allows client to compute the error Network delay is assumed to be symmetrical and constant Originate Client Network delay Server Receive Transmit Final 17 L77 Teaching Penguins to Tell Time May 2004

Network Time Protocol Using the timestamps Estimate the correct time Compute the maximum error A proper model for the delay Interpolate time for high precision Extrapolate for long term measurement Originate Client Network delay Server Receive Transmit True Time Offset + Skew + Drift Offset +Skew Final 18 L77 Teaching Penguins to Tell Time May 2004

NTP on Linux Provisions in the kernel to adjust time The ntpd daemon and additional binaries SuSE xntp package Red Hat ntp package Download from www.ntp.org Client configuration is trivial Single entry in /etc/ntpd.conf to list the time server Finding the right server is harder 19 L77 Teaching Penguins to Tell Time May 2004

Starting ntpd Special adaptation mode Runs for approximately 15 minutes Exchanges messages with server to adapt oscillator Clock is stepped to approach the obtained time An excessive time difference causes ntpd to panic Frequency in ntp.drift maintained Apr 4 12:32:07 box ntpd: ntpd startup succeeded Apr 4 12:32:07 box ntpd[712]: ntpd 4.1.1c-rc1@1.836 Thu Feb 13 12:17:19 EST 2003 (1) Apr 4 12:32:11 box ntpd[712]: precision = 9 usec Apr 4 12:32:11 box ntpd[712]: kernel time discipline status 0040 Apr 4 12:40:46 box ntpd[712]: time set 311.058971 s Apr 4 12:40:46 box ntpd[712]: synchronisation lost 20 L77 Teaching Penguins to Tell Time May 2004

Example of NTP setting the clock Initial frequency offset during adaptation mode Taken from drift measured during earlier runs Assumes clock is set by hwclock For Linux on zseries this does not hold SuSE boot.clock broken when hardware clock not set UTC cat /etc/sysconfig/clock # # Set to "-u" if your system clock is set to UTC, and to "--localtime" # if your clock runs that way. # HWCLOCK="-u" Time offset (s) System Time - TOD 0.030 0 0.025 0.020-0.5 0.015-1 0.010 0.005-1.5 0.000-2 22.1 22.2 22.3 22.4 22.5 Time (hrs) Time offset Drift Drift (ppm) 21 L77 Teaching Penguins to Tell Time May 2004

Running ntpdate Correct time only available after adaptation mode Not attractive for workstations May be confusing for other daemons started SuSE runs ntpdate once during startup Obtains an estimate for current time from one server Time difference probably small enough to avoid stepping Apr 14 10:12:18 linux390 ntpdate[9876]: step time server 9.61.40.85 offset 26.607496 sec Apr 14 10:12:18 linux390 ntpd[9879]: ntpd 4.1.1@1.786 Mon Sep 29 06:44:00 UTC 2003 (1) Apr 14 10:12:18 linux390 ntpd[9879]: precision = 22 usec Apr 14 10:12:18 linux390 ntpd[9879]: kernel time discipline status 0040 22 L77 Teaching Penguins to Tell Time May 2004

Running ntpdate Difference between Linux clock and TOD clock Initial clock stepping via ntpdate Can be disabled with XNTPD_INITIAL_NTPDATE setting in /etc/sysconfig/xntp Subsequent tuning of oscillator Synchronizing the clock with NTP Synchronizing the clock with NTP Difference (s) 30 25 20 15 10 5 0 8:11 9:11 10:11 11:11 Time Difference (s) 26.62 26.61 26.6 26.59 26.58 8:12 9:12 10:12 11:12 Time 23 L77 Teaching Penguins to Tell Time May 2004

Running ntpd Normal mode Continuous exchange of messages with servers Delays compared to compute frequency errors Message rate lowered over time to reduce network load linuxgw:~ # ntpq -p -n remote refid st t when poll reach delay offset jitter ============================================================================== 127.127.1.0 127.127.1.0 10 l 6 64 377 0.000 0.000 0.015 +9.61.40.85 9.61.37.158 2 u 12 1024 377 15.585 1.132 100.497 +9.1.24.204 9.41.0.213 2 u 17 1024 377 104.729 0.079 313.260 *9.41.0.213.GPS. 1 u 924 1024 377 57.036 0.898 0.185-9.154.60.2.hopf. 1 u 1002 1024 377 99.453 8.494 3.280 24 L77 Teaching Penguins to Tell Time May 2004

Example of NTP adjusting the clock Over time NTP will tweak frequency to get system clock close to observed true time You can not have it all Stable clock with little jitter Clock that follows true time System Time - TOD Time offset (s) 25.815 2 25.810 25.805 1 25.800 0 25.795 25.790-1 25.785-2 22 24 26 28 30 Time (hrs) Time offset Drift Drift (ppm) 25 L77 Teaching Penguins to Tell Time May 2004

Example of NTP adjusting the clock Jump in time appears to be consistent Most likely something in the network that changed delay Could be related to system load System clock vs NTP servers Time offset (s) 0.010 0.008 0.006 0.004 0.002 0.000-0.002 22 22.5 23 23.5 24 24.5 25 25.5 26-0.004-0.006-0.008-0.010 Time (hrs) 26 L77 Teaching Penguins to Tell Time May 2004

Synchronizing Linux with NTP NTP works for Linux on zseries too Keeps Linux clock close to other synchronized servers Running ntpd is not for free CPU cost for idle server may increase with 50% May increase memory footprint with 50% Will depend on the number of time servers polled Do your requirements justify the cost? Experiment on z990 Idle: 4.1 ms/min With ntpd 6.2 ms/min Experiment: Idle server 2270 pages With ntpd 3385 pages 27 L77 Teaching Penguins to Tell Time May 2004

So how close do we get? NTP keeps its own statistics The loopstats is only what NTP believes How do we know what is true? The zseries TOD wrong? Is this bad? NTP getting the time wrong? Time offset (s) NTP measuring the clock (PC) 0.004 19 0.002 0 18.5 0 4 8 12 16 20 24-0.002-0.004 18-0.006-0.008 17.5 Freq offset (ppm) Time (hrs) Time off Freq off Time offset (s) NTP measuring clock difference 0.004 Time off Freq off 0.002 0-0.002 5 7 9 11 13 15 17 19-0.004-0.006-0.008 Tiime (hrs) 2.5 2 1.5 1 0.5 0 Freq offset (ppm ) 28 L77 Teaching Penguins to Tell Time May 2004

So how close do we get? Sample of a 9672 TOD clock NTP adjusted system time versus hardware TOD clock Numbers as good as NTP can get Not representative for all CPUs Sample of unadjusted clock In this case TOD clock is 4 ms/hr too slow 100 ms / day ~ 1 ppm Offset (s) 26.72 26.71 26.7 26.69 26.68 26.67 26.66 26.65 0 5 10 15 20 25 Time (hrs) 29 L77 Teaching Penguins to Tell Time May 2004

Cheap way to set the clock Reduce cost by setting the clock once Compensates for inaccurate set VM clock Drift of zseries TOD clock probably seconds per month Run ntpdate once during boot process Standard code (use ntpd q rather than ntpdate) May need the g and x options for large adjustments It does not compensate for drift 30 L77 Teaching Penguins to Tell Time May 2004

Cheap way to set the clock Set the virtual machine TOD offset Can be done in PROFILE EXEC before boot Isolates Linux from the details of the hardware clock No adaptation phase needed, no sudden clock shift With SET VTOD the TOD clock offset can be set equal to the offset of another virtual machine Linux servers with identical clock Clock could be read completely in user space 31 L77 Teaching Penguins to Tell Time May 2004

Cheap way to set the clock Run ntpdate occasionally cron Not recommended by everyone It does not compensate for drift but jumps the clock May even step your clock back Doing so affects global time Simultaneous requests will overload the NTP servers Will be removed in the future Instead use ntpd q x Offset (s) Clock adjust with ntpdate 26.78 26.77 26.76 26.75 26.74 26.73 26.72 20 22 24 26 28 30 32 34 Time (hrs) 32 L77 Teaching Penguins to Tell Time May 2004

Using External Time Reference IBM 9037-2 Used to synchronized TOD clocks over multiple CECs in parallel sysplex Can also use external reference to synchronize the clock Dial-up to ACTS RF receiver providing timestamp and PPS signal z/vm has no explicit support for ETR but can benefit from a TOD clock kept exact 1000 Linux guests not running ntpd pays for a 9037-2 33 L77 Teaching Penguins to Tell Time May 2004

IBM 9037 Redbook ITSO Redbook SG24-2070 S/390 Time Management and IBM 9037 Sysplex Timer z/os configuration ETR configuration setup 34 L77 Teaching Penguins to Tell Time May 2004

Using External Time Reference Use either ETR or NTP 9037 is not very subtle NTP algorithms are not tuned for ETR clock steering Combining NTP with ETR results in poor quality Increased swings Correction overshoot No improved long term stability Time offset (s) 0.02 0.015 0.01 0.005 0-0.005-0.01-0.015 Combining NTP and ETR Time off Freq off 10 5 0-5 -10 0 5 10 15 20 25 30-15 35-20 -25-30 Time (hrs) Freq offset (ppm) 35 L77 Teaching Penguins to Tell Time May 2004

Using External Time Reference Another example of clock quality System time driven by NTP (with 15 time servers) zseries hardware TOD clock (steered by 9037) Stable drift: ~ -1 ppm Correction: ~ 10 ppm System Time - TOD (s) NTP on 9037 controlled system 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 0-0.05 20 40 60 80 100 120 140 160 180-0.1 Time (hrs) 36 L77 Teaching Penguins to Tell Time May 2004

Using External Time Reference Verified NTP measurements with 9037 status Jumps in the curve match the ETR dial-up times Difference reported by ETR matches the measurement very well 300 ms in 4 days ~ 1 ppm 37 L77 Teaching Penguins to Tell Time May 2004

Conclusion NTP with Linux on z/vm is no silver bullet Expensive to run, algorithms do not fit completely If you can afford some drift Set the clock once during boot with ntpd -q or SET VTOD When clock stepping back is acceptable Compensate drift by running ntpd q via cron When more accurate time is necessary Run ntpd as daemon to enable kernel time discipline Check the hwclock issues in the boot scripts Carefully select the time servers to use as reference 38 L77 Teaching Penguins to Tell Time May 2004