Setting up the connection queue in HTTP mode
The connection queue contains pending connections to Kaspersky Scan Engine. By configuring the connection queue, you can influence the performance of Kaspersky Scan Engine in HTTP mode. This section explains how to configure the connection queue.
Three parameters allow you to configure the connection queue: MaxHTTPSessionsNum
, MaxIncomingConnectionsNum
, and ThreadsCount
. These parameters can be set in the HTTP mode configuration file.
MaxHTTPSessionsNum
This parameter specifies the maximum number of active TCP connections that Kaspersky Scan Engine can maintain simultaneously. When a TCP connection with a client closes, Kaspersky Scan Engine can accept another connection in its place.
MaxIncomingConnectionsNum
This parameter specifies the maximum number of pending TCP connections to Kaspersky Scan Engine. If the number of pending connections reaches MaxIncomingConnectionsNum
, additional connections may be dropped.
ThreadsCount
This parameter specifies the maximum number of simultaneously running scan threads. When a scan thread completes a scanning task, it picks up another one from the scan queue.
Examples of the connection queue configuration
These examples show how you can use the connection queue to influence the behavior of Kaspersky Scan Engine.
- Kaspersky Scan Engine without a connection queue
Consider the following example: the value of
MaxIncomingConnectionsNum
is16
, the value ofThreadsCount
is16
, and the value ofMaxHTTPSessionsNum
is50
. In this example, Kaspersky Scan Engine can accept only16
connections at a time, but becauseMaxHTTPSessionsNum
is50
, their scan tasks are accepted immediately. Additional connections may be dropped. Sixteen scan threads is usually enough to process scan tasks from 16 clients quickly, so the scan queue will be short. - Kaspersky Scan Engine with a connection queue
Consider the following example: the value of
MaxIncomingConnectionsNum
is100
, the value ofThreadsCount
is16
, and the value ofMaxHTTPSessionsNum
is50
. In this example, Kaspersky Scan Engine can accept50
connections at a time. Kaspersky Scan Engine starts processing scan tasks from some of these clients in16
scan threads, and the rest of the scan tasks form the scan queue. Other pending connections form the connection queue and wait to be accepted. Additional connections may be dropped.