Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Getting a Handle on Rogue Transactions and Execute Threads

Getting a Handle on Rogue Transactions and Execute Threads

Q. What can I do about "rogue" transactions that are affecting the overall performance of my application?
Many production J2EE applications suffer from rogue transactions. A rogue transaction is a particular use case or click-through in the application that results in enormous resource consumption or unusually high response times when compared with its peers. In practice, an application suffering from such a problem will display erratic and unpredictable resource consumption patterns or response times.

If we take an application with some single point of dispatch (e.g., controller servlet), it might display two very distinct response times and throughput patterns if there are one or many threads involved in a rogue transaction. Before the rogue transaction hits the server, the CPU and memory usage patterns may be calm. Like a large rock hitting the surface of a pond, from the moment a rogue transaction has entered the application and begun to be dispatched, its voracious CPU and memory consumption may ripple through the rest of the JVM and hardware, perturbing the other, better-behaved transactions in mid-dispatch.

If the rogue transactions are rare, they can show up in performance metrics as sustained anomalies in response time and throughput. If there are a few consistently running at any given time, however, response time and throughput may consistently show poor numbers. In this case, you may not have rogue transaction so much as a couple of consistently expensive use cases. In the latter case, you can generally identify the problem with a profiler or any other tool that will be able to breakdown the responsiveness of the application by application logic or use case.

But what of the situation when you truly have a rare rogue transaction that traverses your system, wreaking havoc in its wake and disappearing as suddenly as it appeared? Your only real option before resorting to tools is to thread dump the JVM while the rogue transaction is being dispatched. Much has been written about collecting and reading thread dumps. You should try to perform at least three thread dumps while your server is in its exhausted state, reading them for any thread that appears to be busy in the same program logic across all three.

Now you should focus your response time analysis on this piece of program logic. If you are sure you can reproduce the same datasets being used by this logic in a staging area, try profiling the logic and measuring its CPU and clock time outside production. If not, consider adding logging or other tooling to monitor the responsiveness of the routines that appear to be costly and slow. One common source of rogue transactions that burn CPU is XML parsing and transformation - some implementations will generate enormous numbers of temporary objects in the course of doing their work, which in turn forces more object instantiation and garbage collection. A cousin of the rogue transaction is the infinite loop: the use case or click-through causes a thread to enter a loop without a break condition. Infinite loops tend to be easier to diagnose. An application server or JVM with a thread in an infinite loop will cause one CPU on the server per thread stuck in a loop, to sit saturated at 100% utilization. The loops should jump out in a series of thread dumps - a thread will literally not have moved from a particular piece of application code in any of them.

Q. What are execute threads and how do I configure them appropriately?
If BEA WebLogic Server were said to have any single "utility" it required in order to handle incoming transactions, you might pick execute threads.

One of the main ideas behind J2EE for Web application development was the notion of a servlet container living in a live JVM. With the JVM as a process always resident in memory, incoming requests could be handled by invoking lightweight threads. Even better, you could pool these threads and reuse them when you were finished dispatching a request.

Naturally, like most pooled resources, thread pools have some settings for their initial size and maximum size. They may also have settings for how quickly to grow the pool, how often to check that resources have been returned to it, and so on.

In the BEA WebLogic Server, the Execute Queue functions as the thread pool for incoming requests. If you see your response times slow down dramatically as you increase load on your production application - even though you haven't maxed out the CPU(s) of the hardware on which your application is hosted - then you may be bottlenecking your WebLogic Server with its Execute Queue.

A good setting strikes a suitable balance between the available CPU resources and the volume of incoming requests. If your CPU is already saturated, increasing the thread pool size is not going to help the situation and may even make it worse. Larger thread pools mean more work for the thread scheduler in the JVM and for the WebLogic Server itself. The best way to set the Execute Queue's size is to keep an eye on the following four variables:

  • CPU utilization
  • Application responsiveness
  • Application throughput
  • WebLogic Server Execute Queue threads busy

    BEA WebLogic Server publishes a metric, via JMX, showing how many of the execute threads are busy. If you have the luxury of a staging environment with a load similar to your production environment, try setting the Execute Queue size all the way down to five available application threads - then monitor the business of these threads from the WebLogic Server JMX metrics or some other tool. Slowly increase the number of threads in increments of five, watching how this affects the application responsiveness, throughput, and CPU utilization.

    Once you have a thread pool that is staying more than 80% available without the CPU being saturated, you should stop increasing the pool size. Any further increases and you can end up slowing everything down.

    As always, I invite you to send an e-mail to [email protected] if you have any performance-related questions about JVMs, Java applications, WebLogic Server, or connections to back-end systems.

  • More Stories By Lewis Cirne

    Lew Cirne is the founder of New Relic, the first provider of on-demand (SaaS) application management tools for cloud or datacenter applications. A seasoned entrepreneur, technologist, and enterprise software pioneer, he has been focused on application performance management for more than ten years. Cirne holds seven patents related to application performance technology. Most recently he was an Entrepreneur in Residence at Benchmark Capital. He founded and was first CEO of Wily Technology and earlier held senior engineering positions at Apple and Hummingbird Communications.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

    @ThingsExpo Stories
    Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
    SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
    Most technology leaders, contemporary and from the hardware era, are reshaping their businesses to do software. They hope to capture value from emerging technologies such as IoT, SDN, and AI. Ultimately, irrespective of the vertical, it is about deriving value from independent software applications participating in an ecosystem as one comprehensive solution. In his session at @ThingsExpo, Kausik Sridhar, founder and CTO of Pulzze Systems, will discuss how given the magnitude of today's applicati...
    Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
    SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
    In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
    SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...
    SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
    Amazon is pursuing new markets and disrupting industries at an incredible pace. Almost every industry seems to be in its crosshairs. Companies and industries that once thought they were safe are now worried about being “Amazoned.”. The new watch word should be “Be afraid. Be very afraid.” In his session 21st Cloud Expo, Chris Kocher, a co-founder of Grey Heron, will address questions such as: What new areas is Amazon disrupting? How are they doing this? Where are they likely to go? What are th...
    As hybrid cloud becomes the de-facto standard mode of operation for most enterprises, new challenges arise on how to efficiently and economically share data across environments. In his session at 21st Cloud Expo, Dr. Allon Cohen, VP of Product at Elastifile, will explore new techniques and best practices that help enterprise IT benefit from the advantages of hybrid cloud environments by enabling data availability for both legacy enterprise and cloud-native mission critical applications. By rev...
    Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they b...
    SYS-CON Events announced today that SkyScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. SkyScale is a world-class provider of cloud-based, ultra-fast multi-GPU hardware platforms for lease to customers desiring the fastest performance available as a service anywhere in the world. SkyScale builds, configures, and manages dedicated systems strategically located in maximum-security...
    High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
    In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
    SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
    As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
    SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
    Organizations do not need a Big Data strategy; they need a business strategy that incorporates Big Data. Most organizations lack a road map for using Big Data to optimize key business processes, deliver a differentiated customer experience, or uncover new business opportunities. They do not understand what’s possible with respect to integrating Big Data into the business model.
    Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
    SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.