IP Library Granted Patent US 7,363,369
Granted Patent B2
US 7,363,369 · App. 10/687,236 · Granted Apr 22, 2008

Monitoring thread usage to dynamically control a thread pool

Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,363,369
App. No.
10/687,236
Granted
Apr 22, 2008
Kind
B2
Abstract

A method, system, and program for monitoring thread usage to dynamically control a thread pool are provided. An application running on the server system invokes a listener thread on a listener socket for receiving client requests at the server system and passing the client requests to one of multiple threads waiting in a thread pool. Additionally, the application sends an ioctl call in blocking mode on the listener thread. A TCP layer within the server system detects the listener thread in blocking mode and monitors a thread count of at least one of a number of incoming requests waiting to be processed and a number of said plurality of threads remaining idle in the thread pool over a sample period. Once the TCP layer detects a thread usage event, the ioctl call is returned indicating the thread usage event with the thread count, such that a number of threads in the thread pool may be dynamically adjusted to handle the thread count.

Claims (18)

1. A method for monitoring thread usage in a server system, comprising:

sending an ioctl call in blocking mode on a socket designated for listening for incoming client requests to a server communicatively connected to a network and passing said incoming client requests to one from among a plurality of threads waiting in a thread pool;

responsive to a TCP layer detecting said listen socket in blocking mode, monitoring a thread count of at least one of a number of incoming requests waiting to be processed and a number of said plurality of threads remaining idle in said thread pool over a sample period; and

responsive to said TCP layer detecting a thread usage event, returning said ioctl call back with said thread count, such that a number of threads in said thread pool is dynamically adjusted to handle said thread count.

2. The method according to claim 1 for monitoring thread usage wherein said monitoring a thread count further comprises setting a counter to monitor said number of incoming requests waiting to be processed over a particular number of TCP slow timer processing cycles.

3. The method according to claim 1 for monitoring thread usage wherein said monitoring a thread count further comprises monitoring a minimum number of said number of threads remaining idle over said sample period.

4. The method according to claim 1 for monitoring thread usage further comprising:

dynamically adjusting a number of active threads in said thread pool according to said thread count to handle a current load.

5. The method according to claim 1 for monitoring thread usage further comprising:

initiating a TCP slow timer cycle;

processing all of a plurality of sockets during said TCP slow timer cycle;

responsive to completing said processing of all of said plurality of sockets, comparing said thread count with a threshold;

responsive to said thread count exceeding said threshold, designating a thread usage event with said number of incoming requests waiting to be processed; and

responsive to said thread count equaling zero after said sample period, designating a thread usage event with said number of threads remaining idle.

6. A method for monitoring thread usage to dynamically adjust a number of active threads in a thread pool of a server system, comprising:

sending an ioctl call in blocking mode on a socket designated for listening for incoming client requests to a server system communicatively connected to a network and passing said incoming client requests to one from among a plurality of active threads waiting in a thread pool;

responsive to a TCP layer of said server system detecting a thread usage event, receiving said ioctl call back with a thread count of at least one of a number of incoming requests waiting to be processed and a number of said plurality of threads remaining idle in said thread pool over a sample period; and

dynamically adjusting said number of active threads in said thread pool according to said thread count, such that said server system dynamically adjusts said thread pool to handle a current load.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 16, 2003
From: BANERJEE, DWIP N.; BARATAKKE, KAVITHA VITTAL MURTHY; JAIN, VINIT; VENKATSUBRA, VENKAT
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 014618/0414 →
Continuity (1)
Related Publication 20050086359A1 · Apr 21, 2005