Skip to main content

A daemon that spawns a specified command to handle each connection, and dampens connection bursts

Project description

socket-burst-dampener

A daemon that spawns a specified command to handle each connection, and dampens connection bursts.

Motivation

It is typical to configure a forking daemon such as rsync so that it will respond with an error when a maximum number of concurrent connections has been exceeded. Alternatively, it may be desirable to queue excess connections, and service them in the order of arrival while taking care to ensure that too many processes are not spawned at once. The socket-burst-dampener daemon applies this behavior to any daemon command that works with inetd.

On Linux, the net.core.somaxconn sysctl setting specifies the queue length for completely established sockets waiting to be accepted. It may also be useful to adjust the maximum queue length for incomplete sockets that is controlled by the net.ipv4.tcp_max_syn_backlog sysctl setting (mentioned in the listen(2) man page).

Usage

usage: socket-burst-dampener [-h] [--address ADDRESS] [--ipv4] [--ipv6]
                             [--load-average LOAD] [--processes PROCESSES]
                             [-v]
                             PORT CMD [ARG [ARG ...]]

  socket-burst-dampener
  A daemon that spawns a specified command to handle each connection, and dampens connection bursts

positional arguments:
  PORT                  listen on the given port number
  CMD                   command to spawn to handle each connection
  ARG                   argument(s) for CMD

optional arguments:
  -h, --help            show this help message and exit
  --address ADDRESS     bind to the specified address
  --ipv4                prefer IPv4
  --ipv6                prefer IPv6
  --load-average LOAD   don't accept multiple connections unless load is below
                        LOAD
  --processes PROCESSES
                        maximum number of concurrent processes (0 means
                        infinite, default is 1)
  -v, --verbose         verbose logging (each occurence increases verbosity)

Example with rsync

socket-burst-dampener 873 --processes $(nproc) --load-average $(nproc) -- rsync --daemon

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

socket_burst_dampener-1.3.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

socket_burst_dampener-1.3.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file socket_burst_dampener-1.3.4.tar.gz.

File metadata

  • Download URL: socket_burst_dampener-1.3.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for socket_burst_dampener-1.3.4.tar.gz
Algorithm Hash digest
SHA256 faaa3270454934d8efcb1ead67c16ca4820f010c3d92715f4824acad42d3a00e
MD5 05e04acad1e20d3643b76188433b9d1a
BLAKE2b-256 61c975c634168ad32d835f24a6f5d5b3e852ac6755fe174f0702cf1a7e45d5c2

See more details on using hashes here.

File details

Details for the file socket_burst_dampener-1.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for socket_burst_dampener-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6c0f8e452521f4abe7795afb445f5bedcfe88987b3d122da90634edae6bf476a
MD5 6716003230445dd231c1557f0c050888
BLAKE2b-256 425ba35e14cc0f02179811219fb4c107e072139b89000474891b21d9b10e94f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page