• Like
  • Save

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Traffic server overview

on

  • 4,725 views

Traffic server overview

Traffic server overview

Statistics

Views

Total Views
4,725
Views on SlideShare
4,389
Embed Views
336

Actions

Likes
10
Downloads
131
Comments
0

2 Embeds 336

http://www.flyinfo.net 335
http://reader.youdao.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 正向代理发送包含完整 URL 的代理请求; 反向代理发送指定路径的服务器请求。
  • 缺点: 1. 只支持单核; 2. 一个事件处理函数处理过多事件导致延迟; 3. 对 CPU 密集型的处理会导致挂起事件的饥饿。
  • 缺点: 1. 资源竞争导致的死锁; 2. 线程调度和切换带来的开销。
  • VC: Virtual Connection Contination: state machines Action: operation
  • 底层都是静态库的形式提供。 libinkcache.a libinkblockcache.a libTrafficServerStandalone.a libinkdns.a libinkcluster.a libinkutils.a libinkevent.a libinkaio.a libreclocal.a librecprocess.a libinknet.a libinktomi++.a

Traffic server overview Traffic server overview Presentation Transcript

  • Traffic Server 简介 淘宝网 -- 核心系统研发:千石 [email_address] http://www.flyinfo.net
  • Agenda
    • 功能概览
    • 架构 & 模型
    • Plugin 开发
    • 配置 CDN
  • TS 为何物
    • Apache Traffic Server™ is fast, scalable and extensible HTTP/1.1 compliant caching proxy server.
  • 回首过去
  • 功能概览
    • web 代理缓存
    • 反向代理
    • 多级缓存
  • 缓存命中
  • 缓存未命中
  • 反向代理
  • 多级缓存
  • 并发问题
    • C10k
      • http://www.kegel.com/c10k.html
    • C10k-C500k
      • http://www.dbanotes.net/arch/c10k_c500k.html
    • C1000k
      • http://www.slideshare.net/mryufeng/c1000k
    • 解决之道
      • 异步事件处理
      • CPU 多核支持
  • 异步事件处理
  • CPU 多核支持
  • 架构
    • 多线程异步状态机
      • 每个监听端口创建 accept 线程
      • 每个 core 分配 2-3 个线程
      • 独立的线程处理监控和日志
      • 每个活跃的请求维持状态机
    • 支持 Plugins
      • 在状态机的不同阶段进行 Hook
      • 其他协议的支持( NNTP, streaming, FTP )
  • 架构
  • 架构
  • 线程模型
  • 同类比较 ATS HAProxy nginx Squid Varnish Work Threads  X X X  Multi-process X #  #  Event-driven     X Plugin APIs  X # # # Forward proxy  X X  X Reverse proxy      Transp. proxy #    X Load Balancer      Cache  X    ESI  X X   ICP  X X  X Keep-Alive  X    SSL  X   X Pipeline  X   X
  • Plugin 开发
  • Plugin 例子
  • Http 状态转换 Hook
  • Http 状态转换 Hook
  • 配置 CDN CONFIG proxy.config.http.server_port INT 80 CONFIG proxy.config.reverse_proxy.enabled INT 1 CONFIG proxy.config.url_remap.remap_required INT 1 map http://cdn.example.com/img http://img.example.com reverse_map http://img.example.com http://cdn.example.com/img map http://cdn.example.com/js http://js.example.com reverse_map http://js.example.com http://cdn.example.com/js map http://cdn.example.com/css http://css.example.com reverse_map http://css.example.com http://cdn.exampe.com/css records.config remap.config
  • 更多信息
    • http://www.flyinfo.net/category/traffic-server/
  • 参考文献
    • https://cwiki.apache.org/TS/traffic-server.html
    • Traffic Server Meetup, ApacheCon 2009.
    • Leif Hedstrom, Apache Traffic Server - HTTP Proxy Server on the Edge, Velocity 2010.
    • Leif Hedstrom, Driving Apache Traffic Server, OSCON 2010.
  • Thank you! Any question?