From 65e257effb70dc12eb9c7162ad52580474838169 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 30 Nov 2023 02:31:10 +0100 Subject: [PATCH] systemd,manual: set LimitNOFILE=65536 A typical OS imposed limit is 1024 open FD, which is too low when there are hundreds of BTS. In systemd service file, set a super high limit of 65536. In osmo-bsc's user manual, add section 'Configure limits' describing this in detail. Related: OS#6256 Change-Id: I26c4058484b11ff1d035a919bf88824c3af14e71 --- contrib/systemd/osmo-bsc.service | 1 + doc/manuals/chapters/running.adoc | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service index a345c474e..c8dc877c3 100644 --- a/contrib/systemd/osmo-bsc.service +++ b/contrib/systemd/osmo-bsc.service @@ -7,6 +7,7 @@ Wants=network-online.target [Service] Type=simple Restart=always +LimitNOFILE=65536 StateDirectory=osmocom WorkingDirectory=%S/osmocom ExecStart=/usr/bin/osmo-bsc -c /etc/osmocom/osmo-bsc.cfg -s diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc index 9ff546c40..0c6d4fb9b 100644 --- a/doc/manuals/chapters/running.adoc +++ b/doc/manuals/chapters/running.adoc @@ -69,6 +69,24 @@ To run multiple OsmoBSC instances on the same A-interface (SCCP/M3UA), each BSC has to configure a distinct point-code. See <>. +=== Configure limits + +When connecting hundreds of TRX to OsmoBSC, it may be necessary to adjust the +operating system's limit on open file descriptors for the osmo-bsc process. A +typical default limit imposed by operating systems is 1024; this would be +exceeded by, for example, about 205 BTS with 4 TRX each. (Each BTS with 4 TRX +requires 5 file descriptors for Abis; 205 * 5 already exceeds 1024, sockets for +other interfaces not considered yet.) + +It should be ok to set an OS limit on open file descriptors as high as 65536 +for osmo-bsc, which practically rules out failure from running out of file +descriptors anywhere (<50,000 TRX). + +When using systemd, the file descriptor limit may be adjusted in the service +file by the `LimitNOFILE` setting ("Number of Open FILE descriptors"). OsmoBSC +ships a systemd service file with a high LimitNOFILE setting. + + === Configure primary links ==== Connect to an MSC's _A_ interface