1
0
mirror of https://github.com/coturn/coturn.git synced 2025-12-24 17:31:00 +01:00

139 Commits

Author SHA1 Message Date
Copilot
99984fbccd
Add configurable CPU count option for containerized environments (#1717)
This PR adds a new `--cpus` configuration option to address CPU
detection issues in virtualized and containerized environments where
`_SC_NPROCESSORS_CONF` and `_SC_NPROCESSORS_ONLN` return host CPU counts
instead of allocated container CPUs.

## Problem
In containerized deployments, coturn detects the host's CPU count (e.g.,
128 CPUs) instead of the container's allocated CPUs (e.g., 2 CPUs). This
causes the server to create excessive relay threads and database
connections, leading to resource exhaustion and performance issues.

## Solution
Added a new `cpus` configuration option that allows manual override of
CPU detection:

### Command Line Usage
```bash
turnserver --cpus 2
```

### Configuration File Usage
```ini
# Override system CPU count detection for containers
cpus=2
```

## Key Features
- **Backward Compatible**: No changes needed for existing deployments
- **Input Validation**: Values must be between 1 and 128 with proper
error handling
- **Comprehensive Documentation**: Updated man pages and example config
files
- **Both Interfaces**: Works via command line and configuration file

## Testing
The implementation has been thoroughly tested:

```bash
# Container with 2 allocated CPUs on 128-CPU host
$ turnserver --cpus 2
INFO: System cpu num is 128       # Host detection
INFO: System enable num is 128    # Host detection  
INFO: Configured cpu num is 2     # Override applied
INFO: Total General servers: 2    # Correct thread count
```

-  Command line option: `--cpus 8` creates 8 relay servers
-  Config file option: `cpus=6` creates 6 relay servers  
-  Error handling: Invalid values show appropriate errors
-  Default behavior: Without option, uses system detection
-  RFC5769 tests: All protocol tests still pass

## Files Modified
- `src/apps/relay/mainrelay.c` - Core implementation
- `src/apps/relay/mainrelay.h` - Added configuration flag
- `examples/etc/turnserver.conf` - Added documentation and example
- `man/man1/turnserver.1` - Updated man page

This change directly addresses the resource consumption issues in
containerized environments while maintaining full backward
compatibility.

