From 8769d0bac3a660378fb957acd91b8e7cb418af1a Mon Sep 17 00:00:00 2001 From: Erik Groh Date: Thu, 19 Jun 2025 11:34:22 +0200 Subject: [PATCH 1/4] Added documentation and example code for traffic shaping on OS-level only for the sunshine port --- docs/troubleshooting.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 8bd22eede26..e2d9b9c11b2 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -86,7 +86,31 @@ client having only a 100 Mbps interface. As a workaround the transmission speed of the host NIC can be reduced: 1 Gbps instead of 2.5 or 100 Mbps instead of 1 Gbps. (A technically more advanced solution would be to configure traffic shaping rules at the OS-level, so that -only Sunshine's traffic is slowed down.) +only Sunshine's traffic is slowed down.) + +Such a solution on Linux could look like that: +``` +# 1) Remove existing qdisc (pfifo_fast) +sudo tc qdisc del dev root + +# 2) Add HTB root qdisc with default class 1:1 +sudo tc qdisc add dev root handle 1: htb default 1 + +# 3) Create class 1:1 for full 10 Gbit/s (all other traffic) +sudo tc class add dev parent 1: classid 1:1 htb \ + rate 10000mbit ceil 10000mbit burst 32k + +# 4) Create class 1:10 for Sunshine game stream at 1 Gbit/s +sudo tc class add dev parent 1: classid 1:10 htb \ + rate 1000mbit ceil 1000mbit burst 32k + +# 5) Filter UDP source port 47998 into class 1:10 +sudo tc filter add dev protocol ip parent 1: prio 1 \ + u32 match ip protocol 17 0xff \ + match ip sport 47998 0xffff flowid 1:10 +``` +In that way only the Sunshine traffic is limited by 1 Gbit. This is not persistent on reboots. +If you use a different port for the game stream you need to adjust the last command. Sunshine versions > 0.23.1 include improved networking code that should alleviate or even solve this issue (without reducing the NIC speed). From e7501aa4de1c319cf49c44d7baa0e992194a9258 Mon Sep 17 00:00:00 2001 From: Erik Groh Date: Thu, 19 Jun 2025 11:37:43 +0200 Subject: [PATCH 2/4] Added documentation and example code for traffic shaping on OS-level only for the sunshine port --- docs/troubleshooting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index e2d9b9c11b2..54e9103edec 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -84,9 +84,9 @@ client only 1 Gbit/s or Wi-Fi. Similarly, a 1 Gbps host may be too fast for a client having only a 100 Mbps interface. As a workaround the transmission speed of the host NIC can be reduced: 1 Gbps -instead of 2.5 or 100 Mbps instead of 1 Gbps. (A technically more advanced +instead of 2.5 or 100 Mbps instead of 1 Gbps. A technically more advanced solution would be to configure traffic shaping rules at the OS-level, so that -only Sunshine's traffic is slowed down.) +only Sunshine's traffic is slowed down. Such a solution on Linux could look like that: ``` From 13995eb9650cdeeec6e07b9057607ba3630c0cb3 Mon Sep 17 00:00:00 2001 From: Erik Groh Date: Tue, 29 Jul 2025 17:57:28 +0200 Subject: [PATCH 3/4] Update docs/troubleshooting.md Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> --- docs/troubleshooting.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 54e9103edec..06fc76ea045 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -89,7 +89,8 @@ solution would be to configure traffic shaping rules at the OS-level, so that only Sunshine's traffic is slowed down. Such a solution on Linux could look like that: -``` + +```bash # 1) Remove existing qdisc (pfifo_fast) sudo tc qdisc del dev root From d47c81bea0254ed24b3f45e8d2bca192a8d9bc00 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:11:37 -0400 Subject: [PATCH 4/4] Update docs/troubleshooting.md --- docs/troubleshooting.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 06fc76ea045..479956bb164 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -110,6 +110,7 @@ sudo tc filter add dev protocol ip parent 1: prio 1 \ u32 match ip protocol 17 0xff \ match ip sport 47998 0xffff flowid 1:10 ``` + In that way only the Sunshine traffic is limited by 1 Gbit. This is not persistent on reboots. If you use a different port for the game stream you need to adjust the last command.