欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    Capriccio- Scalable Threads for Internet Service.ppt

    • 资源ID:379310       资源大小:75KB        全文页数:46页
    • 资源格式: PPT        下载积分:2000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要2000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Capriccio- Scalable Threads for Internet Service.ppt

    1、Capriccio: Scalable Threads for Internet Service,Introduction,Internet services have ever-increasing scalability demands Current hardware is meeting these demands Software has lagged behind Recent approaches are event-based Pipeline stages of events,Drawbacks of Events,Events systems hide the contro

    2、l flow Difficult to understand and debug Eventually evolved into call-and-return event pairs Programmers need to match related events Need to save/restore states Capriccio: instead of event-based model, fix the thread-based model,Goals of Capriccio,Support for existing thread API Little changes to e

    3、xisting applications Scalability to thousands of threads One thread per execution Flexibility to address application-specific needs,Performance,Ease of Programming,Threads,Threads,Events,Ideal,Thread Design Principles,Kernel-level threads are for true concurrency User-level threads provide a clean p

    4、rogramming model with useful invariants and semantics Decouple user from kernel level threads More portable,Capriccio,Thread package All thread operations are O(1) Linked stacks Address the problem of stack allocation for large numbers of threads Combination of compile-time and run-time analysis Res

    5、ource-aware scheduler,Thread Design and Scalability,POSIX API Backward compatible,User-Level Threads,+ Performance + Flexibility - Complex preemption - Bad interaction with kernel scheduler,Flexibility,Decoupling user and kernel threads allows faster innovation Can use new kernel thread features wit

    6、hout changing application code Scheduler tailored for applications Lightweight,Performance,Reduce the overhead of thread synchronization No kernel crossing for preemptive threading More efficient memory management at user level,Disadvantages,Need to replace blocking calls with nonblocking ones to ho

    7、ld the CPU Translation overhead Problems with multiple processors Synchronization becomes more expensive,Context Switches,Built on top of Edgar Toernigs coroutine library Fast context switches when threads voluntarily yield,I/O,Capriccio intercepts blocking I/O calls Uses epoll for asynchronous I/O,

    8、Scheduling,Very much like an event-driven application Events are hidden from programmers,Synchronization,Supports cooperative threading on single-CPU machines Requires only Boolean checks,Threading Microbenchmarks,SMP, two 2.4 GHz Xeon processors 1 GB memory two 10 K RPM SCSI Ultra II hard drives Li

    9、nux 2.5.70 Compared Capriccio, LinuxThreads, and Native POSIX Threads for Linux,Latencies of Thread Primitives,Thread Scalability,Producer-consumer microbenchmark LinuxThreads begin to degrade after 20 threads NPTL degrades after 100 Capriccio scales to 32K producers and consumers (64K threads total

    10、),Thread Scalability,I/O Performance,Network performance Token passing among pipes Simulates the effect of slow client links 10% overhead compared to epoll Twice as fast as both LinuxThreads and NPTL when more than 1000 threads Disk I/O comparable to kernel threads,Linked Stack Management,LinuxThrea

    11、ds allocates 2MB per stack 1 GB of VM holds only 500 threads,Fixed Stacks,Linked Stack Management,But most threads consumes only a few KB of stack space at a given time Dynamic stack allocation can significantly reduce the size of VM,Linked Stack,Compiler Analysis and Linked Stacks,Whole-program ana

    12、lysis Based on the call graph Problematic for recursions Static estimation may be too conservative,Compiler Analysis and Linked Stacks,Grow and shrink the stack size on demand Insert checkpoints to determine whether we need to allocate more before the next checkpoint Result in noncontiguous stacks,P

    13、lacing Checkpoints,One checkpoint in every cycle in the call graph Bound the size between checkpoints with the deepest call path,Dealing with Special Cases,Function pointers Dont know what procedure to call at compile time Can find a potential set of procedures,Dealing with Special Cases,External fu

    14、nctions Allow programmers to annotate external library functions with trusted stack bounds Allow larger stack chunks to be linked for external functions,Tuning the Algorithm,Stack space can be wasted Internal and external fragmentation Tradeoffs Number of stack linkings External fragmentation,Memory

    15、 Benefits,Tuning can be application-specific No preallocation of large stacks Reduced requirement to run a large numbers of threads Better paging behavior StacksLIFO,Case Study: Apache 2.0.44,Maximum stack allocation chunk: 2KB Apache under SPECweb99 Overall slowdown is about 3% Dynamic allocation 0

    16、.1% Link to large chunks for external functions 0.5% Stack removal 10%,Resource-Aware Scheduling,Advantages of event-based scheduling Tailored for applications With event handlers Events provide two important pieces of information for scheduling Whether a process is close to completion Whether a sys

    17、tem is overloaded,Resource-Aware Scheduling,Thread-based View applications as sequence of stages, separated by blocking calls Analogous to event-based scheduler,Blocking Graph,Node: A location in the program that blocked Edge: between two nodes if they were consecutive blocking points Generated at r

    18、untime,Resource-Aware Scheduling,1. Keep track of resource utilization 2. Annotate each node with resource used and its outgoing edges 3. Dynamically prioritize nodes Prefer nodes that release resources,Resources,CPU Memory (malloc) File descriptors (open, close),Pitfalls,Tricky to determine the max

    19、imum capacity of a resource Thrashing depends on the workload Disk can handle more requests that are sequential instead of random Resources interact VM vs. disk Applications may manage memory themselves,Yield Profiling,User threads are problematic if a thread fails to yield They are easy to detect,

    20、since their running times are orders of magnitude larger Yield profiling identifies places where programs fail to yield sufficiently often,Web Server Performance,4x500 MHz Pentium server 2GB memory Intel e1000 Gigabit Ethernet card Linux 2.4.20 Workload: requests for 3.2 GB of static file data,Web S

    21、erver Performance,Request frequencies match those of the SPECweb99 A client connects to a server repeated and issue a series of five requests, separated by 20ms pauses Apaches performance improved by 15% with Capriccio,Resource-Aware Admission Control,Consumer-producer applications Producer loops, a

    22、dding memory, and randomly touching pages Consumer loops, removing memory from the pool and freeing it Fast producer may run out of virtual address space,Resource-Aware Admission Control,Touching pages too quickly will cause thrashing Capriccio can quickly detect the overload conditions and limit th

    23、e number of producers,Programming Models for High Concurrency,Event Application-specific optimization Thread Efficient thread runtimes,User-Level Threads,Capriccio is unique Blocking graph Resource-aware scheduling Target at a large number of blocking threads POSIX compliant,Application-Specific Optimization,Most approaches require programmers to tailor their application to manage resources Nonstandard APIs, less portable,Stack Management,No garbage collection,Future Work,Multi-CPU machines Profiling tools for system tuning,


    注意事项

    本文(Capriccio- Scalable Threads for Internet Service.ppt)为本站会员(testyield361)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开