Fixes #1628.
2025-07-10 15:37:02 +02:00
Pavel Punsky
cc5e18fc89
Make older TLS versions optional (#1693)
TLSv1 and TLSv1.1 can be enabled using `--tlsv1` and `--tlsv1_1`
arguments accordingly
That assumes openssl version being used has these versions enabled
(which as of openssl-3.5 is not by default)
2025-05-30 09:20:14 -07:00
Pavel Punsky
368355a06f
Invert RFC5780 option to default off (#1688)
Invert `--no-rfc5780` option to be true by default
Make it `--rfc5780` to enable it
Update example/recommended configuration files

Passing `--no-rfc5780` will have no effect as this is the default
behavior now
2025-05-28 15:08:57 -07:00
vuittont60
da6bc6b0c4
Fix typos (#1345) 2024-01-15 18:31:16 -08:00
Molly Miller
902cb99849
Add configuration option for TLS 1.3 ciphersuites (#1118)
There are two different API's in OpenSSL for configuring TLS ciphers,
one for TLS 1.2 and below, and another for TLS 1.3. coturn only calls
the TLS 1.2 API when handling the `--cipher-list` configuration option,
which means that it's not possible to use non-default ciphersuites with
TLS 1.3 connections.

This PR calls appropriate OpenSSL API to allow TLS 1.3 ciphersuites to be configured.
2022-12-16 15:53:36 -08:00
Molly Miller
bc1678cc52
Regenerate manual pages from README files (#1117)
This PR fixes some typos and formatting, and regenerates the manual
pages from the README files. These changes were originally included in
#1105, however I've split them out into a separate PR as requested.
2022-12-06 17:04:13 -08:00
Gustavo Garcia
bf54410bc7
Merge branch 'sysvinit/toggle-username-labels-upstream' of github.com:wireapp/coturn into wireapp-sysvinit/toggle-username-labels-upstream 2022-07-29 09:47:17 +02:00
Gustavo Garcia
ecdc8893ee
Merge pull request #840 from lionelnicolas/feature/prometheus-port
Add ability to configure prometheus listener port
2022-07-29 01:03:58 +02:00
Molly Miller
6fd08bac3b Invert logic for handling username metrics labels. 2022-07-27 10:44:13 +02:00
Molly Miller
299fcea34c Make username labeling in metrics configurable. 2022-06-20 14:34:35 +01:00
Benjamin Porter
45e8217dbe Fix typo aa -> a 2021-11-18 10:46:31 -07:00
Lionel Nicolas
19495b2d1d Add ability to configure prometheus listener port 2021-10-22 19:47:49 -04:00
Lionel Nicolas
c42cd844de Fix typo and formatting in --prometheus documentation 2021-10-22 19:47:16 -04:00
Mészáros Mihály
4ee8f8e7d8 Update man pages 2021-06-05 22:10:31 +02:00
Mészáros Mihály
398a606744 Update man after README change 2021-06-05 22:10:31 +02:00
Mészáros Mihály
2204778ce1 Replace keep-address-family with allocation-default-address-family 2021-03-12 23:05:18 +01:00
Mészáros Mihály
104ab83f09 Automatically notify systemd if compiled 2021-01-10 20:57:43 +01:00
Mészáros Mihály
c6347d4c84 Fix typo 2021-01-08 09:44:03 +00:00
Mészáros Mihály
ef7916842d Add systemd notification support 2021-01-07 17:51:34 +00:00
Mészáros Mihály
14f1630ec6 Fix stale-nonce documentation Resolves #604 2021-01-05 10:25:10 +00:00
Mészáros Mihály
27b261eb58 Disable binding logging to avoid DoS attack
* Add new option log-binding
2021-01-05 09:55:55 +00:00
Mészáros Mihály
1300021c6f Correct acme-redirect man and readme 2020-12-15 13:36:02 +00:00
Mészáros Mihály
fa01cfeed6 Move acme to new file 2020-12-15 13:25:56 +00:00
Jens Elkner
02d62e828d acme-redirect: add option to man page, fix help text 2020-12-15 13:24:10 +00:00
Mészáros Mihály
d4686750ee Move acme to new file 2020-12-15 13:04:11 +00:00
Jens Elkner
9b0dd4380c acme-redirect: add option to man page, fix help text 2020-12-15 13:01:51 +00:00
Mészáros Mihály
08bb62ea88 Update README to fix #658 2020-12-08 13:40:49 +01:00
Mészáros Mihály
b0fb4a9a0a Rename new timestamp options, and fix these cli handling 2020-12-08 11:51:25 +01:00
Mészáros Mihály
9a0d9d8c5d Replace new-timestamp_format=>new-timestamp-format 2020-12-08 11:07:53 +01:00
Mészáros Mihály
50f789ab5a Add new timestamp options to the README and man 2020-12-08 10:44:40 +01:00
Mészáros Mihály
29d5c66263 Update man after README change 2020-12-07 15:28:05 +01:00
Mészáros Mihály
388d939ed9 Change prometheus exporter port to 9641 2020-08-03 14:24:20 +02:00
Mészáros Mihály
c9cd99e4f5 Disable prometheus by default 2020-08-03 10:25:56 +02:00
Mészáros Mihály
2acb952670 tidy after PR #517 2020-07-08 09:47:24 +02:00
Mészáros Mihály
82892a2c1c update man, run make-man.sh 2020-04-29 22:00:04 +02:00
Greg Fodor
38e7daf3d6 Merge remote master 2020-04-28 17:18:30 +00:00
Greg Fodor
7c1573ddb9 Update manpages and README 2020-04-28 17:17:21 +00:00
Mészáros Mihály
5b65099678 update Changelog and update man 2020-04-28 10:15:43 +02:00
Mészáros Mihály
991a82e104
Merge branch 'master' into master 2020-04-28 09:47:20 +02:00
Mészáros Mihály
70a93345e4 Update changelog, update man 2020-04-28 09:22:01 +02:00
Mészáros Mihály
1e4456ea92
Merge pull request #506 from dbrgn/rename-prod
Rename "prod" config option to "no-software-attribute"
2020-04-28 09:18:51 +02:00
Mészáros Mihály
a0de548357 Update man and Changelog 2020-04-28 09:16:30 +02:00
Mészáros Mihály
fb8dc8a736 Change DH key size default from 1066 to 2066 2020-04-15 22:07:26 +02:00
Danilo Bargen
520e172b22 Rename "prod" config option to "no-software-attribute"
As discussed in https://github.com/coturn/coturn/pull/478, if the
parameter only controls whether or not to send the software attribute
and not other production-relevant configurations, it should be named
accordingly.

The old --prod configuration option still works, but is now deprecated
and undocumented.
2020-03-13 11:03:05 +01:00
Bertold Van den Bergh
ace903fd07 Add support for loadbalanced TCP connections (haproxy protocol v2) 2020-02-13 01:56:43 +01:00
Mészáros Mihály
33692365ad Fix typo in README and run make-man.sh 2020-02-12 11:06:41 +01:00
Corey Cole
7af87e8107
docs(turnadmin): fix typo 2019-12-30 10:29:25 -08:00
chanduthedev
c317a19334 Some more typo's fixed 2019-10-16 13:56:32 +08:00
Mészáros Mihály
856c3c9ff6 Fix typos and other regressions 2019-01-29 14:47:56 +01:00
Mészáros Mihály
267f7a28db Merge branch 'master' into fixes 2018-10-31 11:05:25 +01:00