1 / 17

高 级服务器设计和实现 1 —— 基 础与进阶

高 级服务器设计和实现 1 —— 基 础与进阶. 余 锋 (mryufeng@gmail.com) 2008-06-08. 基本套接字 API. socket bind listen accept read/recv write/send close. Tcp 状 态变迁和 socket API. IO 模型. 阻塞 I/O 非阻塞 I/O I/O 多路复用 (select and poll) 事件 驱动 I/O (SIGIO) 异步 I/O (POSIX aio_ 函数 ). IO 模型之 间的区别. IO 策略.

chinue
Download Presentation

高 级服务器设计和实现 1 —— 基 础与进阶

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 高级服务器设计和实现1——基础与进阶 余锋 (mryufeng@gmail.com) 2008-06-08

  2. 基本套接字API socket bind listen accept read/recv write/send close

  3. Tcp 状态变迁和socket API

  4. IO模型 阻塞I/O 非阻塞I/O I/O多路复用(select and poll) 事件驱动 I/O (SIGIO) 异步I/O (POSIX aio_函数)

  5. IO模型之间的区别

  6. IO策略 多客户一线程,非阻塞(水平触发) select() poll() /dev/poll kqueue

  7. IO策略 多客户一线程,非阻塞(改变通知) epoll() kevent realtime signal kqueue

  8. IO策略 每服务器线程一客户 NGPT NPTL FreeBSD线程

  9. IO策略 内核中的服务器 TUX

  10. 异步IO Linux aio 不支持网络io 比较难编程

  11. 多线程 如有可能不要尝试多线程 用原语高级点的库 想清楚了再做 很难调试做好诊断设施

  12. 多线程 VS 事件派遣方式 多线程模型简单难编程 事件派遣性能高

  13. C10K Problem C10K是很难跨越的 上了一个台阶

  14. 制约性能的杀手 数据拷贝 上下文切换 内存分配 锁竞争

  15. 其他制约性能因素 存储子系统 协议参数 TCP_CORK/MSG_PUSH/Neagle 缓存情况 readv/writev可用否? 系统页大小(page size) 系统调用代价

  16. 可供学习的优秀代码 Lighty Nginx Mysql-proxy Haproxy Shttpd

  17. Q & A

More Related