Skip to content

Documentation: document nofile ulimit for Docker deployments #39

Description

@jakvot

Goal

Document the recommended Docker file-descriptor limit so users do not get:

2048 worker_connections exceed open file resource limit: 1024

Proposed README change

Add the following immediately below the basic Docker Compose example:

Recommended file-descriptor limit

OpenSpeedTest uses Nginx with worker_connections configured for 2048 connections. Some Docker/container environments provide a default soft nofile limit of 1024, which causes an Nginx startup warning.

For higher-concurrency deployments, set the container file-descriptor limit explicitly:

version: '3.3'

services:
  speedtest:
    restart: unless-stopped
    container_name: openspeedtest
    image: openspeedtest/latest
    ports:
      - '3000:3000'
      - '3001:3001'
    ulimits:
      nofile:
        soft: 65535
        hard: 65535

Equivalent Docker command-line option:

--ulimit nofile=65535:65535

The nofile limit is a Docker/container runtime setting and does not need to be configured inside the Nginx configuration.

Rationale

The OpenSpeedTest Docker image currently uses nginxinc/nginx-unprivileged:stable-alpine, while its Nginx configuration uses a higher worker_connections value. Docker environments with a soft RLIMIT_NOFILE of 1024 therefore emit a warning during startup.

This PR deliberately does not reduce worker_connections, because doing so would merely make the configured Nginx capacity match an unnecessarily low runtime limit.

Scope

Documentation only.

No application behavior or Nginx configuration changes are required.

Validation

Verify the documented Compose configuration with:

docker compose up -d
docker exec openspeedtest sh -c 'ulimit -n'
docker logs openspeedtest 2>&1 | grep -i 'worker_connections'

Expected result:

65535

and no worker_connections exceed open file resource limit warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions