바뀜

둘러보기로 가기 검색하러 가기
1,861 바이트 제거됨 ,  2021년 5월 9일 (일) 22:37
편집 요약 없음
</pre>
 
== 미러 서버의 대역폭 설정(wondershaper 이용)==
 
=== wondershaper 설치 ===
 
<pre>
$ sudo apt install wondershaper
</pre>
 
=== 시스템 재시작 시에도 wondershaper 설정이 되도록 하기 <ref>https://sleeplessbeastie.eu/2020/07/01/how-to-limit-bandwidth-on-specific-network-interface/</ref> <ref>https://documentation.online.net/en/dedicated-server/tutorials/network/configure-wondershaper#launch_wondershaper_automatically_on_boot_with_systemd</ref> ===
wondershaper로 이더넷 장치에 대역폭을 설정해도, 리부팅하면 설정이 초기화됩니다. 따라서 부팅할 때 마다 wondershaper를 적용하도록 해야합니다.
 
/etc/systemd/wondershaper.conf에 아래 내용을 추가합니다. 저는 다운로드 및 업로드 속도를 모두 10Mbit/s로 제한했습니다.
 
<syntaxhighlight lang="diff">
+ [wondershaper]
+ # Adapter
+ IFACE="eth0"
+
+ # Download rate in Kbps
+ DSPEED="10240"
+
+ # Upload rate in Kbps
+ USPEED="10240"
</syntaxhighlight>
 
/usr/lib/systemd/system/wondershaper.service에 아래 내용을 추가합니다.
 
<syntaxhighlight lang="diff">
+ [Unit]
+ Description=Bandwidth shaper/Network rate limiter
+ After=network.target
+ Wants=network.target
+
+ [Service]
+ Type=oneshot
+ RemainAfterExit=yes
+ EnvironmentFile=/etc/systemd/wondershaper.conf
+ ExecStart=/usr/sbin/wondershaper $IFACE $DSPEED $USPEED
+ ExecStop=/usr/sbin/wondershaper clear $IFACE
+
+ [Install]
+ WantedBy=multi-user.target
</syntaxhighlight>
 
wondershaper.service 서비스를 시작합니다.
 
<pre>
$ sudo systemctl start wondershaper.service
</pre>
 
부팅할 때 wondershaper.service를 시작하도록 설정합니다.
 
<pre>
$ sudo systemctl enable wondershaper.service
Created symlink /etc/systemd/system/multi-user.target.wants/wondershaper.service → /lib/systemd/system/wondershaper.service.
</pre>
== 참고 ==

둘러보기 메뉴