首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

如何优雅地编译kernel

linux内核有社区版本,升级和发布很快。redhat会选择一个内核版本构建自己的发行版,发行版除了内核还包括众多内核之上的软件如bash/gcc/glibc/systemd/开发库等等,redhat的策略是长期维护,只backport和bugfix升级小版本,并且保证任何backport和bugfix不影响原来的使用场景,比如升级内核小版本原来自己开发的内核模块代码不用修改,但在主线linux内核升级估计就得修改代码,再比如原来生产环境有一些脚本和配置文件,小版本升级后这些脚本和配置不用做任何修改,但不用redhat维护的版本,自己升级开源的版本恐怕升级后这些脚本和配置文件都未必能正常工作,维护周期结束后redhat会对大版本做一次升级,至少这个维护周期生产环境可以正常升级。所以生产环境都用redhat的企业版本linux,centos就是去掉商标后的redhat免费企业版,不想付费就用centos。

00

如何优雅地编译kernel

linux内核有社区版本,升级和发布很快。redhat会选择一个内核版本构建自己的发行版,发行版除了内核还包括众多内核之上的软件如bash/gcc/glibc/systemd/开发库等等,redhat的策略是长期维护,只backport和bugfix升级小版本,并且保证任何backport和bugfix不影响原来的使用场景,比如升级内核小版本原来自己开发的内核模块代码不用修改,但在主线linux内核升级估计就得修改代码,再比如原来生产环境有一些脚本和配置文件,小版本升级后这些脚本和配置不用做任何修改,但不用redhat维护的版本,自己升级开源的版本恐怕升级后这些脚本和配置文件都未必能正常工作,维护周期结束后redhat会对大版本做一次升级,至少这个维护周期生产环境可以正常升级。所以生产环境都用redhat的企业版本linux,centos就是去掉商标后的redhat免费企业版,不想付费就用centos。

01

Python和sendfile[通俗易懂]

sendfile(2) is a UNIX system call which provides a “zero-copy” way of copying data from one file descriptor (a file) to another (a socket). Because this copying is done entirely within the kernel, sendfile(2) is more efficient than the combination of “file.read()” and “socket.send()”, which requires transferring data to and from user space. This copying of the data twice imposes some performance and resource penalties which sendfile(2) syscall avoids; it also results in a single system call (and thus only one context switch), rather than the series of read(2) / write(2) system calls (each system call requiring a context switch) used internally for the data copying. A more exhaustive explanation of how sendfile(2) works is available here, but long story short is that sending a file with sendfile() is usually twice as fast than using plain socket.send(). Typical applications which can benefit from using sendfile() are FTP and HTTP servers.

01

记一次kubernetes集群异常:kubelet连接apiserver超时

kubernetes是master-slave结构,master node是集群的大脑,当master node发生故障时整个集群都"out of control"。master node中最重要的当属apiserver组件,它负责处理所有请求,并持久化状态到etcd。一般我们会部署多份apiserver实现高可用。官方建议在多个apiserver前面部署一个LB进行负载均衡,当其中一台apiserver发生故障之后,LB自动将流量切换到其他实例上面。这样虽然简单,但是也引入了额外的依赖,如果LB发生故障将会导致全部apiserver不可用。我们知道在kubernetes中node节点上kubelet与apiserver心跳超时后,controller-manager会将该node状态置为notReady,随后驱逐其上的pod,使这些pod在其他地方重建。所以当LB发生故障时,集群中所有的node都会变为notReady状态,进而导致大规模的pod驱逐。

04
领券