上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 70 下一页
摘要: 今天在做吞吐性能优化时,涉及到了零拷贝的问题, 以前只是用sendfile 或者mmap。今天系统的看下总公有哪些零拷贝API以及使用场景。 常见的拷贝优化方案 memory mapping shared buffers in kernel memory space shared buffers b 阅读全文
posted @ 2022-10-17 13:57 codestacklinuxer 阅读(40) 评论(0) 推荐(0)
摘要: perf stat -r 5 -e cache-misses,cache-references,instructions,cycles,L1-dcache-stores,L1-dcache-store-misses -a perf record -e cache-misses 其实一般使用perf 阅读全文
posted @ 2022-10-14 22:16 codestacklinuxer 阅读(98) 评论(0) 推荐(0)
摘要: 目前编译glibc库时发现 glibc中已定义的libpthread库函数?同时查看当前server下glibc以及pthread库,发现也是都定义了同样的函数。那如果这样的话,gcc 编译时同时引入 glbc以及libpthread不会报错吗?但是实际上不会!! 参考这个讨论话题:why-glib 阅读全文
posted @ 2022-10-12 21:16 codestacklinuxer 阅读(31) 评论(0) 推荐(0)
摘要: 1、引言 本文来自 Marek’s 博客中 I/O multiplexing part 系列之三和四,主要讲 Linux 上 IO 多路复用的一些问题 Epoll is fundamentally broken 1/2 Epoll is fundamentally broken 2/2 4. epo 阅读全文
posted @ 2022-10-11 18:15 codestacklinuxer 阅读(21) 评论(0) 推荐(0)
摘要: 自从linux 2.6.9后linux提供了驱动级的系统函数splice。它的作用是在文件描述符直接转发数据,直接对内核内存块做引用标记而不需要借用用户内存复制数据。这样就大大节省了分配内存,再read和write的性能消耗。 自己用了一下这个函数发现总是返回EINVAL,于是去阅读HAProxy的 阅读全文
posted @ 2022-10-08 16:06 codestacklinuxer 阅读(49) 评论(0) 推荐(0)
摘要: 当后端是缓存服务器时,经常使用一致性哈希算法来进行负载均衡。 使用一致性哈希的好处在于,增减集群的缓存服务器时,只有少量的缓存会失效,回源量较小。 在nginx+ats / haproxy+squid等CDN架构中,nginx/haproxy所使用的负载均衡算法便是一致性哈希。 我们举个例子来说明一 阅读全文
posted @ 2022-09-28 20:07 codestacklinuxer 阅读(48) 评论(0) 推荐(0)
摘要: 在使用ss 查socke 状态时,突然发现unix socket中存在unix|unix_dgram|unix_stream|unix_seqpacket 这三种类型,于是看了相关资料。 看了一下stackoverflow 相关知识! The main difference is that one 阅读全文
posted @ 2022-09-28 17:30 codestacklinuxer 阅读(48) 评论(0) 推荐(0)
摘要: epoll作为一个文件既可以监视其他文件,也可以被其他epoll监视。这样就产生了一个监视的有向图。 ep_eventpoll_poll 文件的poll操作,也就是file->f_op->poll(). 调用该函数可以获取就绪文件的事件掩码,但是 epoll 文件只提供读就绪事件,并且读就绪事件是由 阅读全文
posted @ 2022-09-28 14:13 codestacklinuxer 阅读(21) 评论(0) 推荐(0)
摘要: 直接看strace 结果 11:07:04.369821 accept4(6, {sa_family=AF_INET, sin_port=htons(20321), sin_addr=inet_addr("170.1.7.223")}, [16], SOCK_NONBLOCK) = 2843 <0. 阅读全文
posted @ 2022-09-28 11:21 codestacklinuxer 阅读(31) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2022-09-27 18:11 codestacklinuxer 阅读(50) 评论(0) 推荐(0)
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 70 下一页