Recent Posts
-
November 23, 2019
Linux内核的死锁检测
内核文档比较详细https://www.kernel.org/doc/html/latest/admin-guide/lockup-watchdogs.htmlnmi watchdog[root@localhost ~]# cat /proc/sys/kernel/nmi_watchdog1[root@localhost ~]# cat /proc/sys/kernel/softlockup_panic0[root@localhost ~]# cat /proc/sys/kernel/ha...
-
November 06, 2019
Linux的cpuinfo和cpufreq设置cpu工作于性能模式还是低功耗省电模式
发现有的系统cat /proc/cpuinfo里面的“cpu MHz” 比实际的低,原来除了睿频的,cpu还支持低功耗模式,也会降频的,可以看 /sys/devices/system/cpu/cpu0/cpufreq/ 这里面的输出,好像intel的有的cpu不支持睿频但可以支持几个步进的频率这种。/sys/module/ipses/parameters # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1332800/...
-
October 16, 2019
Centos7编译源码包rpm Src
1.wget http://vault.centos.org/7.7.1908/os/Source/SPackages/iproute-4.11.0-25.el7.src.rpm2.rpm -i iproute-4.11.0-25.el7.src.rpmyum install iptables-devel libmnl-devel linuxdoc-tools psutils tex texlive-preprint3.cd /root/rpmbuild/SPECS[root@localh...
-
July 07, 2019
Centos7编译安装php的grpc和protobuf扩展
grpc php extension先按照官方文档编译grpchttps://github.com/grpc/grpc/blob/master/BUILDING.mdgit clone https://github.com/grpc/grpcgit submodule update --initmake install编译grpc php extensionyum -y install centos-release-scl.noarchyum -y install rh-php72 rh-...
-
June 27, 2019
Influxdb Grafana Telegraf的监控的安装配置
下载最新的安装包rpm -i grafana-6.2.5-1.x86_64.rpmrpm -i influxdb-1.7.6.x86_64.rpminfluxdb 的配置对应的服务service influxd start配置文件/etc/influxdb/influxdb.conf默认http服务 端口为8086数据和元数据的保存路径dir = "/var/lib/influxdb/data"influx> > use telegraf 选择要查看的数据库名 >...
-
June 18, 2019
C++和golang里面使用grpc和protobufs资料
下载编译好的protocol buffer编译器, 最新的protoc-3.8.0-linux-x86_64.ziphttps://github.com/protocolbuffers/protobuf/releases下载grpc的golang代码生成器protoc-gen-go,自动编译放到$GOPATH/bin目录go get -u github.com/golang/protobuf/protogo get -u github.com/golang/protobuf/protoc-...
-
May 05, 2019
Tls session resumption
https://blog.cloudflare.com/tls-session-resumption-full-speed-and-secure/https://vincent.bernat.ch/en/blog/2011-ssl-session-reuse-rfc5077
-
May 01, 2019
Linux内核源码阅读网卡接收和发送流程
netif_rx // 网卡驱动里面调用这个函数上传skb netif_rx_internal do_xdp_generic // xdp的处理 netif_receive_generic_xdp get_rps_cpu // rps的cpu调度 u16 index = skb_get_rx_queue(skb); flow_table = rcu_dereference(rxqueue->rps_flow_tab...
-
May 01, 2019
Xdp和af_xdp和bpfilter
eXpress Data Path (XDP) 好像最近很火facebook用来高防火墙和负载均衡器,cloudflare用来搞ddos过滤,内核开发者要用bpfilter取代iptables,Open vSwitch的ebpf的支持 等等https://www.kernel.org/doc/html/latest/networking/af_xdp.htmlhttp://vger.kernel.org/lpc_net2018_talks/lpc18_paper_af_xdp_perf-...
-
April 12, 2019
Linux的网络接口的ifindex相关
可以通过 ip link 来查看各个接口的 ifindex写代码获取ifindex可以用if_nametoindex, if_indextoname 这两个函数吧http://man7.org/linux/man-pages/man3/if_nameindex.3.htmllibnl可以用来辅助创建virtual linkint rtnl_link_add ( struct nl_sock * sk,struct rtnl_link * link,int flags ) Add v...