Solaristm Dtrace Introduction

Total Page:16

File Type:pdf, Size:1020Kb

Solaristm Dtrace Introduction SOLARISTM DTRACE INTRODUCTION Satyajit Tripathi ISV-Engineering, Sun Microsystems 1 Audience • Chief Executive Officer (CXO, CTO) • Software Developer • System Administrator • Support and Service Engineer • Rest Of The World 2 Agenda • Troubleshooting Scenarios • What is SolarisTM DTrace • DTrace Architecture and Framework • DTrace Components (Need-To-Know) • Additional Privileges for DTrace (How-To) • Useful Links and Resources • Exercises with DTrace (Touch 'n' Feel) • Open Forum 3 Troubleshooting Scenarios • Fatal, Reproducible and Test Case available > Traditional debugging techniques. Provide patch. • Fatal, Non Reproducible > Crash dump, Analyze Core. Use mdb(1), dbx(1) > Postmortem, Speculate Static Snapshot. Iterative process of providing Debug binary, studying log files etc. • Non Fatal, Transient Failure and Unacceptable QoS > Traditional techniques of using truss(1), mdb(1) > Challenges, when a dynamic problem detection requires Invasion, Embedding or Aggregation in production > Here, DTrace can be the Savior on Solaris10 or above 4 What Is SolarisTM DTrace • Dynamic tracing facility framework for Solaris10 • Unique in its focus on Production system, and its integration of User-level and Kernel-level tracing • Allows tracing of arbitrary data and arbitrary expression using the D Language • Overhead nearly 0% on System Performance • 50,000+ Probes available on a System by default • No re-compilation of application required • Safe, Powerful, Flexible, and Easy-to-Use • DTrace is Open Source under CDDL License 5 Dynamic Tracing (D Trace) • A Comprehensive Framework for SolarisTM Operating System Environment > To Implement New DTrace Providers > To Implement fully Configurable DTrace Probes > To Implement New DTrace Consumers and Data Display • Observability with DTrace > Aggregate arbitrary behavior of the OS and User programs > Dynamically Enable and Manage Probes > Dynamically Associate Predicates and Actions with Probes > Dynamically Manage Trace Buffers and Probe Overhead > Examine Live Production System or a Crash Dump 6 DTrace Architecture and Framework • Need To Know > D Language > DTrace Probes > DTrace Provider > Actions for Probes > DTrace Consumer Probes 7 D Language • 'D' Language is like 'C' and Constructs similar to awk • Based on Actions and Predicates • Access to Global, Thread local and Probe local variables • Rich built-in Variable set. Associative Arrays • Access to global Kernel variables and structures • Support for ANSI-C Operators and Data Aggregation • Example : Trace the pid of process “date” with syscall open(2) Probe Name #!/usr/sbin/dtrace -s o Entry point of open syscall::open:entry Predicate /execname == “date”/ o Process is named “date” { trace(pid); Action } o Print the process ID 8 DTrace Probe • Defined by point of Instrumentation within OS Kernel • Probe has a Name, Identifies the Function and Module it Instruments, Accessible through Provider • Four Attributes: Provider, Module, Function & Name, defines a tuple to uniquely identify a Probe probe description (provider:module:function:name) / predicate / { action statements } • Each Probe is Assigned an Integer Identifier • Example : Type command dtrace -l 9 DTrace Provider • A Methodology for Instrumenting Probes • Provider registers Probes in the system • Provider is informed by DTrace to Enable a Probe, and transfers the Control of the Probe to the DTrace • Verify Providers : dtrace -l | more ID PROVIDER MODULE FUNCTION NAME 1 dtrace BEGIN 2 dtrace END 3 dtrace ERROR ...Output truncated • Example of Providers : > syscall: Traces syscalls fbt : Traces in-kernel functions > pid : Traces application functions sched: Traces scheduling events > io : Traces system IO proc : Process/Thread creation, term, SIG 10 Actions for Probes • Actions can be taken when Probe is triggered • Actions are Programmable (Very useful feature) • Most Actions record a specified State of the system • Expressions in D Language are acceptable as Action Parameter(s) 11 DTrace Consumer • Process that interacts with DTrace, could be a Command line or a Script (script.d) • DTrace handles multiplexing, Supports concurrent Consumers • dtrace(1M) is DTrace Consumer • D Script Construction: Probe description, Predicate and Action Create Filename : myscript.d as below #!/usr/sbin/dtrace -s syscall::write:entry / execname == “bash”/ { printf(“bash with pid %d called write system call\n”,pid); } Run the myscript.d as below # dtrace -s myscript.d dtrace: script 'myscript.d' matched 1 probe 12 Additional Privileges for DTrace • All Privileges for superuser root and • Selective Privileges for non root user • Privilege Groups provide Selective Access > dtrace_user : Provider syscall and profile > dtrace_proc : Provider pid and usdt > dtrace_kernel: Provider fbt and Kernel data structures > proc_owner : *Probe others Process which has sub-set privilege(s) NOTE : You can observe only those processes for which you have the privilege, makes it Safe! 13 Privileges How-To • Temporary Privilege to a running Process with PID 2596 > Command ppriv -s A+dtrace_user 869 • Permanent Privilege to a User Account > Modify the file /etc/user_attr as jack::::defaultpriv=basic,dtrace_user > Command usermod -K defaultpriv=basic,dtrace_user jack • Verify assigned Privileges > Command ppriv $$ Output 869: bash flaGs = <none> E: all I: basic,dtrace_user P: all L: all 14 Useful Links and Resources • Solaris Dynamic Tracing Guide (docs.sun.com) • BigAdmin System Administration Portal : DTrace • SDN Member Access, How To USE DTRACE from a Solaris10 System (Excellent head start) • Advanced DTrace Tips, Tricks & Gotchas (Preso) • NetBeans or Sun Studio DTrace GUI Plugin (Refer) • DTrace Toolkit (Download) • Refer FAQ. Contact Sun PDS [email protected] • I've started blogging at http://blogs.sun.com/stripathi 15 Exercise 1: System Calls Advanced than Traditional Tools • Look for System Call Errors # dtrace -n 'syscall:::return /errno/ {trace(execname);trace(pid);trace(errno)}' 0 318 pollsys:return XorG 408 4 0 12 read:return Gnome-terminal 660 11 0 12 read:return XorG 408 11 0 12 read:return nautilus 650 11 ...Output truncated • Why not use truss > truss is much easier to use, and provides better information > truss will be Invasive for Production, and may not be suitable > truss only looks at one Process > DTrace looks at a System-wide Events 16 Exercise 2: Short-lived Malloc Download the Latest DTrace Toolkit • Watch for Short-lived Memory Allocations in the Application. Use ready scripts in DTraceToolkit-0.99.tar.gz # dtrace -s DTraceToolkit/Proc/shortlived.d -c firefox dtrace: script 'shortlived.d' matched 12 probes CPU ID FUNCTION:NAME 0 1 :BEGIN Tracing... Hit Ctrl-C to stop. ^C 1 2 :END short lived processes:0.052 secs total sample duration: 11.837 secs Total time by process name, firefox 0 ms run-mozilla.sh 1 ms pwd 2 ms awk 3 ms ls 3 ms dirname 8 ms basename 9 ms sed 13 ms Total time by PPID, 6417 0 ms 6419 0 ms [1]+ Done firefox ...Output truncated 17 Exercise 3: Who's Doing I/O Use Default DTrace Demo Scripts or Customize • To find out who is doing I/O on the System. Use the ready script /usr/demo/dtrace/whoio.d # dtrace -s whoio.d ^c DEVICE APP PID BYTES sd0 picld 168 1280 sd0 fsflush 3 3072 sd0 sched 0 295936 nfs2 sched 0 786432 sd0 soffice.bin 6070 2242048 18 Exercise 4: Syscalls by the Application Use Options -c or -p for PID Providers or $target Macro in Scripts • To find which Syscalls are made by the Application. Use the ready script /usr/demo/dtrace/syscall.d # dtrace -s syscall.d -c /usr/bin/ls dtrace: script 'syscall.d' matched 232 probes applicat.d howlong.d pri.d spec.d whoio.d badopen.d index.html printa.d specopen.d whopreempt.d dtrace: pid 1053 has exited fcntl 1 fsat 1 getpid 1 getrlimit 1 gtime 1 lstat64 1 rexit 1 stat 1 close 2 fstat64 2 getdents64 2 mmap 2 munmap 2 setcontext 2 ioctl 3 brk 6 write 21 19 Exercise 5: File system Workload Use Pragma options, Macros and Functions like C Programs • Review the script /usr/demo/dtrace/io.d # cat io.d #!/usr/sbin/dtrace -s #pragma D option quiet BEGIN { printf("%-10s %10s %10s %3s %s\n","Device", "Program","I/O Size","R/W","Path"); } io:::start { printf("%-10s %10s %10d %3s %s\n",args[1]->dev_statname,execname, args[0]->b_bcount, args[0]->b_flags & B_READ? "R" : "W" ,args[2]- >fi_pathname); @[execname, pid, args[2]->fi_pathname] = sum(args[0]->b_bcount); } END { printf("%-10s %8s %10s %s\n","Program", "PID", "Total", "Path"); printa("%-10s %8d %10@d %s\n",@); } 20 Exercise contd: File system Workload Dynamic Tracing and Monitoring • Use the ready script /usr/demo/dtrace/io.d # ./io.d On a different terminal Run mkfile 2m /demo/foo Device ProGram I/O Size R/W Path ramdisk0 mkfile 8192 R <none> ramdisk0 mkfile 8192 W /demo/foo ramdisk0 mkfile 8192 W /demo/foo ...Output truncated ^c ProGram PID Total Path mkfile 13262 8192 <none> fsflush 3 25088 <none> sched 0 33792 <none> mkfile 13262 2105344 /demo/foo 21 Exercise 6: Process Opening Files Command line to Enable Probes and Format Output(s) • Shows opened files by the Process name dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }' dtrace: description 'syscall::open*:entry ' matched 2 probes CPU ID FUNCTION:NAME 0 2596 open:entry df /var/ld/ld.confiG 0 2596 open:entry df /usr/lib/libcmd.so.1 0 2596 open:entry df /usr/lib/libc.so.1 0 2596 open:entry df /etc/mnttab ^c 22 Exercise 7: Disk Size by Process Using System Probe to Trace System I/O • To record Actual disk I/O Requests • Application may be doing a lot more I/O which may get absorbed by the File
Recommended publications
  • Oracle Berkeley DB Installation and Build Guide Release 18.1
    Oracle Berkeley DB Installation and Build Guide Release 18.1 Library Version 18.1.32 Legal Notice Copyright © 2002 - 2019 Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. Berkeley DB, and Sleepycat are trademarks or registered trademarks of Oracle. All rights to these marks are reserved. No third- party use is permitted without the express prior written consent of Oracle. Other names may be trademarks of their respective owners. If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs.
    [Show full text]
  • Oracle Solaris 11 Cheat Sheet Dtrace
    Oracle Solaris 11 Administrator's Cheat Sheet for DTrace Oracle Solaris 11 Cheat Sheet DTrace What is DTrace? DTrace Command Components Oracle Solaris DTrace is a comprehensive, advanced tracing tool for troubleshooting A typical DTrace command has several components: systematic problems in real time. Administrators, integrators and developers can use DTrace to dynamically and safely observe live production systems for performance issues, A 4-tuple identifier provider:module:function:name, where module is a kernel including both applications and the operating system itself. DTrace allows you to explore • module or application library, and function and name are the routines that are to be your system to understand how it works, track down problems across many layers of software, and locate the cause of any aberrant behavior. Whether it’s at a high level global instrumented. If any of these are left black, it is equivalent to a wildcard match. For overview like memory consumption or CPU time, to much finer grained information like what example, to fire all entry routines in the syscall provider we would use the following: specific function calls are being made, DTrace gives the operational insights that have long syscall:::entry been missing in the data center. • A predicate, or relational expression, that determines whether any action should be Understanding DTrace providers and probes taken. For example, to check whether the process name matches bash we would use the following: /execname == “bash”/ Oracle Solaris 11 is littered with many different points of instrumentation – places of interest • An action for what should happen if the probe fires and the predicate is satisfied.
    [Show full text]
  • Oracle® Solaris 11.4 Dtrace
    ® Oracle Solaris 11.4 DTrace (Dynamic Tracing) Guide Part No: E61035 November 2020 Oracle Solaris 11.4 DTrace (Dynamic Tracing) Guide Part No: E61035 Copyright © 2011, 2020, Oracle and/or its affiliates. License Restrictions Warranty/Consequential Damages Disclaimer This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. Warranty Disclaimer The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. Restricted Rights Notice If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable: U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software"
    [Show full text]
  • Solaris Dynamic Tracing Sun.Com/Software
    Solaris™ Dynamic Tracing Increasing Performance Through Complete Software Observability < Introducing Solaris™ Dynamic Tracing (DTrace) With the Solaris™ 10 Operating System (OS), Sun introduces Dynamic Tracing (DTrace): a dynamic tracing framework for troubleshooting systemic problems in real time on production systems. DTrace is designed to quickly identify the root cause of system performance problems. DTrace safely and dynamically instruments the running operating system kernel and running applications without rebooting the kernel and recompiling — or even restarting — appli- cations. And, when not explicitly enabled, DTrace has zero effect on the system. It is available on all supported Solaris OS platforms. Designed for use on production systems Provides single view of software stack DTrace is absolutely safe for use on production With DTrace, system administrators, integrators, systems. It has little impact when running, and developers can really see what the system and no impact on the system when not in use. is doing, as well as how the kernel and appli- Highlights Unlike other tools, it can be initiated dynami- cations interact with each other. It enables cally without rebooting the system, using users to formulate arbitrary questions and get • Designed for use on production special modes, restarting applications, or any concise answers, allowing them to find per- systems to find performance other changes to the kernel or applications. formance bottlenecks on development, pilot, bottlenecks and production systems. More generally, DTrace • Provides a single view of the DTrace provides accurate and concise informa- can be used to troubleshoot virtually any software stack — from kernel tion in real time. Questions are answered systemic problem — often finding problems to application, leading to rapid identification of performance immediately, eliminating the need to collect that have been plaguing a system for years.
    [Show full text]
  • The Rise & Development of Illumos
    Fork Yeah! The Rise & Development of illumos Bryan Cantrill VP, Engineering [email protected] @bcantrill WTF is illumos? • An open source descendant of OpenSolaris • ...which itself was a branch of Solaris Nevada • ...which was the name of the release after Solaris 10 • ...and was open but is now closed • ...and is itself a descendant of Solaris 2.x • ...but it can all be called “SunOS 5.x” • ...but not “SunOS 4.x” — thatʼs different • Letʼs start at (or rather, near) the beginning... SunOS: A peopleʼs history • In the early 1990s, after a painful transition to Solaris, much of the SunOS 4.x engineering talent had left • Problems compounded by the adoption of an immature SCM, the Network Software Environment (NSE) • The engineers revolted: Larry McVoy developed a much simpler variant of NSE called NSElite (ancestor to git) • Using NSElite (and later, TeamWare), Roger Faulkner, Tim Marsland, Joe Kowalski and Jeff Bonwick led a sufficiently parallelized development effort to produce Solaris 2.3, “the first version that worked” • ...but with Solaris 2.4, management took over day-to- day operations of the release, and quality slipped again Solaris 2.5: Do or die • Solaris 2.5 absolutely had to get it right — Sun had new hardware, the UltraSPARC-I, that depended on it • To assure quality, the engineers “took over,” with Bonwick installed as the gatekeeper • Bonwick granted authority to “rip it out if itʼs broken" — an early BDFL model, and a template for later generations of engineering leadership • Solaris 2.5 shipped on schedule and at quality
    [Show full text]
  • New Security Features in Solaris 10 and Dtrace Chandan B.N, Sun Microsystems Inc
    New Security Features in Solaris 10 and DTrace Chandan B.N, Sun Microsystems Inc. 17th Annual FIRST Conference; June 2005 A secure and robust operating system plays a key role in keeping a computing environment safe and secure. This paper illustrates how the new security features and improvements in the latest release of Solaris Operating Environment can help defend system integrity, enable secure computation with ease of deployment and manageability. There also an introduction to DTrace which is a powerful infrastructure to observer the behaviour of the system. The most significant developments in Solaris 10 are improved hardening and minimization, application of principle of least privileges, introduction of zones and a new cryptographic framework. Apart from these there are a number of minor additions and enhancements that help in improving the OS security. Solaris Privileges (Process Rights Management) The traditional UNIX privilege model associates all privileges with the effective uid 0 or root. A privileged process if compromised can be used to gain full access to the system. It is also not possible to extend an ordinary user's capabilities with a restricted set of privileges. Solaris 10 addresses these with the introduction of the principle of least privileges [Saltzer & Schroeder 1975] which says that a process should be given no more privilege than necessary to perform its job. Process Rights Management extends the Solaris process model with privilege sets. Each privilege set contains zero or more privileges. Each process has four privilege sets: The Effective set (E) is active privileges required to perform a privileged action; this is the set of privileges the kernel verifies its privilege checks against.
    [Show full text]
  • Dtrace-Ebook.Pdf
    The illumos Dynamic Tracing Guide The contents of this Documentation are subject to the Public Documentation License Version 1.01 (the “License”); you may only use this Documentation if you comply with the terms of this License. Further information about the License is available in AppendixA. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this document, and the publisher was aware of the trademark claim, the designations have been followed by the “™” or the “®” symbol, or printed with initial capital letters or in all capitals. This distribution may include materials developed by third parties. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark of The Open Group. illumos and the illumos logo are trademarks or registered trademarks of Garrett D’Amore. Sun, Sun Microsystems, StarOffice, Java, and Solaris are trademarks or registered trademarks of Oracle, Inc. or its subsidiaries in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTA- TIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright © 2008 Sun Microsystems, Inc.
    [Show full text]
  • Dtrace and Java: Understanding the Application and the Entire Stack Adam H
    DTrace and Java: Understanding the Application and the Entire Stack Adam H. Leventhal Solaris Kernel Development Sun Microsystems Jarod Jenson Aeysis, Inc. Session 5211 2005 JavaOneSM Conference | Session 5211 The State of Systemic Analysis ● Observability tools abound ● Utilities for observing I/O, networking, applications written in C, C++, Java, perl, etc. ● Application-centric tools extremely narrow in scope and not designed for use on production systems ● Tools with system-wide scope present a static view of system behavior – no way to dive deeper 2005 JavaOneSM Conference | Session 5211 | 2 Introducing DTrace ● DTrace is the dynamic tracing facility new in Solaris 10 ● Allows for dynamic instrumentation of the OS and applications (including Java applications) ● Available on stock systems – typical system has more than 30,000 probes ● Dynamically interpreted language allows for arbitrary actions and predicates 2005 JavaOneSM Conference | Session 5211 | 3 Introducing DTrace, cont. ● Designed explicitly for use on production systems ● Zero performance impact when not in use ● Completely safe – no way to cause panics, crashes, data corruption or pathological performance degradation ● Powerful data management primitives eliminate need for most postprocessing ● Unwanted data is pruned as close to the source as possible 2005 JavaOneSM Conference | Session 5211 | 4 Providers ● A provider allows for instrumentation of a particular area of the system ● Providers make probes available to the framework ● Providers transfer control to the DTrace
    [Show full text]
  • Modern Linux Tools for Oracle Troubleshooting
    Modern Linux Tools for Oracle Troubleshooting Luca Canali, CERN Zbigniew Baranowski, CERN UKOUG TECH14, Liverpool, December 2014 About Luca • Senior DBA and team lead at CERN IT • Joined CERN in 2005 • Working with Oracle RDBMS since 2000 • Passionate to learn and share knowledge, how to get most value from database technology • @LucaCanaliDB and http://cern.ch/canali 3 About CERN • CERN - European Laboratory for Particle Physics • Founded in 1954 by 12 countries for fundamental physics research in a post-war Europe • Today 21 member states + world-wide collaborations • About ~1000 MCHF yearly budget • 2’300 CERN personnel + 10’000 users from 110 countries LHC is the world’s largest particle accelerator • LHC = Large Hadron Collider • 27km ring of superconducting magnets • Currently undergoing upgrades, restart in 2015 From particle to article.. Click to edit Master title style How do you get from this to this This talk covers Linux tools for advanced tracing and Oracle investigations • Modern tools opening new roads: Perf, DTrace, Systemtap, … • Probes on the OS to understand system calls • Probes for the userspace to understand Oracle internals • This is a short exploration rather than a lesson • Focus on techniques that you can use today 8 Prerequisites • Not covered here are many of the common and most used tools and utilities • top • strace • vmstat • iostat, sar, collectl, dstat • use of the /proc filesystem (ex cat /proc/meminfo) • … 9 You can probably run userspace and dynamic tracing tools in Linux already • Available with RHEL/OEL
    [Show full text]
  • ZFS, Cache, and Flash Adam Leventhal Sun Microsystems
    ZFS, Cache, and Flash Adam Leventhal Sun Microsystems, Fishworks blogs.sun.com/ahl ZFS c. 2005 • Initial release of ZFS • Vision: enterprise grade storage from commodity components • Designed for manageability, scale, performance, etc. Performance c. 2005 • Enterprise storage – 15K RPM FC or SAS disks, NVRAM • ZFS – 7200 RPM SATA disks, no NVRAM • Result – Though designed for performance – Hampered by commodity components • Note: drives relied upon to deliver capacity, throughput, IOPS Storage Disruption: Flash • Flash memory – Non-volatile – fast for writes (300µs) – faster for reads (50µs) – 2001 (birth of ZFS) cost as much as DRAM – 2009 less than 10th the cost of DRAM • Still much more expensive than disk • Inappropriate as a general purpose replacement Hybrid Storage Pool • Use flash to complement the storage hierarchy (DRAM → disk) DRAM, 15K RPM Drives and SSD: Price and Performance 10000 1000 100 DRAM SSD 15K RPM 10 1 0.1 μsecs/Rea $/G • Forms a completely new tier for price/performance ZFS c. 2008 • New ZFS features to enable HSP • ZIL slogs: separate log devices – Props to Neil Perrin • L2ARC: second level cache – Props to Brendan Gregg • Both available in OpenSolaris today Ideal HSP Devices • ZIL slog devices – Very low-latency, high-IOPS for writes – 10GB capacity is plenty • L2ARC devices – Low-latency, high-IOPS for reads – High capacity (enough to cache the full working set) – Low $/GB SSDs 2008 • SSDs designed as drive replacements – e.g. for your laptop • Pretty good for ZIL slog, L2ARC • For example, Intel X25-E – 32GB,
    [Show full text]
  • Domas Mituzas, Sun Microsystems Me
    Deep-inspecting MySQL with DTrace Domas Mituzas, Sun Microsystems Me • MySQL Senior Support Engineer @ Sun • Doing performance engineering for Wikipedia, develop performance accounting tools • Don’t like waste DTrace • Lovely basic use (with tools and toolkits) • Advanced capabilities: • Debugger • Profiler • Tracer • Database :-) • Memory editor Basics • dtrace -p $(pidof mysqld) -s script.d • $target gets replaced by -p value • probe /predicate/ { action } Easy stuff • Profiler • profile-997 { a[ustack() = count() } • Simple sampler, useful output • Gives lots of stacks • Fails on MacOSX (DRM protection) • http://dammit.lt/tech/dtrace/callgraph Graph! Graph!!! • Function names • # of samples • % of total • Colors might help • Can be any DTrace aggregation Probes • Have very limited scripting abilities • Can be fired depending on environment or other probe actions • Can access and set thread local or global variables Data • Simple scalars are easy • Timestamps are in nanoseconds • Structures and strings have to be copied in (need definitions to do anything useful with structures) • Aggregations are trivial (but fast) plockstat • Provider, telling about pthread locks • Userland utility visualizing that data plockstat -V: plockstat$target:::mutex-spun • /self->mtxspin[arg0] && arg1 != 0/ { @mtx_spin[arg0, ustack()] = quantize(timestamp - self->mtxspin[arg0]); self->mtxspin[arg0] = 0; mtx_spin_found = 1; } • Doesn’t account for internal application- implemented locks (like scalability patches) pid provider • Ultimate deep inspection • Ability to access function arguments and CPU register values • Probes at function entry/return points or anywhere in between (hex offsets) MySQL!!! !! ! • Open source - and we are going to use that • Threaded - needs some more care • High performance - needs even more care • Has DTrace probes in newer versions, but one can avoid them Tracing, first steps • dtrace -F -n pid123:mysqld:*:*r* | c++filt ..
    [Show full text]
  • Build a Complete Highly-Available Oracle VM Architecture from Server to App Oracle VM, Oracle Linux, Ksplice, Oracle Clusterware and Mysql
    Build a Complete Highly-Available Oracle VM Architecture from Server to App Oracle VM, Oracle Linux, KSplice, Oracle Clusterware and MySQL BY: SIMON COTER CONTRIBUTORS: DOAN N G U Y E N , CHRISTOPHE PAULIAT, OLIVIER CANONGE, BRU NO BOTTREAU Disclaimer The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. NOTE: This revenue recognition disclaimer is required for any white paper that addresses functionality or products that are not yet generally available. Most white papers will NOT need this disclaimer. To determine whether your paper requires this disclaimer, read the revenue recognition policy. If you have further questions about your content and the disclaimer requirements, e-mail [email protected]. To remove both the disclaimer and the page that it appears on, first display hidden characters by clicking on the Paragraph icon on the Home toolbar. Notice that there is a section break displayed as a double-dotted line at the bottom of this page. It is a small, square icon that appears to the left of the Quick Style Gallery. Highlight all the text on this page and press the Delete key. Continue to press Delete until the page disappears and your cursor is on the Table of Contents page.
    [Show full text]