Making the Operation of Code More Transparent and Obvious with SystemTap

You can study source code and manually instrument functions as described in the “Use the dynamic tracing tools, Luke” blog article, but why not make it easier to find key points in the software by adding user-space markers to the application code? User-space markers have been available in Linux for quite some time (since 2009). The inactive user-space markers do not significantly slow down the code. Having them available allows you to get a more accurate picture of what the software is doing internally when unexpected issues occur. The diagnostic instrumentation can be more portable with the user-space markers, because the instrumentation does not need to rely on instrumenting particular function names or lines numbers in source code. The naming of the instrumentation points can also make clearer what event is associated with a particular instrumentation point.

For example, Ruby MRI on Red Hat Enterprise Linux 7 has a number of different instrumentation points made available as a SystemTap tapset. If SystemTap is installed on the system, as described by What is SystemTap and how to use it?, the installed Ruby MRI instrumentation points can be listed with the stap -L” command shown below. These events show the start and end of various operations in the Ruby runtime, such as the start and end of garbage collection (GC) marking and sweeping.

Continue reading “Making the Operation of Code More Transparent and Obvious with SystemTap”

Share

“Use the dynamic tracing tools, Luke”

A common refrain for tracking down issues on computer systems running open source software is “Use the source, Luke.” Reviewing the source code can be helpful in understanding how the code works, but the static view may not give you a complete picture of how things work (or are broken) in the code. The paths taken through code are heavily data dependent. Without knowledge about specific values at key locations in code, you can easily miss what is happening. Dynamic instrumentation tools, such as SystemTap, that trace and instrument the software can help provide a more complete understanding of what the code is actually doing

I have wanted to better understand how the Ruby interpreter works. This is an opportunity to use SystemTap to investigate Ruby MRI internals on Red Hat Enterprise Linux 7. The article What is SystemTap and how to use it? has more information about installing SystemTap. The x86_64 RHEL 7 machine has ruby-2.0.0648-33.el7_4.x86_64.rpm installed, so the matching debuginfo RPM is installed to provide SystemTap with information about function parameters and to provide me with human-readable source code. The debuginfo RPM is installed by running the following command as root:

Continue reading ““Use the dynamic tracing tools, Luke””

Share

Red Hat scripting languages for beta: adds Ruby 2.5, Perl 5.26; updates PHP 7.1.8

Twice a year, Red Hat distributes new versions of compiler toolsets, scripting languages, open source databases, and/or web tools, etc. so that application developers will have access to the latest, stable versions. These Red Hat supported offerings are packaged as Red Hat Software Collections (scripting languages, open source databases, web tools, etc.), Red Hat Developer Toolset (GCC), and the recently added compiler toolsets Clang/LLVM, Go, and Rust. All are yum installable, and are included in most Red Hat Enterprise Linux subscriptions and all Red Hat Enterprise Linux Developer Subscriptions. Most Red Hat Software Collections and Red Hat Developer Toolset components are also available as Linux container images for hybrid cloud development across Red Hat Enterprise Linux, Red Hat OpenShift Container Platform, etc.

Red Hat Software Collections 3.1 beta brings the following new/updated scripting languages:

Continue reading “Red Hat scripting languages for beta: adds Ruby 2.5, Perl 5.26; updates PHP 7.1.8”

Share

Towards The Ruby 3×3 Performance Goal

This blog post is about my work to improve CRuby performance by introducing new virtual machine instructions and a JIT. It is loosely based on my presentation at RubyKaigi 2017 in Hiroshima, Japan.

As many Ruby people know, the author of Ruby, Yukihiro Matsumoto (Matz), set up a very ambitious goal for performance of CRuby version 3. Version 3 should be 3 times faster than version 2.

Koichi Sasada did a great job improving the performance of CRuby version 2 by about 3 times over version 1, by introducing a byte code virtual machine (VM). So I guess it is symbolic to set up the same goal for CRuby version 3.

Continue reading “Towards The Ruby 3×3 Performance Goal”

Share

Towards Faster Ruby Hash Tables

Hash tables are an important part of dynamic programming languages. They are widely used because of their flexibility, and their performance is important for the overall performance of numerous programs. Ruby is not an exception. In brief, Ruby hash tables provide the following API:

  • insert an element with given key if it is not yet on the table or update the element value if it is on the table
  • delete an element with given key from the table
  • get the value of an element with given key if it is in the table
  • the shift operation (remove the earliest element inserted into the table)
  • traverse elements in their inclusion order, call a given function and depending on its return value, stop traversing or delete the current element and continue traversing
  • get the first N or all keys or values of elements in the table as an array
  • copy the table
  • clear the table

Continue reading “Towards Faster Ruby Hash Tables”

Share

Red Hat Software Collections 2.3 now beta

Today, Red Hat announced the beta availability of Red Hat Software Collections 2.3, Red Hat’s newest installment of open source web development tools, dynamic languages, and databases. Delivered on a separate lifecycle from Red Hat Enterprise Linux with a more frequent release cadence, Red Hat Software Collections bridges developer agility and production stability by helping to accelerate the creation of modern applications that can then be more confidently deployed into production.

New additions to Red Hat Software Collections 2.3 Beta include:

Continue reading “Red Hat Software Collections 2.3 now beta”

Share

Using API keys securely in your OpenShift microservices and applications

In the microservices landscape, the API provides an essential form of communication between components. To allow secure communication between microservices components, as well as third-party applications, it’s important to be able to consume API keys and other sensitive data in a manner that doesn’t place the data at risk. Secret objects are specifically designed to hold sensitive information, and OpenShift makes exposing this information to the applications that need it easy.

In this post, I’ll demonstrate securely consuming API keys in OpenShift Enterprise 3. We’ll deploy a Sinatra application that uses environment variables to interact with the Twitter API; create a Kubernetes Secret object to store the API keys; expose the secret to the application via environment variables; and then perform a rolling update of the environment variables across our pods.

Continue reading “Using API keys securely in your OpenShift microservices and applications”

Share

Are “Web Components” in the future for PatternFly?

Web development has become increasingly complicated in recent years.  The questions of which framework to use often can eat up much time at the start of a project.  I can’t remember the number of times people have asked me while working on a Knockout project if I’ve heard of Durandal, or when considering Angular 2 – what about React/Flux or Aurelia?

Patternfly is a community project that promotes design commonality and improved user experience. Its offerings include open source code, patterns, style guides and an active community that helps support it all. But, this complexity, choosing web frameworks, also affects PatternFly.  Our goal is “to build a UI framework for enterprise web applications”.  That requires that we remain outside of the discussion of which framework is best and provide a solid set of patterns and designs for developers to rely on.

How can you build a UI framework when there are so many choices and so many strong feelings about the different choices?  In my opinion, it’s important for developers to choose the framework that is best for the project and fits their skill set.  There isn’t one choice that works for everybody and it’s important that we support all developers that want the benefit of well-designed components that can be used in enterprise applications.

Continue reading “Are “Web Components” in the future for PatternFly?”

Share