b, err := ioutil.ReadFile("xxx/path")
if err != nil {
panic(err)
}
str := string(b)
[......]
Go读取本地文件
Leave a reply
b, err := ioutil.ReadFile("xxx/path")
if err != nil {
panic(err)
}
str := string(b)
[......]
https://github.com/cloudhut/kowl[......]
tcp建连优化
1 tcp建连,降低客户端超时时间
net.ipv4.tcp_syn_retries = 6
2 tcp建连,服务端避免syn攻击
netstat -s | grep "SYNs to LISTEN" 1192450 SYNs to LISTEN sockets dropped
可以考虑增大syn队列
net.ipv4.tcp_max_syn_backlog = 1024
超过上述队列后,启用syn cookie
net.ipv4.tcp_syncookies =[......]
官方权威指南:https://www.oracle.com/cn/technical-resources/articles/java/g1gc.html[......]