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
    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...
    Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
    Product connectivity goes hand and hand these days with increased use of personal data. New IoT devices are becoming more personalized than ever before. In his session at 22nd Cloud Expo | DXWorld Expo, Nicolas Fierro, CEO of MIMIR Blockchain Solutions, will discuss how in order to protect your data and privacy, IoT applications need to embrace Blockchain technology for a new level of product security never before seen - or needed.
    Imagine if you will, a retail floor so densely packed with sensors that they can pick up the movements of insects scurrying across a store aisle. Or a component of a piece of factory equipment so well-instrumented that its digital twin provides resolution down to the micrometer.
    In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, provided an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settle...
    BnkToTheFuture.com is the largest online investment platform for investing in FinTech, Bitcoin and Blockchain companies. We believe the future of finance looks very different from the past and we aim to invest and provide trading opportunities for qualifying investors that want to build a portfolio in the sector in compliance with international financial regulations.
    No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
    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, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
    "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...
    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...
    When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
    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 ...
    We are given a desktop platform with Java 8 or Java 9 installed and seek to find a way to deploy high-performance Java applications that use Java 3D and/or Jogl without having to run an installer. We are subject to the constraint that the applications be signed and deployed so that they can be run in a trusted environment (i.e., outside of the sandbox). Further, we seek to do this in a way that does not depend on bundling a JRE with our applications, as this makes downloads and installations rat...
    Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
    DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
    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...
    Digital Transformation (DX) is not a "one-size-fits all" strategy. Each organization needs to develop its own unique, long-term DX plan. It must do so by realizing that we now live in a data-driven age, and that technologies such as Cloud Computing, Big Data, the IoT, Cognitive Computing, and Blockchain are only tools. In her general session at 21st Cloud Expo, Rebecca Wanta explained how the strategy must focus on DX and include a commitment from top management to create great IT jobs, monitor ...
    "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...
    The IoT Will Grow: In what might be the most obvious prediction of the decade, the IoT will continue to expand next year, with more and more devices coming online every single day. What isn’t so obvious about this prediction: where that growth will occur. The retail, healthcare, and industrial/supply chain industries will likely see the greatest growth. Forrester Research has predicted the IoT will become “the backbone” of customer value as it continues to grow. It is no surprise that retail is ...