~/talk

The Little Server That Could

Talkat RubyConf 2016 · 2016-11-10..11-12· [ruby, web-platform]

Builds a tiny Ruby web server that answers curl requests by opening an Inet TCP socket, parsing HTTP (notes C parsers like Zed Shaw’s ragel/state-machine approach), and calling a Rack app to return status headers body. Demonstrates blocking external calls with a 5s sleep that serializes clients, shows concurrency via socket.accept creates a new socket for each client and via fork + close parent FD or hit too many open files, and explains how Ruby 2 GC enables copy-on-write and why SIGKILL cannot be trapped.

AI-written summary · about

  1. 0:00Start
  2. 1:56Abstractions are
  3. 3:16Servers are an Abstraction
  4. 3:38Servers are not Magic
  5. 5:19How is it different?
  6. 5:384.68 Billion Indexed Web Pages
  7. 6:08How is this possible?
  8. 6:18C Worldwide Web Consortium
  9. 6:29HTTP as an API
  10. 7:15Zero or more header lines 3. Blank line 4. Message body (optional)
  11. 10:06How does it communicate?
  12. 13:15Defining our Socket: 1. Addressing Format 2. Kind of socket
  13. 13:43TCP Three-Way Handshake
  14. 16:27Listen for requests
  15. 18:17Parser
  16. 20:18Rack Interface
  17. 23:36Forking
  18. 26:11Wait...won't fork double my memory that I'm consuming?
  19. 27:23Garbage Collection
  20. 29:51Benefits of Threading: - Uses less memory -Threads die with process - Much faster to communicate
  21. 32:15Why use a multi-threaded server with MRI?
  22. 32:46Downsides of Threading: - Your code has to be thread safe - Your gems have to be thread safe
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.