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
    "Space Monkey by Vivent Smart Home is a product that is a distributed cloud-based edge storage network. Vivent Smart Home, our parent company, is a smart home provider that places a lot of hard drives across homes in North America," explained JT Olds, Director of Engineering, and Brandon Crowfeather, Product Manager, at Vivint Smart Home, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    It is of utmost importance for the future success of WebRTC to ensure that interoperability is operational between web browsers and any WebRTC-compliant client. To be guaranteed as operational and effective, interoperability must be tested extensively by establishing WebRTC data and media connections between different web browsers running on different devices and operating systems. In his session at WebRTC Summit at @ThingsExpo, Dr. Alex Gouaillard, CEO and Founder of CoSMo Software, presented ...
    "There's plenty of bandwidth out there but it's never in the right place. So what Cedexis does is uses data to work out the best pathways to get data from the origin to the person who wants to get it," explained Simon Jones, Evangelist and Head of Marketing at Cedexis, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    WebRTC is great technology to build your own communication tools. It will be even more exciting experience it with advanced devices, such as a 360 Camera, 360 microphone, and a depth sensor camera. In his session at @ThingsExpo, Masashi Ganeko, a manager at INFOCOM Corporation, introduced two experimental projects from his team and what they learned from them. "Shotoku Tamago" uses the robot audition software HARK to track speakers in 360 video of a remote party. "Virtual Teleport" uses a multip...
    "Akvelon is a software development company and we also provide consultancy services to folks who are looking to scale or accelerate their engineering roadmaps," explained Jeremiah Mothersell, Marketing Manager at Akvelon, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    "IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
    Gemini is Yahoo’s native and search advertising platform. To ensure the quality of a complex distributed system that spans multiple products and components and across various desktop websites and mobile app and web experiences – both Yahoo owned and operated and third-party syndication (supply), with complex interaction with more than a billion users and numerous advertisers globally (demand) – it becomes imperative to automate a set of end-to-end tests 24x7 to detect bugs and regression. In th...
    SYS-CON Events announced today that Telecom Reseller has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
    SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
    "MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
    Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
    In his session at 21st Cloud Expo, Carl J. Levine, Senior Technical Evangelist for NS1, will objectively discuss how DNS is used to solve Digital Transformation challenges in large SaaS applications, CDNs, AdTech platforms, and other demanding use cases. Carl J. Levine is the Senior Technical Evangelist for NS1. A veteran of the Internet Infrastructure space, he has over a decade of experience with startups, networking protocols and Internet infrastructure, combined with the unique ability to it...
    "Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
    A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
    SYS-CON Events announced today that Evatronix 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. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
    Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
    To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
    An increasing number of companies are creating products that combine data with analytical capabilities. Running interactive queries on Big Data requires complex architectures to store and query data effectively, typically involving data streams, an choosing efficient file format/database and multiple independent systems that are tied together through custom-engineered pipelines. In his session at @BigDataExpo at @ThingsExpo, Tomer Levi, a senior software engineer at Intel’s Advanced Analytics gr...
    When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things’). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing? IoT is not about the devices, it’s about the data consumed and generated. The devices are tools, mechanisms, conduits. In his session at Internet of Things at Cloud Expo | DXWor...
    Everything run by electricity will eventually be connected to the Internet. Get ahead of the Internet of Things revolution. In his session at @ThingsExpo, Akvelon expert and IoT industry leader Sergey Grebnov provided an educational dive into the world of managing your home, workplace and all the devices they contain with the power of machine-based AI and intelligent Bot services for a completely streamlined experience.