METHODS AND SYSTEMS FOR INTELLIGENT SAMPLING OF NORMAL AND ERRONEOUS APPLICATION TRACES
Computer-implemented methods and systems described herein perform intelligent sampling of application traces generated by an application. Computer-implemented methods and systems determine different sampling rates based on frequency of occurrence of normal traces and erroneous traces of the application. The sampling rates for low frequency normal and erroneous traces are larger than the sampling rates for high frequency normal and erroneous traces. The relatively larger sampling rates for low frequency trace ensures that low frequency traces are sampled in sufficient numbers and are not passed over during sampling of the application traces. The sampled normal and erroneous traces are stored in a data storage device.
Latest VMware, Inc. Patents:
This application claims the benefit of U.S. Provisional Application No. 63/155,349, filed Mar. 3, 2021.
TECHNICAL FIELDThis disclosure is directed to automated methods and systems for intelligent sampling of application traces.
BACKGROUND
Electronic computing has evolved from primitive, vacuum-tube-based computer systems, initially developed during the 1940s, to modern electronic computing systems in which large numbers of multi-processor computer systems, such as server computers, work stations, and other individual computing systems are networked together with large-capacity data storage devices and other electronic devices to produce geographically distributed computing systems with hundreds of thousands, millions, or more components that provide enormous computational bandwidths and data-storage capacities. These large, distributed computing systems include data centers and are made possible by advances in computer networking, distributed operating systems and applications, data-storage appliances, computer hardware, and software technologies. *The number and size of data centers have continued to grow to meet the increasing demand for information technology (“IT”) services, such as running applications for organizations that provide business services, web services, and other cloud services to millions of customers each day.
Management tools have been developed to collect traces of applications and aid system administrators and application owners with detecting performance problems with applications executed in distributed computing systems. An application trace, or simply a “trace,” is a representation of a workflow executed by an application, such as the workflow of application components of a distributed application. Application owners analyze application traces to detect performance problems with their applications. For example, a distributed application may have multiple application components executed in VMs or containers on one or more hosts of a data center. The application traces are stored and used by administrators and application developers to troubleshoot performance problems and perform root cause analysis.
Storage of application traces for a plurality of applications executing in a distributed computing environment over time creates an increasing demand for available data storage space. For example, a typical distributed application that serves hundreds of thousands of clients each day generates hundreds of thousands of corresponding application traces that are stored in data storage devices each day. For application owners, storing an enormous number of application traces increases the costs of operation. In addition, application traces that reveal performance problems associated with execution of an application, called erroneous traces, often occur with far lower frequencies than normal application traces that indicate normal execution of an application. As a result, system administrators and application developers sift through millions of application traces to identify the small number of erroneous traces, which is expensive and time consuming. Typical management tools employ sampling procedures that sample and store a fraction of the application traces in an effort to reduce the storage space occupied by applications traces and reduce the amount of time and cost associated with identifying erroneous traces. However, these sampling procedures fail to distinguish between the different types of traces. As a result, infrequently generated erroneous traces are often missed during sampling, which makes troubleshooting a performance problem a more challenging task. One approach is to store all erroneous traces. However, in certain situations the number of erroneous traces far exceeds the number of normal application traces, which eventually leads to the same problem of not having enough storage space available for normal and erroneous traces. Application owners and system administrators seek computer-implemented methods and systems that, in general, reduce the number of stored application traces, do not under sample or miss low frequency erroneous traces, and reduce the number of stored erroneous traces when erroneous traces outnumber normal application traces.
SUMMARYComputer-implemented methods and systems described herein perform intelligent sampling of normal and erroneous traces of an application. A set of trace data associated with the application is from a data storage device. The trace data may be stored in a trace database or temporarily stored in a buffer. Computer-implemented methods and systems determine sampling rates for sampling normal traces in the set and for sampling erroneous traces in the set. The different sampling rates are inversely proportional to the frequency of occurrence of the normal traces and erroneous traces. The sampling rates are used to obtain sampled normal traces and sampled erroneous traces. The sampling rates ensure that less frequently occurring normal traces are sampled at higher sampling rates than more frequently occurring normal traces and that less frequently occurring erroneous traces are sampled at higher sampling rates than more frequently occurring erroneous traces. The sampled traces are stored in a data storage device.
This disclosure presents computer-implemented methods and systems that intelligently sample application traces generated by applications running in a distributed computing system. In the first subsection, computer hardware, complex computational systems, and virtualization are described. Computer-implemented methods and systems for intelligent sampling of normal and erroneous application traces are described below in the second subsection.
Computer Hardware, Complex Computational Systems, and VirtualizationThe term “abstraction” as used to describe virtualization below is not intended to mean or suggest an abstract idea or concept. Computational abstractions are tangible, physical interfaces that are implemented, ultimately, using physical computer hardware, data storage devices, and communications systems. Instead, the term “abstraction” refers, in the current discussion, to a logical level of functionality encapsulated within one or more concrete, tangible, physically-implemented computer systems with defined interfaces through which electronically-encoded data is exchanged, process execution launched, and electronic services are provided. Interfaces may include graphical and textual data displayed on physical display devices as well as computer programs and routines that control physical computer processors to carry out various tasks and operations and that are invoked through electronically implemented application programming interfaces (“APIs”) and other electronically implemented interfaces.
Of course, there are many different types of computer-system architectures that differ from one another in the number of different memories, including different types of hierarchical cache memories, the number of processors and the connectivity of the processors with other system components, the number of internal communications busses and serial links, and in many other ways. However, computer systems generally execute stored programs by fetching instructions from memory and executing the instructions in one or more processors. Computer systems include general-purpose computer systems, such as personal computers (“PCs”), various types of server computers and workstations, and higher-end mainframe computers, but may also include a plethora of various types of special-purpose computing devices, including data-storage systems, communications routers, network nodes, tablet computers, and mobile telephones.
Until recently, computational services were generally provided by computer systems and data centers purchased, configured, managed, and maintained by service-provider organizations. For example, an e-commerce retailer generally purchased, configured, managed, and maintained a data center including numerous web server computers, back-end computer systems, and data-storage systems for serving web pages to remote customers, receiving orders through the web-page interface, processing the orders, tracking completed orders, and other myriad different tasks associated with an e-commerce enterprise.
Cloud-computing facilities are intended to provide computational bandwidth and data-storage services much as utility companies provide electrical power and water to consumers. Cloud computing provides enormous advantages to small organizations without the devices to purchase, manage, and maintain in-house data centers. Such organizations can dynamically add and delete virtual computer systems from their virtual data centers within public clouds in order to track computational-bandwidth and data-storage needs, rather than purchasing sufficient computer stems within a physical data center to handle peak computational-bandwidth and data-storage demands. Moreover, small organizations can completely avoid the overhead of maintaining and managing physical computer systems, including hiring and periodically retraining information-technology specialists and continuously paying for operating-system and database-management-system upgrades. Furthermore, cloud-computing interfaces allow for easy and straightforward configuration of virtual computing facilities, flexibility in the types of applications and operating systems that can be configured, and other functionalities that are useful even for owners and administrators of private cloud-computing facilities used by a single organization.
While the execution environments provided by operating systems have proved to be an enormously successful level of abstraction within computer systems, the operating-system-provided level of abstraction is nonetheless associated with difficulties and challenges for developers and users of application programs and other higher-level computational entities. One difficulty arises from the fact that there are many different operating systems that run within various different types of computer hardware. In many cases, popular application programs and computational systems are developed to run on only a subset of the available operating systems and can therefore be executed within only a subset of the different types of computer systems on which the operating systems are designed to run. Often, even when an application program or other computational system is ported to additional operating systems, the application program or other computational system can nonetheless run more efficiently on the operating systems for which the application program or other computational system was originally targeted. Another difficulty arises from the increasingly distributed nature of computer systems. Although distributed operating systems are the subject of considerable research and development efforts, many of the popular operating systems are designed primarily for execution on a single computer system. In many cases, it is difficult to move application programs, in real time, between the different computer systems of a distributed computer system for high-availability, fault-tolerance, and load-balancing purposes. The problems are even greater in heterogeneous distributed computer systems which include different types of hardware and devices running different types of operating systems. Operating systems continue to evolve, as a result of which certain older application programs and other computational entities may be incompatible with more recent versions of operating systems for which they are targeted, creating compatibility issues that are particularly difficult to manage in large distributed systems.
For all of these reasons, a higher level of abstraction, referred to as the “virtual machine,” (“VM”) has been developed and evolved to further abstract computer hardware in order to address many difficulties and challenges associated with traditional computing systems, including the compatibility issues discussed above.
The virtualization layer 504 includes a virtual-machine-monitor module 518 (“VMM”) that virtualizes physical processors in the hardware layer to create virtual processors on which each of the VMs executes. For execution efficiency, the virtualization layer attempts to allow VMs to directly execute non-privileged instructions and to directly access non-privileged registers and memory. However, when the guest operating system within a VM accesses virtual privileged instructions, virtual privileged registers, and virtual privileged memory through the virtualization layer 504, the accesses result in execution of virtualization-layer code to simulate or emulate the privileged devices. The virtualization layer additionally includes a kernel module 520 that manages memory, communications, and data-storage machine devices on behalf of executing VMs (“VM kernel”). The VM kernel, for example, maintains shadow page tables on each VM so that hardware-level virtual-memory facilities can be used to process memory accesses. The VM kernel additionally includes routines that implement virtual communications and data storage devices as well as device drivers that directly control the operation of underlying hardware communications and data storage devices. Similarly, the VM kernel virtualizes various other types of I/O devices, including keyboards, optical-disk drives, and other such devices. The virtualization layer 504 essentially schedules execution of VMs much like an operating system schedules execution of application programs, so that the VMs each execute within a complete and fully functional virtual hardware layer.
In
It should be noted that virtual hardware layers, virtualization layers, and guest operating systems are all physical entities that are implemented by computer instructions stored in physical data storage devices, including electronic memories, mass-storage devices, optical disks, magnetic disks, and other such devices. The term “virtual” does not, in any way, imply that virtual hardware layers, virtualization layers, and guest operating systems are abstract or intangible. Virtual hardware layers, virtualization layers, and guest operating systems execute on physical processors of physical computer systems and control operation of the physical computer systems, including operations that alter the physical states of physical devices, including electronic memories and mass-storage devices. They are as physical and tangible as any other component of a computer since, such as power supplies, controllers, processors, busses, and data storage devices.
A VM or virtual application, described below, is encapsulated within a data package for transmission, distribution, and loading into a virtual-execution environment. One public standard for virtual-machine encapsulation is referred to as the “open virtualization format” (“OVF”). The OVF standard specifies a format for digitally encoding a VM within one or more data files.
The advent of VMs and virtual environments has alleviated many of the difficulties and challenges associated with traditional general-purpose computing. Machine and operating-system dependencies can be significantly reduced or eliminated by packaging applications and operating systems together as VMs and virtual appliances that execute within virtual environments provided by virtualization layers running on many different types of computer hardware. A next level of abstraction, referred to as virtual data centers or virtual infrastructure, provide a data-center interface to virtual data centers computationally constructed within physical data centers.
The virtual-data-center management interface allows provisioning and launching of VMs with respect to device pools, virtual data stores, and virtual networks, so that virtual-data-center administrators need not be concerned with the identities of physical-data-center components used to execute particular VMs. Furthermore, the virtual-data-center management server computer 706 includes functionality to migrate running VMs from one server computer to another in order to optimally or near optimally manage device allocation, provides fault tolerance, and high availability by migrating VMs to most effectively utilize underlying physical hardware devices, to replace VMs disabled by physical hardware problems and failures, and to ensure that multiple VMs supporting a high-availability virtual appliance are executing on multiple physical computer systems so that the services provided by the virtual appliance are continuously accessible, even when one of the multiple virtual appliances becomes compute bound, data-access bound, suspends execution, or fails. Thus, the virtual data center layer of abstraction provides a virtual-data-center abstraction of physical data centers to simplify provisioning, launching, and maintenance of VMs and virtual appliances as well as to provide high-level, distributed functionalities that involve pooling the devices of individual server computers and migrating VMs among server computers to achieve load balancing, fault tolerance, and high availability.
The distributed services 814 include a distributed-device scheduler that assigns VMs to execute within particular physical server computers and that migrates VMs in order to most effectively make use of computational bandwidths, data-storage capacities, and network capacities of the physical data center. The distributed services 814 further include a high-availability service that replicates and migrates VMs in order to ensure that VMs continue to execute despite problems and failures experienced by physical hardware components. The distributed services 814 also include a live-virtual-machine migration service that temporarily halts execution of a VM, encapsulates the VM in an OVF package, transmits the OVF package to a different physical server computer, and restarts the VM on the different physical server computer from a virtual-machine state recorded when execution of the VM was halted. The distributed services 814 also include a distributed backup service that provides centralized virtual-machine backup and restore.
The core services 816 provided by the VDC management server VM 810 include host configuration, virtual-machine configuration, virtual-machine provisioning, generation of virtual-data-center alerts and events, ongoing event logging and statistics collection, a task scheduler, and a device-management module. Each physical server computers 820-822 also includes a host-agent VM 828-830 through which the virtualization layer can be accessed via a virtual-infrastructure application programming interface (“API”). This interface allows a remote administrator or user to manage an individual server computer through the infrastructure API. The virtual-data-center agents 824-826 access virtualization-layer server information through the host agents. The virtual-data-center agents are primarily responsible for offloading certain of the virtual-data-center management-server functions specific to a particular physical server to that physical server computer. The virtual-data-center agents relay and enforce device allocations made by the VDC management server VM 810, relay virtual-machine provisioning and configuration-change commands to host agents, monitor and collect performance statistics, alerts, and events communicated to the virtual-data-center agents by the local host agents through the interface API, and to carry out other, similar virtual-data-management tasks.
The virtual-data-center abstraction provides a convenient and efficient level of abstraction for exposing the computational devices of a cloud-computing facility to cloud-computing-infrastructure users. A cloud-director management server exposes virtual devices of a cloud-computing facility to cloud-computing-infrastructure users. In addition, the cloud director introduces a multi-tenancy layer of abstraction, which partitions VDCs into tenant-associated VDCs that can each be allocated to an individual tenant or tenant organization, both referred to as a “tenant.” A given tenant can be provided one or more tenant-associated VDCs by a cloud director managing the multi-tenancy layer of abstraction within a cloud-computing facility. The cloud services interface (308 in
Considering
As mentioned above, while the virtual-machine-based virtualization layers, described in the previous subsection, have received widespread adoption and use in a variety of different environments, from personal computers to enormous, distributed computing systems, traditional virtualization technologies are associated with computational overheads. While these computational overheads have steadily decreased, over the years, and often represent ten percent or less of the total computational bandwidth consumed by an application running above a guest operating system in a virtualized environment, traditional virtualization technologies nonetheless involve computational costs in return for the power and flexibility that they provide.
While a traditional virtualization layer can simulate the hardware interface expected by any of many different operating systems, OSL virtualization essentially provides a secure partition of the execution environment provided by a particular operating system. As one example, OSL virtualization provides a file system to each container, but the file system provided to the container is essentially a view of a partition of the general file system provided by the underlying operating system of the host. In essence, OSL virtualization uses operating-system features, such as namespace isolation, to isolate each container from the other containers running on the same host. In other words, namespace isolation ensures that each application is executed within the execution environment provided by a container to be isolated from applications executing within the execution environments provided by the other containers. A container cannot access files that are not included in the container's namespace and cannot interact with applications running in other containers. As a result, a container can be booted up much faster than a VM, because the container uses operating-system-kernel features that are already available and functioning within the host. Furthermore, the containers share computational bandwidth, memory, network bandwidth, and other computational resources provided by the operating system, without the overhead associated with computational resources allocated to VMs and virtualization layers. Again, however, OSL virtualization does not provide many desirable features of traditional virtualization. As mentioned above, OSL virtualization does not provide a way to run different types of operating systems for different groups of containers within the same host and OSL-virtualization does not provide for live migration of containers between hosts, high-availability functionality, distributed resource scheduling, and other computational functionality provided by traditional virtualization technologies.
Note that, although only a single guest operating system and OSL virtualization layer are shown in
Running containers above a guest operating system within a VM provides advantages of traditional virtualization in addition to the advantages of OSL virtualization. Containers can be quickly booted in order to provide additional execution environments and associated resources for additional application instances. The resources available to the guest operating system are efficiently partitioned among the containers provided by the OSL-virtualization layer 1204 in
Computer-Implemented Methods and Systems for Performing Intelligent Sampling of Normal and Erroneous Application Traces
A distributed application comprises multiple VMs or containers that run application components simultaneously on one or more host server computers of a distributed computing system. The components are typically executed separately in the VMs or containers. The server computers are networked together so that information processing performed by the distributed application is distributed over the server computers, allowing the VMs or containers to exchange data. The distributed application can be scaled to satisfy changing demands by increasing or decreasing the number of VMs or containers. As a result, a typical distributed application can process multiple requests from multiple clients at the same time.
The virtualization layer 1302 includes virtual objects, such as VMs, applications, and containers, hosted by the computers in the physical data center 1304. The virtualization layer 1302 also includes a virtual network (not illustrated) comprising virtual switches, virtual routers, load balancers, and virtual NICs. Certain computers host VMs and containers as described above. For example, computer 1318 hosts two containers identified as Cont1 and Cont2; cluster of computers 1313 and 1314 host five VMs identified as VM1, VM2, VM3, VM4, and VM5; computer 1324 hosts four VMs identified as VM7, VM8, VM9, VM10. Other computers may host applications as described above with reference to
In
Application tracing tracks an application's flow and data progression with the results for each execution of the application presented in a separate application trace. An application trace, also called a “trace,” represents a workflow executed by an application or a distributed application. A trace represents how a request, such as a user or client request, propagates through components of a distributed application or through services provided by each component of a distributed application. A trace consists of one or more spans. Each span represents an amount of time spent executing a service or performance of a function of the application. Application traces may be used in troubleshooting to identify interesting patterns or performance problems with the application itself, the resources used to execute the application, and the network.
Traces are classified according to trace type which is given by the span of the first service, operation, or function performed by an application. The first span is called the “root span” which is used as the trace type and is denoted by TT. For example, the span 1410 of the trace shown in
Modern distributed applications generate enormous numbers of traces each day. For example, a shopping website may be accessed and used hundreds of thousands of times each day, resulting in storage of hundreds of thousands of corresponding traces in a data storage device. Many of the traces may be nearly identical and correspond to nearly identical operations performed by an application. Traces that correspond to normal operations performed by an application are identified as normal traces. On the other hand, erroneous traces that are used to troubleshoot performance of the application and identify a root cause a problem with the application are often produced with a much lower frequency than other normal traces.
Application traces may be assigned status codes that indicate whether execution of a particular operation or response to a client request by a corresponding application is a success or a failure. In one implementation, erroneous traces may be identified by corresponding HTTP (“hyper-text transfer protocol”) status codes. For example, HTTP is a protocol used to transfer data over the World Wide Web, HTTP is part of an Internet protocol suite that defines commands and services used for transmitting webpage data. In one implementation, traces are assigned, or tagged with, HTTP status codes that indicate the status of a specific HTTP requests associated with execution of an application. In particular, traces tagged with HTTP error status codes 4XX (i.e., request contains bad syntax or cannot be fulfilled) and server error status codes 5XX (i.e., the server failed to fulfil an apparently valid request), where X represents a positive integer, are erroneous traces. For example, when data has been successfully transmitted by the application, or application components, to a client or vis-a-vis, the corresponding trace may be tagged with the HTTP status code 200, indicating a success and the trace is identified as a normal trace. On the other hand, when data has not been successfully transmitted between the application and a client or between application components, the corresponding trace is an erroneous trace that is tagged with the HTTP status code 400, indicating a failed or bad request.
In another implementation, when hardware and/or network used by an application experiences particular failures, user-defined status codes may be used to tag corresponding traces as erroneous traces. For example, if CPU usage or memory usage spikes or drops below a threshold while an application is executing a corresponding trace may be tagged as erroneous. In another example, when data packets are dropped by one or more VMs executing application components of an application, a corresponding trace may be tagged as an erroneous trace.
In another implementation, user-defined status codes may be used to tag spans of traces. An erroneous trace contains one or more spans that have been tagged with an error. For example, spans 1506 and 1508 in
Erroneous traces of an application tend to have shorter or longer durations than the typical trace duration. For example, during typical execution of an application a corresponding trace has duration, D, that falls between lower and upper limits denoted by Dl<D<Du, where Dl is a lower time limit and Du is an upper time limit. When D≤Dl or Du<D, performance of the application is abnormal, and the corresponding trace is identified as an erroneous trace. The upper and lower time limits may be the upper and lower thresholds of a histogram constructed as described below with reference to Equations (6a) and (6b) under histogram creation.
In recent years, application management tools have been developed to apply different sampling procedures that reduce the amount of storage dedicated to storing traces. The sampling procedures include rate-based sampling and duration-based sampling. Rate-based sampling, also called “probabilistic sampling,” stores a fixed percentage of the generated traces. Duration-based sampling stores traces with durations that are greater than a predefined threshold. However, these conventional sampling procedures fail to distinguish the different trace types and durations during sampling which leads to information distortion. Information distortion occurs when infrequently occurring traces are not included in the sampled traces. For example, conventional trace sampling procedures fail to consider the frequencies of different trace types and trace durations. Erroneous traces are often infrequently generated and contain information that is useful in troubleshooting a performance problem with an application. Because conventional sampling procedures do not make a distinction between that is useful in troubleshooting a performance problem with an application. Because conventional sampling procedures do not make a distinction between high and low frequency generated trace types and trace durations, there is a risk that sampled traces obtained using conventional sampling procedures will not contain any, or not contain a sufficient representation, of erroneous traces, resulting in a loss of potentially important information needed in troubleshooting performance of an application. As a result, troubleshooting performance problems without a sufficient representation of erroneous traces leads to inaccurate representation of a performance problem and misleads troubleshooting algorithms and system administrators in detecting the root cause of the performance problem. One approach is to use error-based sampling, which stores only erroneous traces. However, in certain situations the number of erroneous traces far exceeds the number of normal application traces, which eventually leads to the same problem of not having enough storage space available for normal and erroneous traces.
Computer-implemented methods and systems described below perform intelligent sampling of normal and erroneous traces. The traces are generated for an application. The sampling and compression described below may be performed in real time on a stream of traces or performed on traces read from a trace database. Computer-implemented intelligent sampling described below stores enough normal and erroneous traces across the different trace types and different durations regardless of frequency to enable accurate troubleshooting of performance problems without information distortion created by conventional sampling procedures. In particular, computer-implemented intelligent sampling methods and systems described below generate different sampling rates for normal and erroneous traces. The sampling rates for low frequency normal and erroneous traces are larger than the sampling rates for higher frequency normal and erroneous traces. The sampling rates ensure that low frequency normal and erroneous traces are sampled with a larger sampling rate than high frequency normal and erroneous traces. Troubleshooting and root cause analysis is applied to the sampled erroneous traces to identify the source of performance problems with the application and the application components. Computer-implemented methods and systems may then employ remedial measures to correct the performance problems. For example, VMs or containers executing application components may be migrated to different hosts to increase performance. Additional VM or containers may be started to alleviate the workloads on already existing VMs and containers. Network bandwidth may be increased to reduce latency between peer VMs.
Computer-implemented methods and systems for intelligent sampling of application traces described below are encoded in machine-readable instructions that are executed in a computer system, such as a server computer.
Computer-implemented methods described below perform three different processes for sampling normal and erroneous traces with known trace types and durations. One process performs trace-type sampling of normal and erroneous traces based on frequencies of trace types. A second process performs sampling of erroneous and normal traces based on durations of traces independent of the trace type. A third process performs a hybrid trace-type and duration sampling of normal and erroneous traces. Each process is described separately below,
Trace-Type Sampling of Known Trace Types with Normal and Erroneous TracesThe traces recorded in a set of trace data are sorted into groups of traces with the same trace type independent of trace durations and status code. The number of traces in each group of traces are counted. The traces of each trace type are partitioned into normal traces and erroneous traces. For each trace type, a normal trace-type sampling rate is determined for the normal traces and an erroneous trace-type sampling rate is determined for the erroneous traces. Suppose a set of trace data contains N traces with M different trace types (i.e., M≤N). Let Nm be the number of traces with the m-th trace type, where index m=1, . . . , M. Let Nn(m) be the number of normal traces in the group of m-th trace types and Ne(m) be the number of erroneous traces in the group of m-th trace types, where Nm=Ne(m)+Nn(m). A frequency of occurrence of normal traces of the m-th trace type is
and frequency of occurrence of erroneous traces in the m-th trace type is
The normal trace-type sampling rate of each of the normal traces of the m-th trace type is
hn(m)=1−(pn(m))β
where 0≤βn and is called the “normal trace-type sampling parameter.”
and the erroneous trace-type sampling rate of each of the erroneous traces of the m-th trace type is
he(m)=1−(pn(m))β
where 0≤βe is called the “erroneous trace-type sampling parameter.”
The normal trace-type sampling rate is the inverse of the frequency of occurrence of normal traces with the m-th trace type. Similarly, the erroneous trace-type sampling rate is the inverse of the frequency of occurrence of erroneous traces with the m-th trace type. Each trace type has associated sampling rates represented by Equation (2a) or (2b). The normal trace-type sampling rate in Equation (2a) is the fraction of normal traces that belong to the m-th trace type and are sampled and stored in a data storage device. The erroneous trace-type sampling rate in Equation (2b ) is the fraction of erroneous traces that belong to the m-th trace type and are sampled and stored in a data storage device.
Returning to
The trace-type sampling parameters βn and βe corresponds to the amount of normal and erroneous traces sampled and are based on user-selected sampling rates described below. Note that in one implementation βn≠βe and in another implementation βn=βe. For example,“conservative” sampling corresponds to β=1, “aggressive” sampling corresponds to β=0.5, and “super aggressive” sampling corresponds to =0,25, where β represents βn and βe. The trace-type sampling parameters βn and βe are determined based the user-selected sampling rate as described below.
The number of normal traces of the m-th trace type stored in the data storage device is given by:
The number of erroneous traces of the m-th trace type stored in the data storage device is given by
The number of traces
The trace-type sampling rates represented by Equations (2a) and (2b) ensures that rarely occurring normal and erroneous trace types are sampled at a higher sampling rates than are more frequently occurring normal and erroneous trace types. Suppose the m-th trace type contains 1,000 traces (i.e., Nm=1,000) with 145 erroneous traces (i.e., Ne(m)=145) and 855 normal traces (i.e., Nn(m)=855). The frequency of occurrence of the erroneous traces of trace type TTm is pe=0.145 and the frequency of occurrence of the normal traces of trace type TTm is pm=0.655. The following table shows the normal and erroneous trace-type sampling rates using the same value for the sampling parameter (i.e., β=βe=βn):
The entries in the above table show that as the sampling parameter decreases, the sampling rates also decrease. Note also that the less frequently occurring erroneous traces are sampled with larger sampling rates than the more frequently occurring normal traces across the conservative, aggressive, and super aggressive sampling rates.
In an alternative implementation, the erroneous trace types may be further partitioned based on the types of status codes, such as HTTP error status codes or user-define error status codes described above. A frequency of occurrence of erroneous traces in the m-th trace type is
where
-
- subscript u denotes a particular error status code:
- u=1, . . . , U; and
- U the total number of error status codes.
For example, error status code u may represent one of the HTTP error status codes 4XX and 5XX or a user-defined error status code. The erroneous trace-type sampling rate of the error status code u is given by
he,u(m)=1−(pe,u(m))β
The number of erroneous traces of the m-th trace type with error status code u that are sampled and stored in the data storage device is given by
The sampling rate represented by Equation (4b) ensures that rarely occurring erroneous traces are sampled at a higher sampling rates than are more frequently occurring erroneous traces.
For each trace type, the normal and erroneous traces have separate compression ratios and compression rates. A modified Gini index for the fraction of normal traces sampled from the set of trace data across the M different trace types:
The compression rate across normal traces with different trace types is given by
Cn(β)=1−Gn(β) (5a)
A modified Gini index for the fraction of erroneous traces sampled from the set of trace data across the A/different trace types:
The compression rate across erroneous traces with different trace types is given by
Ce(β)=1−Ge(β) (5b)
A modified Gini index for the fraction of normal and erroneous traces sampled from the set of trace data across the M different trace types:
where
The compression rate is given by
C(β)=1−G(β) (5c)
Diversity of frequencies of occurrence may be measured by the modified Gini index. For example, trace-type sampling may be selected when the modified Gini index satisfies the following condition:
G(β)≤ThG (5d)
where
-
- G(β) represents Ge(β) or Gn(β);
- βe=βn=β; and
- ThG is a modified Gini index threshold (e.g., ThG=0.1, 0.05, or 0.01).
When the conditions given in Equation (5d) is not satisfied, trace-type information is not adequate for investigating performance of an application.
Duration Sampling of Normal and Erroneous Traces
Computer-implemented methods perform duration sampling on trace durations independent of the trace type. Erroneous traces usually have short durations or long durations. Traces of the trace data are sorted based on duration. For example, the traces may be sorted from shortest (longest) duration to longest (shortest) duration. The duration-sampling rates described below are used to separately sample normal and erroneous traces in corresponding bins of the histogram, where each bin corresponds to a time interval.
Computer-implemented methods compute upper and lower thresholds for distinguishing normal traces from erroneous traces of the duration-sorted traces. Traces with durations between the upper and lower thresholds are identified as normal tracs. Traces with durations that are greater than the upper threshold or less than the lower threshold are identified as erroneous traces. A histogram is constructed for the traces with normal traces having durations that fall between the lower and upper thresholds and erroneous traces have durations that are less than the lower threshold or greater than the upper threshold.
Upper and lower quantiles are used to partition the duration-sorted traces into three groups of traces. The upper and lower quantiles are given by
M(upper)=q1−s
M(lower)=qs
where 0≤s≤1(e.g., s=0.05 or s=0.1).
The lower quantile qs is a time that partitions the duration-sorted traces such that s traces have durations that are less than or equal to the quantile qs. The upper quantile q1−s is a time that partitions the duration-sorted traces such that s traces have durations that are greater than or equal to the quantile q1−s. For example, if s=0.1, the lower quantile q0.1 denotes a time that partitions the duration-sorted traces such that 10% of the traces have durations that are less than or equal to q0.1 and the upper quantile q0.9 denotes a time that partitions the duration-sorted traces such that 10% of the traces have durations that are greater than or equal to q09. Upper distances are computed for traces with durations that are greater than or equal to the upper quantile by
dist(upper)=|data(upper)−M(upper)| (6a)
and lower distances are computed for traces with durations that are less than or equal to the lower quantile by
dist(tower)=|data(lower)−M(lower)| (6b)
where
data(upper) represents a trace duration that is greater than or equal to M(upper); and
data(lower) represents a trace duration that is less than or equal to M(low).
A mean average deviation (“MAD”) is computed for the set of upper distances and is denoted by MAD (upper). A MAD is computed for the set of lower distances and is denoted by MAD (lower). Upper and lower thresholds for the duration-sorted traces are computed as follows:
Thupper=min(M(upper)+Γ×MAD(upper), max (duration)) (7a)
and
Thlower=max(M(lower)−Γ×MAD (lower),min(duration)) (7b)
where
-
- 0<Γ<1 (e.g., Γ=0.25, 0.20, or 0.30);
- max(duration) is the maximum trace duration; and
- min(duration) is the minimum trace duration.
A trace duration Dn is identified as an outlier if the trace duration satisfies one of the following conditions:
Dn>Thupper (8a)
Dn<Thlower (8b)
A histogram is constructed from traces with durations that satisfy the following condition:
Thupper≥Dn≥Thlower (8c)
Traces with durations that satisfy either of the conditions given by Equations (8a) and (8b) are erroneous traces that lie within lower interval [min(duration), Thlower) and the upper interval (Thupper, max(duration)]. respectively. The range of time between the upper and lower thresholds is partitioned into B equal duration intervals denoted by [cb−1, cb) for b=1, . . . , B−1, and [cB−1, cB], where c0=Thlower and cB=Thupper. Each bin of the histogram corresponds to a time interval. A trace with a duration that satisfies the condition given by Equation (8c) is identified as a normal trace. A normal trace that lies within one of the intervals is assigned to a bin that corresponds to the interval. The number of traces in each bin are counted and denoted by nb, where b=1, . . . , B . For example, nb represents the total number of traces in the interval [cB−1, c) and nB represents the total number of traces in the interval [cB-1, cB]. The number of erroneous traces that lie within the lower interval [min(duration), T lower) are denoted by ns and form a short-duration bin of erroneous traces. The number of traces that lie within the upper interval (T hupper,max(duration)] are denoted by nL and form a long-duration bin of erroneous traces. A histogram of traces is constructed by counting the number of traces in each bin.
A histogram may also be constructed for the trace durations using the t-digest approach described in “Computing extremely accurate quantiles using t-digests,” T. Dunning et. al., arXiv.org, Cornell University. Feb. 11, 2019. Instead of storing the entire set of trace data based on trace durations. t-digest stores only the results of data clustering, such as centroids of clusters and trace counts in each cluster.
A histogram of traces in the B bins is given by
Hist(B)={ns, n1, . . . , nB, nL}
where
nb is the number of traces in the b-th bin with durations in the interval [cb−1, cb) for b=1, . . . , B−1;
nB is the number of traces in the B-th bin with durations in the interval [cB−1, cB];
ns is the number of short duration traces (i.e., erroneous traces) in the interval [min(duration),Thlower); and
nL is the number of long duration traces (i.e., erroneous traces) in the interval
(Thupper, max(duration)].
The frequency of occurrence of traces in the b-th bin of the histogram is given by:
The normal duration sampling rate for normal traces in the b-th bin is given by
rb=1−(pb)a
where 0≤αan and is called the “normal duration sampling parameter.”
The normal duration-sampling rates in Equation (10) is the fractions of traces to be sampled from the b-th bin and stored in a data storage device. The frequency of occurrence of traces in the S-th bin of the histogram is given by:
The frequency of occurrence of traces in the L-th bin of the histogram is given by:
The short trace duration sampling rate for traces in the S-th bin is given by
hs=1−(ps)α
and the long duration sampling rate for traces in the L-th bin is given by
hL=1−(pL) (12b)
where 0≤αe and is called the “erroneous duration sampling parameter.”
The normal duration-sampling rates in Equations (12a) and (12b) are the fractions of traces to be sampled from the corresponding s-th and i-th bins and stored in a data storage device.
Note that in one implementation αn≠αe and in another implementation αn=αe.The duration-sampling parameter a corresponds to an amount of trace sampling based on the user-selected sampling level described above. For example, “conservative” sampling corresponds to α=1, “aggressive” sampling corresponds to α=0.5, and “super aggressive” sampling corresponds to α=0.25. The duration-sampling parameter α may be selected to provide the user-selected sampling level as described below.
The normal and erroneous duration-sampling rates in Equation (10). (12a) and (12b) may be different for each bin and is inversely proportional to the frequency of occurrences of the traces in each bin. For example, suppose the number of traces in a histogram comprises 10,000 traces with 460 traces in a bin B1 (i.e., n1=460) and 2.035 traces in a bin B2 (i.e., n2=2,035). The frequency of occurrence of traces in B1 is p1=0.046 and the frequency of occurrence of traces in B2 is p2=0.204. The following table shows the duration-sampling rates for the example traces in B1 and B2:
Note that the less frequently occurring traces in the bin B1 are sampled with a larger duration-sampling rate than the more frequently occurring traces in the bin B2 across the conservative. aggressive, and super aggressive sampling rates.
The number of normal traces sampled from the b-th bin and stored in the data storage device is given by:
where
The number of erroneous traces sampled from the s-th and l-th bins and stored in the data storage device is given by:
where
The remaining unsampled traces are discarded by deleting the unsampled traces from a data storage device.
Returning to
The modified Gini index equals the fraction of traces samples from the bins. For the normal traces, the modified Gini index is given by
The compression rate across the traces with normal durations is given by
Cn(α)=1−Gn(α) (15a)
For the erroneous traces, the modified Gini index is given by
The compression rate across the traces with erroneous durations is given by
Ce(α)=1−Ge(α) (15b)
A modified Gini index for the fraction of normal and erroneous traces sampled from the set of trace data across the M different trace types:
The compression rate across erroneous traces with different trace types is given by
C(α)=1−G(α) (15c)
where αe=αn=α.
Hybrid Sampling of Known Trace Types and Durations with Normal and Erroneous Traces
When both trace types and trace durations are important for troubleshooting performance of an application, a hybrid combination of trace-type sampling and duration-based sampling may be applied across different trace types and different trace durations for normal and erroneous traces.
A set of trace data is sorted into different trace types as described above with reference to
where
-
- subscript n denotes normal traces:
- b=1, . . . , B;
- nn,b(m) is the number of normal traces with the m-th trace type in the b-th bin; and
A frequency of occurrence is computed for erroneous traces in each bin of a histogram of erroneous traces of the m-th trace type as follows:
where
-
- subscript e denotes normal traces; and
- ne,b(m) is the number of normal traces with the m-th trace type in the b-th bin
A normal hybrid sampling rate for each bin of the m-th set of normal traces is given by
hn,b(m)=1−(pn(m))β
where 0≤αn and 0≤βn are normal trace sampling parameters.
The normal hybrid-sampling rate in Equation (13) may be different for each bin of each group of traces and is inversely proportional to the frequency of occurrences of the traces in each bin and each group of traces.
An erroneous hybrid sampling rate for each bin of the m-th set of normal traces is given by)
he,b(m)=1−(pe(m))β
where 0≤αe and 0≤βe are erroneous trace sampling parameters.
The erroneous hybrid-sampling rate in Equation (17b) may be different for each bin of each group of traces and is inversely proportional to the frequency of occurrences of the traces in each bin and each group of traces.
There are many ways in which the sampling parameters in Equations (17a) and (17b) be selected for sampling. In one implementation, αe=βe and αn=βn, but αe≠αn. In another implementation, αe=αn and βe=βn, but αe≠βe. In another implementation, the sampling parameters are the same with αe=βe=βn, but αe≠βe. In still another implementation, the sampling parameters are different with αe≠βe≠αn≠βn.
The number of normal traces sampled from the b-th bin and stored in the data storage device is given by:
and the number of erroneous traces sampled from the b-th bin and stored in the data storage device is given by:
where
Remaining unsampled traces are discarded by deleting the unsampled traces from a data storage device.
The modified Gini index of the normal traces equals the fraction of normal traces sample from the bins:
The compression rate for normal hybrid sampling of the traces is given by
Cn(β,α)=1−Gn(β,α) (19a)
The modified Gini index of the erroneous traces equals the fraction of normal traces sample from the bins:
The compression rate for erroneous hybrid sampling of the traces is given by
Ce(β,α)=1−Ge(β,α) (19b)
A modified Gini index for the fraction of normal and erroneous traces sampled from the set of trace data across the M different trace types:
where
-
- βe=βn=β;
- αe=αn=α; and
N =N e+N n.
The compression rate across erroneous traces with different trace types is given by
C(β,α)=1−G(βα) (19c)
Trace sampling may be performed on a set of trace data regardless of trace type and/or trace duration. A set of trace data is partitioned into normal traces and erroneous traces. Let N be the total number of traces in a set of trace data. Let Nn be the total number of normal traces in the set of trace data. Let Ne be the total of erroneous traces in the set of trace data.
A frequency of occurrence of normal traces is given by
and a frequency of occurrence of erroneous traces is given by
where N=Nn+Ne.
The normal sampling rate for sampling the normal traces is given by
hn=1−(pn)β
The erroneous sampling rate for sampling the erroneous traces is given by
he=1−(pe)β
The sampling rates represented by Equations (21a) and (21 b) ensures that rarely occurring normal and erroneous traces are sampled at a higher sampling rates than are more frequently occurring normal and erroneous traces.
The number of normal traces stored in the data storage device is given by:
The number of erroneous traces stored in the data storage device is given by
The number of traces
The sampling parameters βn and βe corresponds to the amount of normal and erroneous traces sampled and are based on user-selected sampling rates described below. Note that in one implementation βn≠βe and in another implementation βn=βe. For example, “conservative” sampling corresponds to β=1, “aggressive” sampling corresponds to β=0.5, and “super aggressive” sampling corresponds to β=0.25, where β represents βn and βe. The sampling parameters βn and βe are determined based the user-selected sampling rate as described below.
The modified Gini index for the normal sampling rate is given by
The compression rate across normal traces is given by
Cn(β)=1−Gn(β) (23a)
The modified Gini index for the erroneous sampling rate is given by
The compression rate across erroneous traces is given by
Ce(β)=1−Ge(β) (23b)
The sampling parameters βn and βe may be independently selected based on desired sampling rates hn, and he or compression rates. A modified Gini index for the fraction of normal and erroneous traces sampled from the set of trace data across the M different trace types:
where
The compression rate is given by
C(β)=1−G(β) (23c)
In another implementation, the set of erroneous traces may be partitioned further based on error codes, such as HTTP error status codes 4XX and 5XX or user-defined error status codes.
A frequency of occurrence of erroneous traces is given by
where u=1, . . . , U.
The erroneous sampling rate for sampling the set of erroneous traces with error code u is give by
he.u=1−(pe,u)β
The modified Gini index for the erroneous sampling rate with error status code u is given by
The compression rate across all error status codes is given by
In this implementation, a user selects an overall sampling rate, h, of a set of trace data and selects an erroneous trace sampling rate he. Computer-implemented methods and systems described below determine a normal trace sampling rate hn. The number of traces that are sampled and stored for an overall sampling rate h is given by
The remaining unsampled traces, N−
Let hn and he be the normal and erroneous trace sampling rates. The relationships between the number of normal and erroneous traces to be sampled and the normal and erroneous trace sampling rates are given by
Dividing Equation (26) by N gives
hn×pn+he×pe=h (29)
where pn=Nn/N and pe=Ne/N.
The frequencies of occurrences pn and pe are determined as described above with reference to Equations (20a) and (20b). When a user selects the erroneous trace sampling rate, he, the normal trace sampling rate is given by
When hn>0, the user-selected erroneous trace sampling rate he can be used to sample erroneous traces of a set of traces. Alternatively, when hn≤0, an alert is trigger in a GUI, such as on a monitor of a system administrator, and the normal traces are sampled with a preset normal trace sampling rate. When the normal and erroneous trace sampling rates are known, sampling is performed as described above with reference to
Suppose a set of trace data contains 260 normal traces and 170 erroneous traces. As a result, the frequency of occurrence of normal traces is pn=0.6 and the frequency of occurrence of erroneous traces is pe=0.4. When a user selects an overall sampling rate of h=0.30. the following table represents various combinations of normal and erroneous trace sampling rates that may be used:
The Table shows that when a user selects erroneous trace sampling rates he less than or equal to 0.7. the corresponding normal sampling rate hn acceptable. However, when a user selects erroneous sampling rates 0.8 and 0.9, the corresponding normal sampling rates are negative valued, which triggers an alert that is displayed on system administrator's monitor. The normal trace sampling rate may be set to a default normal trace sampling rate, such as 0.04 or 0.1. Suppose a user selects an erroneous trace sampling rate of 0.60, which, according to the Table, corresponds to a normal trace sampling rate of 0.1. These sampling rates will produce an overall sampling rate of h=0.30, which corresponds to sampling and storing 30% of the traces in the set of trace data.
In another implementation, the processes described above may be performed independent of user selections for the overall and erroneous traces sampling rates. In particular, normal and erroneous sampling rates may be preset and used based on certain metrics violating a corresponding threshold. For example, red metrics, such as request rate. error rate, and duration, are associated with services in an application. When the error rate, for example, is less than 10%. 4% of normal traces are sampled and stored (i.e., hn=0.04) and 1% of erroneous traces are sampled and stored (i.e., he=0.01). On the other hand, when the error rate is greater than 10%. 4% of normal traces (i.e., hn=0.04) are sampled and stored and 6% of erroneous traces are sampled and stored (i.e., he=0.01).
For a user-selected sampling rate h, the modified Gini index G(β)=h and the sampling parameter β is obtained as described below. The modified Gini index for the normal sampling rate is given by
The modified Gini index for the erroneous sampling rate is given by
The compression rate is given by Equation (23c).
Sampling Parameters
In one implementation, the GUI 1500 in
In another implementation, the sampling parameters are determined based on the user-selected sampling level input via the GUI in
G(γ
The parameter γ0 is used as the sampling parameter. Suppose a user defines an “aggressive” sampling rate as storing 10% of unsampled traces. The optimal parameter value γ1 satisfies the modified Gini index:
G(γ
The parameter γ1 is used as a sampling parameter. Suppose a user defines a “super aggressive” sampling as storing 5% of unsampled traces. The optimal parameter value γ2 satisfies the following condition:
G(γ
The parameter γ2 is used as a sampling parameter. Optimization of the sampling parameter γ is solved based on the latest historical set of trace data. When traces of an application exhibit static behavior the set optimal parameters γ are hard coded for long term use. In case of an application with highly dynamic behavior, the optimal parameters γ are regularly determined.
The optimal parameters and corresponding modified Gini indices (i.e., percentage of sampled traces) may be computed in advance. When a user selects a particular sampling level the corresponding parameter may be obtained from the predetermined relationships between the optimal parameters and the modified Gini indices (i.e., percentage of sampled traces).
Relations (β, G(β)) in Table 1 may be stored in a data storage device and retrieved from the data storage device based on a user-selected sampling level. The trace-type sampling parameter βthat corresponds to a modified Gini index closest to the user-selected sampling level is used to obtain the sampling rate, such as in Equations (2a), (2b), (21a), and (21b). For example, when a user selects a sampling level of 15% (i.e., modified Gini index of 0.15), the corresponding trace-type sampling parameter 0.07 (i.e., β=0.07) is retrieved from Table I and used to obtain the sampling rate, such as in Equations (2a), (2b), (21a), and (21b). When a user selects a sampling level of 10% (i.e., modified Gini index of 0.10), the corresponding trace-type sampling parameter 0.045 (i.e., β=0.045) is retrieved from Table I and used to obtain the sampling rate, such as in Equations (2a), (2b), (21a), and (21b). When a user selects a sampling level of 5% (i.e., closest modified Gini index is 0.045), the corresponding trace-type sampling parameter 0.02 (i.e., β=0.02) is retrieved from Table I and used to obtain the sampling rate, such as in Equations (2a), (2b), (21a), and (21b).
Relations (α, G(α)) in Table II may be stored in a data storage device and retrieved from the data storage device based on a user-selected sampling level. The duration-sampling parameter α that corresponds to the modified Gini index closest to the user-selected sampling level is used to obtain the duration-sampling rate in Equations (12a) and (12b). For example, when a user selects a sampling level of 15% (i.e., modified Gini index of 0.15), the corresponding duration-sampling parameter 0.11 (i.e., α=0.11) is retrieved from Table II and used to obtain the duration-sampling rate in Equations (12a) and (12b). When a user selects a sampling level of 10% (i.e., closest modified Gini index is 0.099), the corresponding duration-sampling parameter 0.07 (i.e., α=0.07) is retrieved from Table II and used to obtain the duration-sampling rate in Equations (12a) and (12b). When a user selects a sampling level of 5% (i.e., closest modified Gini index is 0.051). the corresponding duration-sampling parameter 0.035 (i.e., α=0.035) is retrieved from Table II and used to obtain the duration-sampling rate in Equation (9).
Relations ((β, α), G(β, α)) in Table III may be stored in a data storage device and retrieved from the data storage device based on a user-selected sampling level. The sampling parameters β and α that corresponds to a modified Gini index closest to the user-selected sampling level is used to obtain the duration-sampling rate in Equations (17a) and (17b). For example, when a user selects a sampling level of 15% (i.e., modified Gini index of 0.15). the corresponding sampling parameters β=0.04 and α=0.06 are retrieved from Table III and used to obtain the hybrid sampling rate in Equations (17a) and (17b). When a user selects a sampling level of 10% (i.e., modified Gini index is 0.01), a combination of the sampling parameters β and α are retrieved from Table III and used to obtain the hybrid sampling rate in Equations (17a) and (17b). Table III shows that different combinations of sampling parameters may be used for a modified Gini index of 0.1. In one implementation, when multiple combinations of a sampling parameters are available, rather than using different sampling parameters the number of different parameters may be reduced by using sampling parameters that are equal, such as α=β=0.03. When a user selects a sampling level of 5% (i.e., closest modified Gini index is 0.049), the corresponding sampling parameter β5% and α=0.02 are retrieved from Table III and used to obtain the hybrid sampling rate in Equation (13).
Relations (α, G(α, α)) in Table IV may be stored in a data storage device and retrieved from the data storage device based on a user-selected sampling level. The sampling parameter α that corresponds to the modified Gini index closest to the user-selected sampling level is used to obtain the hybrid sampling rate in Equations (17a) and (17b) with α=β. For example, when a user selects a sampling level of 15% (i.e., the closest modified Gini index of 0.147), the corresponding sampling parameters α=β0.041 is retrieved from Table IV and used to obtain the hybrid sampling rate in Equations (17a) and (17b). When a user selects a sampling level of 10% (i.e., modified Gini index is 0.1). the corresponding hybrid sampling parameters α=β=0.029) is retrieved from Table IV and used to obtain the hybrid sampling rate in Equations (17a) and (17b). When a user selects a sampling level of 5% (i.e., closest modified Gini index is 0.049), the corresponding sampling parameters α=β=0.013) is retrieved from Table IV and used to obtain the hybrid sampling rate in Equation (11).
Optimizing Sampling Parameters
In practice, historical optimization of the sampling parameters α and β is not feasible due to the dynamic nature of applications. Instead, the compression rate of the sampling rate is monitored over for a recent time window selected 13 a user. The duration of the time window may be one-half hour, one hour, two hours, twelve hours, or sixteen hours. The compression rate C(γ) is calculated for the corresponding sampling rate applied in the time window. After the compression rate has been calculated for the time window, a difference is calculated between the compression rate and a user-selected compression rate as follows:
Δ=|C(γ)−Cs (32)
where
γ represents the sampling parameter (i.e., γ=α, γ=β, or γ=(α, β));
C(γ) M is the compression rate of the sampling rate with sampling parameter γ of traces over the recent time period: and
Cs is the user-selected compression rate.
The user-selected compression rate is given by Cs=1−Gs, where Gs is the modified Gini index that corresponds to the user-selected sampling level. For example, when a user selects a sampling level of 15%, the modified Gini index is Gs=0.15, and the user-selected compression rate is Cs=0.85.
When the difference satisfies the following condition
Δ≤ThOpt (33)
where ThOpt is the optimization threshold (e.g., ThOpt=0.01, 0.02, or 0.05), the sampling rate is unchanged. On the other hand, when Δ>ThOpt, the sampling parameter of the sampling rate is adjusted using the following function;
factor (Δ)=2−exp(−10×Δ) (34a)
where
-
- 0≤Δ≤100; and
- 1≤factor≤2.
The factor in Equation (33a) is used to compute an adjusted sampling parameter as follows:
γadj=factor×γ (34b)
Alternatively, the factor in Equation (33a) is used to compute an adjusted sampling parameter as follows:
The adjusted sampling parameter of Equation (34b) or (34c) replaces a previously used sampling parameter in the sampling rates described above.
Sampling Normal and Erroneous Traces
A trace is randomly sampled based on a Bernoulli distribution, where the probability of a success (i.e., sampling the trace) is the sampling rate r and the probability of a failure (i.e., discarding the trace) is the probability 1−r, and where r represents the sampling rate associated with the trace described above. The BRBNG receives as input the sampling rate r and, based on r, randomly outputs a number 1 for a success with probability r or randomly outputs a number 0 for a failure with probability 1−r. For each trace in a set of traces, the sampling rate r is input to BRBNG. When the BRBNG outputs a number 1, the trace is sampled by storing the trace in a data storage device. On the other hand, when the BRBNG outputs a number 0, the trace is discarded or deleted from memory or from a data storage device. Note that assignment of the values 1 and 0 may be reversed provided 0 is associated with probability of a success r and 1 is associated with probability of a failure 1−r. In an alternative implementation, a random number generator (e.g., pseudo-random number generator) is used to output a random number, R, for each trace, where 0≤R≤1. When R≤r, the trace is sampled by storing the trace in a data storage device. On the other hand, when R>r, the trace is discarded or deleted from memory or from a data storage device.
The computer-implemented methods described below with reference to
It is appreciated that the previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method stored in one or more data storage devices and executed using one or more processors of a computer system for sampling a set of traces of an application executed in a distributed computing system, the method comprising:
- retrieving a set of trace data associated with the application from a data storage device;
- determining sampling rates for sampling normal traces in the set and for sampling erroneous traces in the set, wherein the different sampling rates are inversely proportional to the frequency of occurrence of the normal traces and erroneous traces;
- sampling the traces using the sampling rates to obtain sampled normal traces and sampled erroneous traces, wherein less frequently occurring normal traces are sampled at higher sampling rates than more frequently occurring normal traces and less frequently occurring erroneous traces are sampled at higher sampling rates than more frequently occurring erroneous traces; and
- storing the sampled traces in a data storage device.
2. The method of claim 1 wherein determining the sampling rates comprises:
- sorting the traces according to trace type to obtain one or more groups of traces, each group of traces having a different associated trace type; and
- for each group of traces. partitioning the group of traces into normal traces and erroneous traces, determining a frequency of occurrence of normal traces in the group, determining a frequency of occurrence of erroneous traces in the group, constructing a normal trace histogram of the normal traces, constructing an erroneous trace histogram of the erroneous traces, determining a frequency of occurrence of normal traces in each bin of the normal trace histogram, determining a frequency of occurrence of normal traces in each bin of the erroneous trace histogram, determining a normal hybrid sampling rate for each bin of the normal histogram based on the frequency of occurrence of normal traces in each bin, the frequency of occurrence of the normal traces, and determining an erroneous hybrid sampling rate for each bin of the normal histogram based on the frequency of occurrence of normal traces in each bin, the frequency of occurrence of the normal traces.
3. The method of claim 1 wherein determining the sampling rates comprises:
- sorting the traces according to trace type to obtain one or more groups of traces, each group of traces having a different associated trace type;
- receiving a sampling level via a graphical user interface;
- determining a trace-type sampling parameter based on the user-selected sampling level; and
- for each group of traces, partitioning the group of traces into normal traces and erroneous traces; determining a frequency of occurrence of normal traces in the group of traces, determining a normal trace-type sampling rate based on the frequency of occurrence of normal traces, determining a frequency of occurrence of erroneous traces in the group of traces, determining an erroneous trace-type sampling rate based on the frequency of occurrence of erroneous traces.
4. The method of claim 1 wherein determining the sampling rates comprises:
- constructing a histogram of traces based on the durations, each bin of the histogram corresponding to a time interval and containing traces with durations in the time interval;
- determining a frequency of occurrence of normal traces in each bin of the histogram;
- for each bin of the histogram, determining a duration-sampling rate based on the frequency of occurrence of traces in the bin and the duration-sampling parameter:
- determining a frequency of occurrence of traces in a lower bin;
- computing a short duration sampling rate from the frequency of occurrence of traces in the lower bin;
- determining a frequency of occurrence of traces in an upper bin; and
- computing a long duration sampling rate from the frequency of occurrence of traces in the upper bin.
5. The method of claim 1 wherein determining the sampling rates comprises:
- partitioning the set of trace data into normal traces and erroneous traces:
- determining a frequency of occurrence of the normal traces:
- determining a normal trace sampling rate based on the frequency of occurrence of the normal traces;
- determining a frequency of occurrence of the erroneous traces; and
- determining a erroneous trace sampling rate based on the frequency of occurrence of the erroneous traces.
6. The method of claim 1 wherein determining the sampling rates comprises:
- partitioning the set of trace data into normal traces and erroneous traces;
- determining a frequency of occurrence of the normal traces;
- determining a frequency of occurrence of the erroneous traces; and
- determining a normal trace sampling rate based on the frequency of occurrence of the normal traces, frequency of occurrence of the erroneous traces, an overall sampling rate, and erroneous trace sampling rate.
7. The method of claim 1 wherein sampling the traces using the sampling rates comprises sampling normal traces with a normal trace sampling rate, wherein the normal trace sampling rate is inversely proportional to a frequency of occurrence of the normal traces.
8. The method of claim 1 wherein sampling the traces using the sampling rates comprises sampling erroneous traces with an erroneous trace sampling rate, wherein the erroneous trace sampling rate is inversely proportional to a frequency of occurrence of the erroneous traces.
9. The method of claim 1 further comprises:
- performing troubleshooting on the sampled erroneous traces to identify a performance problem with the application; and
- executing remedial measures to correct the performance problem.
10. A computer system for sampling application traces of an application executed in a distributed computer system, the system comprising:
- one or more processors:
- one or more data storage devices: and
- machine-readable instructions stored in the one or more data storage devices that when executed using the one or more processors controls the system to perform operations comprising: retrieving a set of trace data associated with the application from a data storage device; determining sampling rates for sampling normal traces in the set and for sampling erroneous traces in the set, wherein the different sampling rates are inversely proportional to the frequency of occurrence of the normal traces and erroneous traces: sampling the traces using the sampling rates to obtain sampled normal traces and sampled erroneous traces, wherein less frequently occurring normal traces are sampled at higher sampling rates than more frequently occurring normal traces and less frequently occurring erroneous traces are sampled at higher sampling rates than more frequently occurring erroneous traces; and storing the sampled traces in a data storage device.
11. The computer system of claim 10 wherein determining the sampling rates comprises:
- sorting the traces according to trace type to obtain one or more groups of traces, each group of traces having a different associated trace type; and
- for each group of traces, partitioning the group of traces into normal traces and erroneous traces, determining a frequency of occurrence of normal traces in the group, determining a frequency of occurrence of erroneous traces in the group constructing a normal trace histogram of the normal traces, constructing an erroneous trace histogram of the erroneous traces, determining a frequency of occurrence of normal traces in each bin of the normal trace histogram, determining a frequency of occurrence of normal traces in each bin of the erroneous trace histogram, determining a normal hybrid sampling rate for each bin of the normal histogram based on the frequency of occurrence of normal traces in each bin, the frequency of occurrence of the normal traces, and determining an erroneous hybrid sampling rate for each bin of the normal histogram based on the frequent of occurrence of normal traces in each bin, the frequency of occurrence of the normal traces.
12. The computer system of claim 10 wherein determining the sampling rates comprises:
- sorting the traces according to trace type to obtain one or more groups of traces, each group of traces having a different associated trace type;
- receiving a sampling level via a graphical user interface;
- determining a trace-type sampling parameter based on the user-selected sampling level; and
- for each group of traces, partitioning the group of traces into normal traces and erroneous traces; determining a frequency of occurrence of normal traces in the group of traces, determining a normal trace-type sampling rate based on the frequency of occurrence of normal traces, determining a frequency of occurrence of erroneous traces in the group of traces, determining an erroneous trace-type sampling rate based on the frequency of occurrence of erroneous traces.
13. The computer system of claim 10 wherein determining the sampling rates comprises:
- constructing a histogram of traces based on the durations, each bin of the histogram corresponding to a time interval and containing traces with durations in the time interval;
- determining a frequency of occurrence of normal traces in each bin of the histogram:
- for each bin of the histogram, determining a duration-sampling rate based on the frequency of occurrence of traces in the bin and the duration-sampling parameter;
- determining a frequency of occurrence of traces in a lower bin;
- computing a short duration sampling rate from the frequency of occurrence of traces in the lower bin;
- determining a frequency of occurrence of traces in an upper bin; and
- computing a long duration sampling rate from the frequency of occurrence of traces in the upper bin.
14. The computer system of claim 10 wherein determining the sampling rates comprises:
- partitioning the set of trace data into normal traces and erroneous traces;
- determining a frequency of occurrence of the normal traces;
- determining a normal trace sampling rate based on the frequency of occurrence of the normal traces;
- determining a frequency of occurrence of the erroneous traces; and
- determining a erroneous trace sampling rate based on the frequency of occurrence of the erroneous traces.
15. The computer system of claim 10 wherein determining the sampling rates comprises:
- partitioning the set of trace data into normal traces and erroneous traces;
- determining a frequency of occurrence of the normal traces;
- determining a frequency of occurrence of the erroneous traces; and
- determining a normal trace sampling rate based on the frequency of occurrence of the normal traces, frequency of occurrence of the erroneous traces, an overall sampling rate, and erroneous trace sampling rate.
16. The computer system of claim 10 wherein sampling the traces using the sampling rates comprises sampling normal traces with a normal trace sampling rate, wherein the normal trace sampling rate is inversely proportional to a frequency of occurrence of the normal traces.
17. The computer system of claim 10 wherein sampling the traces using the sampling rates comprises sampling erroneous traces with an erroneous trace sampling rate, wherein the erroneous trace sampling rate is inversely proportional to a frequency of occurrence of the erroneous traces.
18. The computer system of claim 10 further comprises:
- performing troubleshooting on the sampled erroneous traces to identify a performance problem with the application; and
- executing remedial measures to correct the performance problem.
19. A non-transitory computer-readable medium encoded with machine-readable instructions that when executed by one or more processors of a computer system perform operations comprising:
- retrieving a set of trace data associated with the application from a data storage device;
- determining sampling rates for sampling normal traces in the set and for sampling erroneous traces in the set, wherein the different sampling rates are inversely proportional to the frequency of occurrence of the normal traces and erroneous traces:
- sampling the traces using the sampling rates to obtain sampled normal traces and sampled erroneous traces, wherein less frequently occurring normal traces are sampled at higher sampling rates than more frequently occurring normal traces and less frequently occurring erroneous traces are sampled at higher sampling rates than more frequently occurring erroneous traces; and
- storing the sampled traces in a data storage device.
20. The medium of claim 19 wherein determining the sampling rates comprises:
- sorting the traces according to trace type to obtain one or more groups of traces, each group of traces having a different associated trace type; and
- for each group of traces, partitioning the group of traces into normal traces and erroneous traces, determining a frequency of occurrence of normal traces in the group, determining a frequency of occurrence of erroneous traces in the group, constructing a normal trace histogram of the normal traces, constructing an erroneous trace histogram of the erroneous traces, determining a frequency of occurrence of normal traces in each bin of the normal trace histogram, determining a frequency of occurrence of normal traces in each bin of the erroneous trace histogram, determining a normal hybrid sampling rate for each bin of the normal histogram based on the frequency of occurrence of normal traces in each bin, the frequency of occurrence of the normal traces, and determining an erroneous hybrid sampling rate for each bin of the normal histogram based on the frequency of occurrence of normal traces in each bin, the frequency of occurrence of the normal traces.
21. The medium of claim 19 wherein determining the sampling rates comprises:
- sorting the traces according to trace type to obtain one or more groups of traces, each group of traces having a different associated trace type;
- receiving a sampling level via a graphical user interface;
- determining a trace-type sampling parameter based on the user-selected sampling level; and
- for each group of traces, partitioning the group of traces into normal traces and erroneous traces; determining a frequency of occurrence of normal traces in the group of traces, determining a normal trace-type sampling rate based on the frequency of occurrence of normal traces, determining a frequency of occurrence of erroneous traces in the group of traces, determining an erroneous trace-type sampling rate based on the frequency of occurrence of erroneous traces.
22. The medium of claim 19 wherein determining the sampling rates comprises:
- constructing a histogram of traces based on the durations, each bin of the histogram corresponding to a time interval and containing traces with durations in the time interval;
- determining a frequency of occurrence of normal traces in each bin of the histogram;
- for each bin of the histogram, determining a duration-sampling rate based on the frequency of occurrence of traces in the bin and the duration-sampling parameter;
- determining a frequency of occurrence of traces in a lower bin;
- computing a short duration sampling rate from the frequency of occurrence of traces in the lower bin;
- determining a frequency of occurrence of traces in an upper bin; and
- computing a long duration sampling rate from the frequency of occurrence of traces in the upper bin.
23. The medium of claim 19 wherein determining the sampling rates comprises:
- partitioning the set of trace data into normal traces and erroneous traces;
- determining a frequency of occurrence of the normal traces;
- determining a normal trace sampling rate based on the frequency of occurrence of the normal traces;
- determining a frequency of occurrence of the erroneous traces; and
- determining a erroneous trace sampling rate based on the frequency of occurrence of the erroneous traces.
24. The medium of claim 19 wherein determining the sampling rates comprises:
- partitioning the set of trace data into normal traces and erroneous traces;
- determining a frequency of occurrence of the normal traces;
- determining a frequency of occurrence of the erroneous traces; and
- determining a normal trace sampling rate based on the frequency of occurrence of the normal traces, frequency of occurrence of the erroneous traces, an overall sampling rate, and erroneous trace sampling rate.
25. The medium of claim 19 wherein sampling the traces using the sampling rates comprises sampling normal traces with a normal trace sampling rate, wherein the normal trace sampling rate is inversely proportional to a frequency of occurrence of the normal traces.
26. The medium of claim 19 wherein sampling the traces using the sampling rates comprises sampling erroneous traces with an erroneous trace sampling rate, wherein the erroneous trace sampling rate is inversely proportional to a frequency of occurrence of the erroneous traces.
27. The medium of claim 19 further comprises:
- performing troubleshooting on the sampled erroneous traces to identify a performance problem with the application; and
- executing remedial measures to correct the performance problem.
Type: Application
Filed: Jul 13, 2021
Publication Date: Sep 15, 2022
Applicant: VMware, Inc. (Palo Alto, CA)
Inventors: Arnak Poghosyan (Yerevan), Ashot Nshan Harutyunyan (Yerevan), Naira Movses Grigoryan (Yerevan), Clement Pang (Palo Alto, CA), George Oganesyan (Yerevan), Karen Avagyan (Yerevan)
Application Number: 17/374,682