国内服务器,推荐腾讯云的。性价比高
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
https://cloud.tencent.com/act/cps/redirect?redirect=1040&cps_key=6de6774e22e2e52640c48b1307d341b5&from=console
配置sysctl
# vi /etc/sysctl.conf
在内容里添加
net.inet.tcp.sendspace=65536
net.inet.tcp.recvspace=65536
net.inet.udp.maxdgram=65535
net.local.stream.sendspace=65535
net.inet.tcp.rfc1323=1
net.inet.tcp.rfc3042=1
net.inet.tcp.rfc3390=1
kern.ipc.maxsockbuf=2097152
kern.maxfiles=65536
kern.maxfilesperproc=32768
net.inet.tcp.delayed_ack=0
net.inet.icmp.drop_redirect=1
net.inet.icmp.log_redirect=1
net.inet.ip.redirect=0
net.inet.icmp.bmcastecho=0
net.inet.icmp.maskrepl=0
net.inet.icmp.icmplim=100
net.inet.icmp.icmplim_output=0
net.inet.tcp.drop_synfin=1
net.inet.tcp.always_keepalive=1
net.inet.ip.intr_queue_maxlen=1000
net.inet.tcp.msl=7500
net.inet.tcp.blackhole=2
net.inet.udp.blackhole=1
kern.ipc.somaxconn=32768
security.bsd.see_other_uids=0
kern.securelevel=2
net.inet.tcp.log_in_vain=1
net.inet.udp.log_in_vain=1
net.inet.udp.checksum=1
net.inet.tcp.syncookies=1
kern.ipc.shm_use_phys=1
kern.ipc.shmmax=67108864
kern.ipc.shmall=32768
kern.coredump=0
net.local.stream.recvspace=65536
net.local.dgram.maxdgram=16384
net.local.dgram.recvspace=65536
net.inet.tcp.mssdflt=1460
net.inet.raw.maxdgram=65536
net.inet.raw.recvspace=65536
配置rc.conf
# vi /etc/rc.conf
内容填入
dumpdev="NO"
inetd_enable="NO"
postfix_enable="YES"
sendmail_enable="NONE"
fsck_y_enable="YES"
syslogd_enable="YES"
syslogd_flags="-s -s"
portmap_enable="NO"
kern_securelevel_enable="YES"
kern_securelevel="2"
clear_tmp_enable="YES"
update_motd="NO"
tcp_drop_synfin="YES"
icmp_drop_redirect="YES"
icmp_log_redirect="YES"
log_in_vain="YES"
accounting_enable="YES"