Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Hi!
beard
beard
Thin & Rack
© jezebel.com - http://www.flickr.com/photos/lamazone/2366616647/
http://www.mykaussie.com/images/tshirt7.jpg
Sorry!
Story
A random feed feed feed entry


Eating cookies, yummy!
Zzzz...
http://dancingspoon.typepad.com/espresso.jpg
OMGWTFBBQ!!11!!1
...
69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot;
200 712 quot;http://f...
A random feed feed feed entry


Eating cookies, yummy!
Cache?
Cache?
random
(
Web Server
Event Driven
Web Server
Process-Based
So what?
server = TCPServer.new('localhost', 3000)

loop do
  client = server.accept

 puts client.read

 client.close

end
server = TCPServer.new('localhost', 3000)

loop do
  client = server.accept

 puts client.read

 client.close

end
Client   Server
Client    Server
         read
server = TCPServer.new('localhost', 3000)

loop do
  client = server.accept

 puts client.read

 client.close

end
server = TCPServer.new('localhost', 3000)

loop do
  client = server.accept
  Thread.new do
    puts client.read

    clie...
Client
Client   Server
Client
Client            Thread
Client   Server   Thread

Client            Thread
Time
Resources
(?)
@kernel notify me if readable
Non-Blocking Sockets
I/O Multiplexing
OMGWTFBBQ!!11!!1
F******
You lost me at I/O
Complex
http://rev.rubyforge.org/
http://rubyeventmachine.com/



http://twistedmatrix.com/
http://code.google.com/p/pyev/


http:...
Event Driven
Event Driven
Web Server
server = TCPServer.new('localhost', 3000)

server.on_readable do
  client = server.accept
  client.on_readable do
    puts...
More Connections
Less Memory
Faster
(
HTTP
Simple
Flexible
Elegant
Beautiful
and
Sexy
Sexy
Request   Response
Request
POST /path HTTP/1.1
Host: localhost
Connection: close
Content-Length: 6

ohaie!
Response
HTTP/1.1 200 OK
Content-Length: 34
Content-Type: text/html

<html>
  <h1>kthxbaie</h1>
</html>
API
HTTP
WSGI
API
1
line
proc { |env| [200, {}, quot;kthxbaiquot;] }
POST / HTTP/1.1     env = {
                      quot;REQUEST_METHODquot;    =>   quot;POSTquot;,
Host: localhost       q...
[
    200,
    {
                                       HTTP/1.1 200 OK
       quot;Content-Lengthquot; => quot;34quot;,  ...
class MyApp
  def call(env)
    [
      200,
      { 'Content-Type' => 'text/plain' },
      quot;you requested quot; + en...
Run it
my_app.ru
run MyApp.new
map '/other' do
  run OtherApp.new
end

run MyApp.new
use Rack::CommonLogger

map '/other' do
  run OtherApp.new
end

run MyApp.new
thin start -R my_app.ru
Ebb
))
A random feed feed feed entry


Eating cookies, yummy!
A random feed feed feed entry


Eating cookies, yummy!
self.demo! :code
Thanks!
http://code.macournoyer.com/thin
Questions ?
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
MeshU Thin & Rack
Upcoming SlideShare
Loading in …5
×

MeshU Thin & Rack

2,238 views

Published on

Marc-Andre Cournoyer MeshU presentation on Thin & Rack

Published in: Technology
  • Be the first to comment

  • Be the first to like this

MeshU Thin & Rack

  1. 1. Hi!
  2. 2. beard
  3. 3. beard
  4. 4. Thin & Rack
  5. 5. © jezebel.com - http://www.flickr.com/photos/lamazone/2366616647/
  6. 6. http://www.mykaussie.com/images/tshirt7.jpg
  7. 7. Sorry!
  8. 8. Story
  9. 9. A random feed feed feed entry Eating cookies, yummy!
  10. 10. Zzzz...
  11. 11. http://dancingspoon.typepad.com/espresso.jpg
  12. 12. OMGWTFBBQ!!11!!1
  13. 13. ...
  14. 14. 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot; 69.110.148.55 - - [09/May/2008:23:58:18 +0000] quot;GET friendfeedfeedfeed.com/feeds/2 HTTP/1.1quot; 200 712 quot;http://friendfeedfeedfeed.com/feeds/2quot; quot;Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14quot;
  15. 15. A random feed feed feed entry Eating cookies, yummy!
  16. 16. Cache?
  17. 17. Cache?
  18. 18. random
  19. 19. (
  20. 20. Web Server
  21. 21. Event Driven Web Server
  22. 22. Process-Based
  23. 23. So what?
  24. 24. server = TCPServer.new('localhost', 3000) loop do client = server.accept puts client.read client.close end
  25. 25. server = TCPServer.new('localhost', 3000) loop do client = server.accept puts client.read client.close end
  26. 26. Client Server
  27. 27. Client Server read
  28. 28. server = TCPServer.new('localhost', 3000) loop do client = server.accept puts client.read client.close end
  29. 29. server = TCPServer.new('localhost', 3000) loop do client = server.accept Thread.new do puts client.read client.close end end
  30. 30. Client Client Server Client
  31. 31. Client Thread Client Server Thread Client Thread
  32. 32. Time
  33. 33. Resources
  34. 34. (?)
  35. 35. @kernel notify me if readable
  36. 36. Non-Blocking Sockets
  37. 37. I/O Multiplexing
  38. 38. OMGWTFBBQ!!11!!1
  39. 39. F******
  40. 40. You lost me at I/O
  41. 41. Complex
  42. 42. http://rev.rubyforge.org/ http://rubyeventmachine.com/ http://twistedmatrix.com/ http://code.google.com/p/pyev/ http://software.schmorp.de/pkg/libev.html
  43. 43. Event Driven
  44. 44. Event Driven Web Server
  45. 45. server = TCPServer.new('localhost', 3000) server.on_readable do client = server.accept client.on_readable do puts client.read client.close end end
  46. 46. More Connections
  47. 47. Less Memory
  48. 48. Faster
  49. 49. (
  50. 50. HTTP
  51. 51. Simple
  52. 52. Flexible
  53. 53. Elegant
  54. 54. Beautiful
  55. 55. and
  56. 56. Sexy
  57. 57. Sexy
  58. 58. Request Response
  59. 59. Request
  60. 60. POST /path HTTP/1.1 Host: localhost Connection: close Content-Length: 6 ohaie!
  61. 61. Response
  62. 62. HTTP/1.1 200 OK Content-Length: 34 Content-Type: text/html <html> <h1>kthxbaie</h1> </html>
  63. 63. API
  64. 64. HTTP
  65. 65. WSGI
  66. 66. API
  67. 67. 1 line
  68. 68. proc { |env| [200, {}, quot;kthxbaiquot;] }
  69. 69. POST / HTTP/1.1 env = { quot;REQUEST_METHODquot; => quot;POSTquot;, Host: localhost quot;PATH_INFOquot; => quot;/quot;, Connection: close quot;HTTP_VERSIONquot; => quot;1.1quot;, Content-Length: 6 quot;HTTP_HOSTquot; => quot;localhostquot;, quot;HTTP_CONNECTIONquot; => quot;closequot;, quot;CONTENT_LENGTHquot; => quot;6quot; ohaie! }
  70. 70. [ 200, { HTTP/1.1 200 OK quot;Content-Lengthquot; => quot;34quot;, Content-Length: 34 quot;Content-Typequot; => quot;text/htmlquot; Content-Type: text/html }, [ quot;<html>quot;, <html> quot; <h1>kthxbaie</h1>quot;, <h1>kthxbaie</h1> quot;</html>quot; ] </html> ]
  71. 71. class MyApp def call(env) [ 200, { 'Content-Type' => 'text/plain' }, quot;you requested quot; + env['PATH_INFO'] ] end end
  72. 72. Run it
  73. 73. my_app.ru
  74. 74. run MyApp.new
  75. 75. map '/other' do run OtherApp.new end run MyApp.new
  76. 76. use Rack::CommonLogger map '/other' do run OtherApp.new end run MyApp.new
  77. 77. thin start -R my_app.ru
  78. 78. Ebb
  79. 79. ))
  80. 80. A random feed feed feed entry Eating cookies, yummy!
  81. 81. A random feed feed feed entry Eating cookies, yummy!
  82. 82. self.demo! :code
  83. 83. Thanks! http://code.macournoyer.com/thin
  84. 84. Questions ?

×