New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Helpful script to speed up vps network connectivity
Hi all,
most of you are probably way more technical than me however i thought i'd share what i enable immediately after i setup a vps to optimize the network speed and in my tests it does work so i created a script and thought i'd share what i enable and my settings, if anyone else has suggestions to add to this happy to hear.
#!/bin/bash
echo 'net.core.wmem_max=12582912' >> /etc/sysctl.conf
echo 'net.core.rmem_max=12582912' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_rmem= 10240 87380 12582912' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_wmem= 10240 87380 12582912' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_window_scaling = 1' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_timestamps = 1' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_sack = 1' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_no_metrics_save = 1' >> /etc/sysctl.conf
echo 'net.core.netdev_max_backlog = 5000' >> /etc/sysctl.conf
echo 'net.ipv4.icmp_echo_ignore_all=1' >> /etc/sysctl.conf
echo 'net.core.default_qdisc=fq' >> /etc/sysctl.conf
echo 'net.ipv4.tcp_congestion_control=bbr' >> /etc/sysctl.conf
sysctl -p
echo 'Done'
Thanked by 1JasonM
Comments
You shouldn't modify
/etc/sysctl.conf
directly.Instead, create a new file in
/etc/sysctl.conf.d
directory.Yes each file store single configuration, easier to manage.
[EDIT] To op, did you know what those command do ?
as far as i know enhance tcp packets?
I once used this kind of so called Linux optm parameter into sysctl.conf , then my page static resources loading time increases from like 0.3 second to 3 seconds
happy to hear suggestions or you optimized settings
My setup procedure only enables BBR congestion control.
I don't fiddle with buffer sizes.
I keep ICMP echo enabled at all times.
It's a valuable debugging tool.
i drop those and only enable when needed
thanks. will give it a try!
That's a good advice, but it's
/etc/sysctl.d/
, at least on Debian. Thanks!Should I create a file like
/etc/sysctl.d/sysctl.conf
and put new parameters there?Take a look at this, and try to understand what each setting does before you modify it, otherwise it may cause undesired effects:
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.rst
https://www.kernel.org/doc/Documentation/networking/ <- look for files containing sysctl and look through the relevant files for the settings.