1 / 23

Erlang全接触

Erlang全接触. 褚霸 chuba@taobao.com 2010/07/20 . Erlang是什么?. 通用的语言和运行环境 内置并发,集群,容错机制 电信行业大规模部署应用 . Erlang的历史. 很老的语言,始于80年代末 爱立信投资10亿美金主导开发 EPL版权方式开源. Erlang适合做什么. 互联网应用服务器 消息系统 需要软实时的数据库应用  网关代理服务器 . 应用案例. Facebook 华为  腾讯 校内网 盛大网络 WEB2.0游戏公司. Erlang的亮点. 高性能 多核心SMP的支持 透明分布的支持

radwan
Download Presentation

Erlang全接触

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. Erlang全接触 褚霸 chuba@taobao.com 2010/07/20

  2. Erlang是什么? • 通用的语言和运行环境 • 内置并发,集群,容错机制 • 电信行业大规模部署应用

  3. Erlang的历史 • 很老的语言,始于80年代末 • 爱立信投资10亿美金主导开发 • EPL版权方式开源

  4. Erlang适合做什么 • 互联网应用服务器 • 消息系统 • 需要软实时的数据库应用  • 网关代理服务器

  5. 应用案例 • Facebook • 华为  • 腾讯 • 校内网 • 盛大网络 • WEB2.0游戏公司

  6. Erlang的亮点 • 高性能 • 多核心SMP的支持 • 透明分布的支持 • 完善的监控信息 • 商业产品上经过时间的验证成熟 • 轻量进程的支持

  7. Erlang系统实现 • 200K行C代码 • 几千行核心Erlang代码 • 代码成熟度高

  8. Erlang语言特性 • 简单小巧 • 模式匹配 • 变量单次赋值 • 丰富的库 • 灵活多样的错误处理 • 代码热替换 • 天生的分布式 • 多核支持

  9. Erlang运行期内部 • ERTS 网络服务器框架 • 纯消息驱动的系统 • 多处理器利用技术 • 强大的IO • 平台移植

  10. ERTS <==> 网络服务器框架 • IO处理 • kernel poll, 如epoll kqueue • 定时器处理 • timewheel • 逻辑处理处理 • process • coroutine • fiber • smp

  11. 纯消息驱动的系统 • 多核心处理消息 • 调度器平衡迁移 • 同步和异步 • 无锁编程

  12. 多处理器利用技术 • 线程 • 调度器 • 异步线程 • driver发起的线程 • 精巧的锁 • process_lock • 快速的mutex • 进程 • PORT 管道通讯

  13. 强大的IO • 仿照Unix的哲学: 一切都是文件 • 管道通讯类似CGI • 对外世界的重要通道 • 整合其他语言写的模块

  14. 平台移植 • Windows(smp支持的不好) • *nix

  15. 与其他系统整合 • C节点(ei) • Java (jinterface) • Cobra • TCP/HTTP • 内置RPC

  16. 开发测试 • 开发工具 • 调优工具 • 排错工具 • 跟踪工具

  17. 部署 • Standalone • 不停机维护 • 在线升级 系统同时跑新旧代码 • 发现问题在线降级 • 工具化,一切自动化

  18. 代码安全 • 代码可远程从网络加载 Diskless • 代码可加密, 强加密防止反编译

  19. 远程维护 • 强大的内置shell • ssh sftp • 日志系统

  20. 监控功能 • OS mon • SNMP • HTTP

  21. 应用障碍 • FP语言 • 独特的哲学 • 社区小 • 库偏少

  22. 讨论Erlang在淘宝的应用? • 压力测试工具 • 消息中间件 • 服务调度 • 代理服务器 • 业务服务器 • Web应用 类似web旺旺?

  23. 谢谢大家? Any questions?

More Related