分类目录归档:未分类

调整sysctl.conf 实现双机吞吐最大

我发现使用以下参数更新 sysctl.conf 会导致我的大多数虚拟机在美国和欧盟等任何主机之间达到最大文件下载/上传速度。

net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.ipv4.tcp_rmem = 4096 87380 134217728
net.ipv4.tcp_wmem = 4096 65536 134217728
net.core.netdev_max_backlog = 300000
net.ipv4.tcp_moderate_rcvbuf = 1
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_mtu_probing = 1

sysctl -p(应用)
那么sysctl.conf在那里呢。不出问题应该是在/etc/sysctl.conf

Debian修改时区和24小时制

先查看Debian的默认时区:

root@devops:~# timedatectl
Local time: Fri 2022-11-24 10:13:29 UTC
           Universal time: Fri 2022-11-24 10:13:29 UTC
                 RTC time: Fri 2022-11-24 10:13:29
                Time zone: UTC (UTC, +0000)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

现在当前是UTC,修改为Asia/Shanghai

root@devops:~# timedatectl set-timezone Asia/Shanghai

查看修改情况:

root@devops:~# timedatectl
               Local time: Fri 2022-11-24 10:15:51 CST
           Universal time: Fri 2022-11-24 10:15:51 UTC
                 RTC time: Fri 2022-11-24 10:15:52
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

查看当前所有时区:

root@devops:~# timedatectl list-timezones

安装ntpdate同步工具:

root@devops:~# apt install ntpdate -y

自动同步时间
接下来我们设置让系统每隔60分钟自动更新时间,输入以下命令

root@devops:~# crontab -e

添加定时任务每小时同步一次:

*/60 * * * * /usr/sbin/ntpdate pool.ntp.org

如果ntp服务在运行的时候,直接运行ntpdate可能会报错,直接停掉ntpd服务即可

root@devops:~# systemctl stop ntp
root@devops:~# systemctl disable ntp
Synchronizing state of ntp.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable ntp
Removed /etc/systemd/system/multi-user.target.wants/ntp.service.

在debian系统种输入以下命令行,重启即可!

localectl set-locale LC_TIME=en_GB.UTF-8