Shellac: a distributed web accelerator

3c02038387302217d6b670ba6dafaecf?s=47 Kalan MacRow
December 10, 2013

Shellac: a distributed web accelerator

Shellac is an HTTP/1.1 distributed caching proxy for Linux.

3c02038387302217d6b670ba6dafaecf?s=128

Kalan MacRow

December 10, 2013
Tweet

Transcript

  1. Shellac A distributed web accelerator. Kalan MacRow Data at Scale

    ‘13
  2. Shellac. (noun) Lac bug resin melted into thin flakes, used

    for making varnish Kalan MacRow Data at Scale ‘13
  3. Shellac. (verb) To defeat or beat (someone) decisively Kalan MacRow

    Data at Scale ‘13
  4. 5.2% of the top 10,000 sites. Kalan MacRow Data at

    Scale ‘13
  5. Kalan MacRow Data at Scale ‘13 ! Script interpreters 50+

    SQL queries Localization Personalization Template rendering …. ! 3 sec.
  6. • HTTP/1.1 proxy server for Linux 2.5+ • Distributed RAM

    cache built on Memcached • Level-triggered edge-polling architecture • 1K lines of Python Kalan MacRow Data at Scale ‘13 Design
  7. Kalan MacRow Data at Scale ‘13 “The key to making

    programs fast is to make them do practically nothing” — Mike Haertel, original author of GNU grep Design
  8. Kalan MacRow Data at Scale ‘13 • I/O bound and

    largely avoids the GIL • Substantial function/method/syscall call overhead • Iteration with while, for expensive • Event dispatch really suffers, but… Design
  9. Load Balancer Web Server Accelerator Cache Web Server Accelerator Cache

    Web Server Accelerator Cache Typical HA Kalan MacRow Data at Scale ‘13
  10. Shellac HA Kalan MacRow Data at Scale ‘13 Load Balancer

    Web Server Shellac Web Server Shellac Web Server Shellac Cache Dedicated Cache
  11. Kalan MacRow Data at Scale ‘13 • Interested in performance

    both • as a proxy / load balancer • as a caching proxy / accelerator • Graphs: best of Apache, Varnish and worst for Shellac over 3 runs Evaluation
  12. Kalan MacRow Data at Scale ‘13 • 4 x m1.large

    instances (4 core Xeon, 8GB) • Elastic Load Balancer • Master for running benchmarks • One availability zone, one region
  13. Kalan MacRow Data at Scale ‘13 Evaluation Apache Benchmark (-n

    10k -c 1000)
  14. Evaluation Kalan MacRow Data at Scale ‘13 Apache Benchmark (-n

    10k -c 1000)
  15. Evaluation Kalan MacRow Data at Scale ‘13 Apache Benchmark (-n

    10k -c 1000)
  16. Kalan MacRow Data at Scale ‘13 Static Dynamic 1 Dynamic

    2 Requests / sec. (mean) Evaluation 10K requests, 1K clients
  17. Static Dynamic 1 Dynamic 2 Transfer Rate (KB/s) Kalan MacRow

    Data at Scale ‘13 Evaluation 10K requests, 1K clients
  18. Static Dynamic 1 Dynamic 2 Peak Memory Usage (MB) Kalan

    MacRow Data at Scale ‘13 Evaluation
  19. Kalan MacRow Data at Scale ‘13 Conclusions • Shellac 0.1.0a

    is competitive • as a proxy / load balancer • as a caching proxy / accelerator • A C port might shellac Varnish!
  20. Future • HTTP/1.1 compliance • Try with PyPy JIT’ing, eventually

    port to C • Binary format for cache entries • Tighter integration of cache node with proxy Kalan MacRow Data at Scale ‘13
  21. https://github.com/kmacrow/Shellac Kalan MacRow Data at Scale ‘13