INF: SQL NT Thread Pooling

Last reviewed: April 3, 1997
Article ID: Q110673

The information in this article applies to:

  - Microsoft SQL Server, version 4.2

SUMMARY

Microsoft SQL Server uses a concept called thread pooling to optimize performance when very large numbers of clients are connected.

MORE INFORMATION

Normally, a separate operating system thread is spawned for each client connection. This thread-per-connection architecture consumes less system overhead than the process-per-connection approach of some other products. However, at very high connection numbers (usually hundreds), even using a thread-per-connection can consume operating system overhead. Therefore, SQL Server can use a technique called thread pooling, whereby a pool of worker threads services a larger number of client connections.

By default, this worker thread limit is 255, and can be viewed or changed with sp_configure, as "max worker threads."

When this limit is reached, the SQL Server kernel message:

   The working thread limit of 255 has been reached

is printed in the errorlog.

Below this point, a new thread is spawned for each user connection. Above this thread limit, new connections will share the existing pool of worker threads. Since there are then more connections than threads, each new request is handled by the next worker thread that completes its current task. This process is quite efficient, as it is uncommon to have more than 255 (or whatever the max worker thread setting is) pending requests, even on a system with hundreds of clients.


Additional query words: 4.20 Windows NT
Keywords : kbother SSrvGen kbtshoot
Version : 4.2
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.