博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
FASTSOCKET
阅读量:5235 次
发布时间:2019-06-14

本文共 1722 字,大约阅读时间需要 5 分钟。

 

It looks like there are like 3 separate optimizations, but I think the most important one is the "enable_listen_spawn" feature. Here is how they describe it:
Fastsocket creates one local listen socket table for each CPU core. With this feature, application process can decide to process new connections from a specific CPU core. It is done by copying the original listen socket and inserting the copy into the local listen socket table. When there is a new connection on one CPU core, kernel tries to match a listen socket in the local listen table of that CPU core and inserts the connection into the accept queue of the local listen socket if there is match. Later, the process can accept the connection from the local listen socket exclusively. This way each network softirq has its own local socket to queue new connection and each process has its own local listen socket to pull new connection out. When the process is bound with the CPU core specified, then connections delivered to that CPU core by NIC are entirely processed by the same CPU core with in all stages, including hardirp, softirq, syscall and user process. As a result, connections are processed without contension across all CPU cores, which achieves passive connection locality.
The kernel in its normal configuration will try to spread the IRQs evenly across CPUs. So for their use case, where you have one worker thread per CPU handling zillions of short lived TCP connections, they can eliminate a bunch of locking and cache thrashing that would otherwise happen when handling new connections and dispatching the related epoll events within the kernel.

 

posted on
2014-10-23 21:38 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/busor/p/4046953.html

你可能感兴趣的文章
C++按格式接收输入字符(京东,滴滴,360笔试必用)
查看>>
POJ 2255 Tree Recovery
查看>>
代理ARP
查看>>
Python 的 sys 模块常用方法?
查看>>
Java hashCode() 方法深入理解 ...
查看>>
Modbus TCP 示例报文
查看>>
spring的annotation
查看>>
go 学习笔记(4) ---项目结构
查看>>
如何解决ORA-01033问题(转)
查看>>
分割线细线
查看>>
java 中的一些运算符问题
查看>>
c# 操作ftp
查看>>
css切换--使用cookie
查看>>
C#运算符之异或运算
查看>>
C语言与C++ <string.h> memchr出现的问题
查看>>
java中静态代码块的用法 static用法详解
查看>>
用于代码检查的错误列表
查看>>
Java线程面试题
查看>>
C#2.0 读word的多个表格到DataGridView或是其它控件 XP Vista
查看>>
sql script: Graphs, Trees, Hierarchies and Recursive Queries
查看>>