libuv is a cross‑platform asynchronous I/O library originally built for Node.js that abstracts event‑driven I/O via handles and requests, provides a single‑threaded event loop with platform‑specific poll mechanisms, and uses a global thread pool for file and DNS operations, all while maintaining a consistent execution model.
This article explains why multithreading and thread pools are essential for modern server-side Java development, details the full set of ThreadPoolExecutor constructor parameters, and walks through the executor, addWorker, Worker, runWorker, and getTask implementations using JDK 1.8 source code examples.
This article explains three common ThreadLocal misuse traps—memory leaks caused by weak‑referenced keys, loss of thread‑local context in thread‑pool workers, and context disappearance in parallel streams—provides detailed code examples, and offers practical guidelines to prevent them in Java backend applications.
This article explains why ThreadLocal is both simple and tricky to use, demonstrates common pitfalls when formatting dates with SimpleDateFormat in multithreaded environments, analyzes thread‑safety issues, and provides practical solutions using synchronized blocks, ThreadLocal, and its advanced initialization methods for clean and efficient concurrent code.
The article describes a two‑part mobile app performance monitoring system that automatically instruments code to capture method execution times, ANR and frame stalls, then processes, cleans, aggregates, and visualizes the data on a backend platform to generate alerts, trend reports, and guide optimization across versions.
This article critiques traditional Python threading tutorials and demonstrates how to replace verbose thread‑pool code with concise map‑based parallelism using multiprocessing and multiprocessing.dummy, providing practical examples, performance measurements, and guidelines for choosing pool sizes for I/O‑ and CPU‑bound tasks.
This article provides a deep technical walkthrough of libuv’s Linux implementation, covering epoll‑based I/O handling, level‑ and edge‑triggered events, the event‑loop architecture, timer management with a min‑heap, thread‑pool integration, and the mechanisms that drive asynchronous callbacks in Node.js.
This article explains the pitfalls of creating Java thread pools with Executors, details how to correctly build them using ThreadPoolExecutor, clarifies core parameters, queue strategies, and rejection policies, and provides runnable code examples to illustrate proper usage.
The article shares three interview scenarios—a puzzling HTTP GET failure, a rate‑limiting challenge solved with token‑bucket logic, and a deep dive into Java ThreadPoolExecutor behavior—each followed by personal insights on problem‑solving, algorithm application, and understanding underlying principles.
The article explains how to reliably propagate country‑specific context across request handling, database access, and asynchronous thread pools in multi‑country e‑commerce by replacing simple ThreadLocal and InheritableThreadLocal with Alibaba’s TransmittableThreadLocal, demonstrating its integration with Spring MVC/Boot, MyBatis, Dubbo, and custom executors for both sharded and non‑sharded databases.
This article details a step‑by‑step performance tuning journey for a Java‑based SOA service, covering thread‑pool redesign, memory‑allocation adjustments, and JIT compilation tweaks that together lifted QPM by nearly 40% and overall system throughput by about 50%.
This article summarizes a year‑long performance tuning of an ELK logging system, analyzing bottlenecks such as write thread pool saturation, JVM heap and GC settings, refresh intervals, translog durability, merge threads, shard and replica counts, and provides concrete configuration changes that reduced latency, eliminated data loss, and stabilized node resource usage.
This article explains why multithreading improves program performance, distinguishes latency reduction from throughput increase, and provides practical formulas to determine the ideal number of threads for both I/O‑bound and CPU‑bound workloads, helping you fully utilize hardware resources.
This article uses a vivid workplace story to explain thread pools, covering core threads, blocking queues, non‑core threads, idle keep‑alive time, and saturation policies, and includes a workflow diagram and Java source snippet for clear comprehension.
The article uses a simple bank workflow with ten staff members to illustrate the differences in throughput between BIO (blocking I/O), NIO (non‑blocking I/O), and asynchronous processing, showing how task decomposition and specialized threads dramatically improve performance in backend systems.
This article demonstrates how to configure Python's logging module for console and file output, extend it with HTTPHandler for remote logging, and improve performance by using custom handlers, threading, thread pools, and asynchronous aiohttp calls to avoid blocking the main program.
This article uses a bank workflow analogy to compare blocking I/O (BIO), non‑blocking I/O (NIO), and asynchronous processing, showing how task decomposition and specialized threads dramatically increase system throughput while illustrating the trade‑offs of each approach.
This article explains the concept of pooling—pre‑creating reusable resources—and demonstrates how thread pools, memory pools, database connection pools, and HttpClient pools improve Java application performance, backed by code examples and benchmark results.
This article explains the concept of pooling technology in Java, illustrating its benefits through real‑world analogies, detailing thread pools, memory pools, database connection pools, and HttpClient pools, and provides a performance comparison between raw threads and thread pools using a Java benchmark.
This article compares two popular formulas for estimating Java thread pool size, analyzes their equivalence, and provides practical guidelines for configuring thread counts in I/O‑bound and CPU‑bound workloads, including code examples and performance considerations.
This article explains why thread pools are essential for Java applications, details the seven key parameters of ThreadPoolExecutor, describes the possible thread‑pool states, and walks through the core methods such as execute, addWorker, runWorker and getTask with code examples.
This article provides a comprehensive analysis of Java's ThreadPoolExecutor, explaining its purpose, core attributes, state management using the ctl field, constructors, task submission mechanisms, worker thread creation, execution flow, task retrieval, shutdown procedures, and the intricate synchronization techniques that enable efficient thread reuse.
This article introduces a dynamic thread‑pool component for Spring Cloud that supports Cat monitoring, runtime core‑parameter adjustments, queue‑capacity and reject‑count alerts, and provides Nacos‑based configuration, code examples, and endpoint integration for operational visibility.
This article explains the definition of thread pools, why using Executors to create them is discouraged, details the ThreadPoolExecutor constructor and its parameters, compares different Executors factory methods, demonstrates OOM testing, and provides practical guidelines for defining safe thread‑pool parameters in Java.
This article explains the concept and benefits of Java thread pools, dives deep into the internal design and lifecycle of ThreadPoolExecutor with code examples, discusses real‑world usage scenarios and common configuration pitfalls, and presents a dynamic, monitorable thread‑pool solution to improve performance and reliability.
This article details a comprehensive experiment that evaluates MySQL's ability to sustain up to 100,000 simultaneous connections using Percona Server's thread‑pool plugin, sysbench clients, adjusted OS/network limits, and multiple IP addresses, presenting hardware specs, configuration steps, observed errors, performance metrics, and practical recommendations.
This article analyzes the performance bottlenecks of the 58 used‑car list service under high concurrency, breaks down data‑query and data‑transfer stages, and presents three optimization solutions—including query redesign, concurrent data conversion, and thread‑pool parameter tuning—that together reduce latency by over 80 ms and improve resource utilization.
This article explains the concept, design, and internal implementation of Java's ThreadPoolExecutor, discusses common thread‑pool problems, presents dynamic configuration solutions, and provides practical usage scenarios and code examples to help developers efficiently manage concurrency in backend applications.
This article provides a comprehensive analysis of Java's ThreadPoolExecutor source code, explaining its design, core attributes, constructors, task submission mechanisms, worker thread creation, thread‑reuse logic, and shutdown procedures, while illustrating each concept with detailed code examples and diagrams.
This article explains why multithreading remains essential, distinguishes CPU‑bound and I/O‑bound scenarios, provides formulas for calculating the optimal number of threads, discusses interview questions, and highlights practical considerations such as thread pools and synchronization.
This article explains the purpose, benefits, core APIs, implementation classes, execution flow, state management, and monitoring methods of Java thread pools, providing detailed code examples and diagrams to help developers understand and effectively use thread pooling in high‑concurrency applications.
This article details recent updates to a performance testing framework, including moving the mark feature into ThreadBase, changing method signatures, introducing two virtual thread limit classes for count‑based and time‑based execution, optimizing after() handling, and abandoning deep‑copy cloning for thread objects.
This article summarizes the Tongtian Tower backend performance optimization experience, detailing background, achieved improvements of 10‑30%, optimization principles, testing methods, metric analysis, and concrete strategies such as RPC scheduling, JVM tuning, logging, thread‑pool and code refinements to enhance latency and throughput.
This comprehensive guide explains Java thread pool fundamentals, creation methods, core parameters, rejection policies, execution flow, common work queues, and shutdown techniques, while providing interview questions, source‑code analysis, and practical code examples for robust concurrent programming.
This article examines the JD.com product detail page backend architecture, analyzes memory, thread, and CPU usage, and outlines a three‑stage optimization roadmap—including parallelization, JVM/Tomcat upgrades, thread‑pool tuning, and asynchronous refactoring—to handle massive traffic spikes.
This article explains the definition of Java thread pools, why creating them via Executors is discouraged, details the ThreadPoolExecutor constructor and parameters, compares different Executors factory methods, demonstrates OOM risks with tests, and offers guidelines for configuring thread pool size and rejection policies.
The article explains why creating and destroying threads directly is inefficient and risky for high‑traffic services, then introduces thread pools as a solution, detailing four common pool types with code examples, their advantages, limitations, and overall impact on system performance.
An experiment demonstrates that CPU‑intensive encryption tasks do not block Node.js when the number of concurrent tasks does not exceed libuv’s default four‑thread pool, but adding a fifth task causes blocking, illustrating how libuv’s thread pool size and environment variable UV_THREADPOOL_SIZE affect concurrency.
A sudden Dubbo service hang was traced to thread‑pool exhaustion after 500 concurrent HTTP calls, each blocked by an overly long read‑timeout and processed through a hidden 5‑thread queue, causing a 200‑second backlog that flooded the Dubbo pool with hundreds of thousands of tasks.
This article dives deep into Node.js internals, explaining why the runtime is both single‑threaded and multi‑threaded, how the event loop, libuv thread pool, epoll/kqueue, and worker_threads collaborate to deliver non‑blocking I/O and efficient concurrency.
This article explains why simply increasing thread‑pool size often fails, describes how CPU, network and disk I/O affect request handling, introduces the concept of context switching, and provides practical formulas and guidelines for calculating the optimal number of threads in a Java backend service.
This article explains the concept of fault tolerance in software architecture, illustrates why thread‑pool isolation is essential for preventing cascading failures, and provides concrete Java implementations—including code examples, pros and cons, and practical guidance for applying the technique in real‑world backend systems.
This article explains the origin of Java thread pools, outlines their advantages and potential risks such as deadlocks and resource exhaustion, describes their internal states and processing flow, provides guidance on sizing for CPU‑ or I/O‑bound tasks, and reviews the four common thread‑pool implementations.
This article offers a thorough tutorial on Java multithreading, explaining processes versus threads, thread creation approaches, lifecycle states, priority handling, and various safe and unsafe ways to stop threads, complete with practical code examples and best‑practice warnings.
This article explains how to ensure high availability in microservice architectures by properly configuring Hystrix resource isolation, thread‑pool sizes, request timeout values, and fallback strategies, illustrated with real‑world production examples and diagrams.
This article explains Python's threading support, covering the thread and threading modules, ways to create threads, join and daemon settings, synchronization primitives, queue-based communication, thread pool usage and custom implementation, and the impact of the Global Interpreter Lock.
This article provides a comprehensive analysis of Java's ThreadPoolExecutor source code, covering class relationships, core interfaces, abstract implementations, internal fields, constructors, the Worker class, and detailed walkthroughs of key methods such as execute, addWorker, runWorker, getTask, processWorkerExit, tryTerminate, and idle thread interruption, plus monitoring techniques.
This article explains the difference between kill -9 and kill -15 signals, how Spring Boot processes the TERM signal, and provides practical code examples for implementing graceful shutdown, including shutdown hooks, DisposableBean, and proper thread‑pool termination strategies.
TXSQL is Tencent Cloud’s MySQL‑based kernel, engineered to handle massive scale, improve stability, performance, and security for diverse industries, featuring optimized redo‑logs, thread‑pool handling, encryption, audit plugins, and parallel replication, with a rigorous release process and future plans for engine‑level batch computation and RocksDB integration.
This article explains how ServiceComb builds on Vert.x to support both reactive and synchronous communication modes, details the thread models for single and multiple connections, presents performance improvements through CAS queues and multi‑connection setups, and outlines flexible thread‑pool strategies for microservice providers and consumers.
This article explains why MySQL thread pool is essential for high‑concurrency workloads, details its architecture and key parameters, provides step‑by‑step configuration examples, and shares real‑world troubleshooting cases such as memory leaks and connection‑timeout issues, along with practical solutions.
The article explains MySQL’s thread‑pool technology—its motivation, architecture of listener, worker, timer threads and priority queues, key configuration variables, how to enable it, and common pitfalls such as memory leaks, monitoring timeouts, and group‑level saturation, offering practical guidance for DBAs.
This article recounts a 2017 internal high‑performance competition where a C server handling a 40 million‑row user‑info dataset was progressively optimized through data compression, custom hash tables, memory layout redesign, and a thread‑pool model, ultimately achieving a four‑fold throughput increase.
The article explains why Percona‑MySQL 5.6 experiences occasional high‑latency connections, analyzes the role of thread pools and thread cache settings, and shows step‑by‑step how increasing thread_cache_size to match active connections eliminates the slowdown.
This article explains how Java ThreadLocal works internally, details its core methods and internal classes, analyzes the relationship between Thread, ThreadLocalMap, and WeakReference, and discusses memory‑reclamation strategies and potential OOM issues when used with thread pools.
Learn how Java thread pools work, why uncontrolled thread creation harms performance, and how to use the JDK Executor framework—including key methods, common configurations, and pitfalls like silent errors with submit—to build efficient, scalable concurrent applications.
To maximize Elasticsearch bulk-indexing speed, temporarily disable refreshes and replicas, tune merge throttling and scheduler threads, enlarge translog and index buffer thresholds, and adjust indexing and bulk thread-pool sizes, then restore defaults after the load completes.
This article revisits Java thread pools, explains the concept of pooling, details the structure and parameters of ThreadPoolExecutor, describes its execution flow, rejection policies, hook methods, lifecycle states, and offers guidance on sizing and extending thread pools for real‑world applications.
This article compiles and clarifies forty common Java multithreading interview questions, covering thread creation, synchronization mechanisms, thread pools, memory model, and practical debugging techniques to help developers deepen their understanding and prepare for technical interviews.
This article introduces the java.util.concurrent package introduced since JDK 5, explains the five thread‑pool creation methods, demonstrates how to use Runnable and Callable, details BlockingQueue operations and implementations, and summarizes best practices for building robust, high‑concurrency Java applications.
This article details a performance comparison of MySQL 5.6.19 and Percona 5.6.25 with and without InnoDB deadlock detection, using sysbench to simulate flash‑sale stock‑decrement scenarios, and shows how turning off deadlock checks and enabling thread‑pool can boost throughput by over a hundred times.
This article introduces HappyPack—a webpack plugin that speeds up builds by running loaders in parallel processes—covers its configuration, internal architecture including thread‑pool management, RPC handling, caching mechanisms, and provides detailed code examples to illustrate its integration and operation.
This article presents a detailed design and implementation of an asynchronous, parallel batch processing framework that tackles massive user data handling challenges by sharding databases, leveraging async HLR commands, configurable thread pools, and JMX monitoring to achieve high performance and reliability.
This article walks through a real‑world project's performance evolution, detailing server specs, a litany of scalability and reliability problems, and concrete code‑level solutions such as database deadlock mitigation, transaction shortening, thread‑pool redesign, and logging improvements.
This article examines the performance bottlenecks of a no‑card payment platform—including database deadlocks, overly long transactions, CPU saturation, unbounded thread pools, and excessive logging—and presents concrete backend‑level refactorings, configuration changes, and code examples that dramatically improve scalability and reliability.
A metaphorical story follows a newly created thread as it learns about extracting request parameters, performing login, handling CPU scheduling, using caches, encountering deadlocks, and ultimately witnessing a system reboot, illustrating core concepts of multithreading, concurrency control, and thread‑pool lifecycle.
This article analyzes the core principles and components of thread pools, explains why they are essential for performance and flow control, and compares the concrete implementations in JDK, Jetty 6, Jetty 8, and Tomcat, providing guidance for developers who wish to use or customize thread pools.