Software And The Taste Of Mayo - Marco Tabini

3,088 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,088
On SlideShare
0
From Embeds
0
Number of Embeds
29
Actions
Shares
0
Downloads
16
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Software And The Taste Of Mayo - Marco Tabini

  1. 1. 1
  2. 2. SOFTWARE and the Taste of Mayo Marco Tabini php|architect marcot@tabini.ca 1
  3. 3. Marco Tabini 1
  4. 4. Marco Tabini 1
  5. 5. Marco Tabini 1
  6. 6. Marco Tabini 1
  7. 7. Marco Tabini 1
  8. 8. Marco Tabini 1
  9. 9. Marco Tabini 1
  10. 10. Marco Tabini 1
  11. 11. 2
  12. 12. What is Mayo? 2
  13. 13. 3
  14. 14. 3
  15. 15. 4
  16. 16. 4
  17. 17. 4
  18. 18. 5
  19. 19. 5
  20. 20. 5
  21. 21. 5
  22. 22. WTF???? 5
  23. 23. 6
  24. 24. 6
  25. 25. Where did they get this guy? 7
  26. 26. What does this have to do with SOFTWARE??? 8
  27. 27. 9
  28. 28. CODE 9
  29. 29. CODE + DATA 9
  30. 30. CODE + DATA + INTERFACE 9
  31. 31. CODE + DATA + INTERFACE = APP 9
  32. 32. CODE 10
  33. 33. CODE 10
  34. 34. CODE HARDWARE 10
  35. 35. CODE FIRMWARE HARDWARE 10
  36. 36. CODE O/S FIRMWARE HARDWARE 10
  37. 37. CODE WEB O/S SERVER FIRMWARE HARDWARE 10
  38. 38. CODE PHP WEB O/S SERVER FIRMWARE HARDWARE 10
  39. 39. CODE FRAMEWORK WEBPHP SERVER O/S FIRMWARE HARDWARE 10
  40. 40. CODE YOUR CODE FRAMEWORK PHP WEB SERVER O/S FIRMWARE HARDWARE 10
  41. 41. 11
  42. 42. Hello, World! 11
  43. 43. Hello, World! 11
  44. 44. Hello, World! Language System Calls C 46 Shell (TCSH) 37 PHP (CLI) 362 PHP (Apache) 881 11
  45. 45. Hello, World! Language System Calls C 46 Shell (TCSH) 37 PHP (CLI) 362 PHP (Apache) 881 11
  46. 46. Hello, World! Language System Calls C 46 Shell (TCSH) 37 PHP (CLI) 362 PHP (Apache) 881 11
  47. 47. Hello, World! Language System Calls C 46 Shell (TCSH) 37 PHP (CLI) 362 PHP (Apache) 881 11
  48. 48. Hello, World! Language System Calls C 46 Shell (TCSH) 37 PHP (CLI) 362 PHP (Apache) 881 11
  49. 49. Hello, World! Language System Calls Once C 47 Language C System Calls 46 Shell (TCSH) 146 Shell (TCSH) 37 PHP (CLI) 362 PHP (CLI) 368 PHP (Apache) 881 PHP (Apache) 887 11
  50. 50. Hello, World! Language System Calls Once C 47 Language C System Calls 46 Shell (TCSH) 146 Shell (TCSH) 37 PHP (CLI) 362 PHP (CLI) 368 PHP (Apache) 881 PHP (Apache) 887 11
  51. 51. Hello, World! Language System Calls Once C 47 Language C System Calls 46 Shell (TCSH) 146 Shell (TCSH) 37 PHP (CLI) 362 PHP (CLI) 368 PHP (Apache) 881 PHP (Apache) 887 11
  52. 52. Hello, World! Language System Calls Once C 47 Language C System Calls 46 Shell (TCSH) 146 Shell (TCSH) 37 PHP (CLI) 362 PHP (CLI) 368 PHP (Apache) 881 PHP (Apache) 887 11
  53. 53. Hello, World! Language System Calls Once C 47 Language C System Calls 46 Shell (TCSH) 146 Shell (TCSH) 37 PHP (CLI) 362 PHP (CLI) 368 PHP (Apache) 881 PHP (Apache) 887 11
  54. 54. Hello, World! Once Twice Language System Calls Language System Calls C 46 C 47 Shell (TCSH) 37 Shell (TCSH) 146 PHP (CLI) 362 PHP (CLI) 368 PHP (Apache) 881 PHP (Apache) 887 11
  55. 55. 12
  56. 56. Language Time C 2.5hrs Erlang 1.8hrs PHP (CLI) N/A* 12
  57. 57. Language Time C 2.5hrs Erlang 1.8hrs PHP (CLI) N/A* 12
  58. 58. Language Time C 2.5hrs Erlang 1.8hrs PHP (CLI) N/A* 12
  59. 59. Language Time C 2.5hrs Erlang 1.8hrs PHP (CLI) N/A* * Sorry, had to catch flight to Amsterdam 12
  60. 60. Ease of use Performance 13
  61. 61. Ease of use Performance ASM C PHP Rails 13
  62. 62. Ease of use Performance ASM C PHP Rails 13
  63. 63. Ease of use Performance ASM C PHP Rails 13
  64. 64. Ease of use Performance ASM C PHP Rails 13
  65. 65. Ease of use Performance ASM C PHP Rails 13
  66. 66. Single or double quotes? 14
  67. 67. Single or double quotes? vs. file_get_contents(‘3gb_file.txt’) 14
  68. 68. for? foreach? while? 15
  69. 69. for? foreach? while? vs. select * from gigantic_unindexed_table inner join world_population_database inner join i_should_be_growing_plants_instead_of_coding 15
  70. 70. CODE SCALABILITY 16
  71. 71. INFRA CODE DATA STRUCTURE SCALABILITY SCALABILITY COST SOURCE IT OF PERFORMANCE ORGANIZATION OWNERSHIP 16
  72. 72. Profit Density (Profit / Pages) Revenue Density Page Impressions 17
  73. 73. Profit Density (Profit / Pages) Revenue Density Page Impressions 17
  74. 74. Profit Density (Profit / Pages) Revenue Density Page Impressions 17
  75. 75. Profit Density (Profit / Pages) Revenue Density Page Impressions 17
  76. 76. Profit Density (Profit / Pages) Revenue Density Page Impressions 17
  77. 77. Profit Density (Profit / Pages) Revenue Density Page Impressions 17
  78. 78. Cost Density (Cost / Pages) 18
  79. 79. Cost Density (Cost / Pages) 18
  80. 80. Cost Density (Cost / Pages) 18
  81. 81. Cost Density (Cost / Pages) 18
  82. 82. Cost Density (Cost / Pages) 18
  83. 83. Cost Density (Cost / Pages) 18
  84. 84. Cost Density (Cost / Pages) 19
  85. 85. Cost Density (Cost / Pages) 19
  86. 86. Cost Density (Cost / Pages) 19
  87. 87. Cost Density (Cost / Pages) 19
  88. 88. Cost Density (Cost / Pages) FAIL! 19
  89. 89. Cost Density (Cost / Pages) Bad Good 20
  90. 90. Cost Density (Cost / Pages) Bad Good 20
  91. 91. Cost Density Problems • Wrong scalability strategy Database • Wrong database type • Wrong database use 21
  92. 92. Cost Density Problems • Architecture not scalable • No use of parallelization • No use of queuing 22
  93. 93. Solving your infrastructure problems (let someone else deal with them) 23
  94. 94. Example: AWS • 300,000 page impressions / mo. • Avg. 100kiB / page (== 30 GB / mo), 30GB Data • 20 queries per page, 20msec / query • 30 objects per page ( == 9,000,000 GET reqs/month) • 100 reqs/server/sec ( == 259,000,000 reqs/server/month) • 2 servers 24
  95. 95. Example: AWS 25
  96. 96. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  97. 97. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  98. 98. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  99. 99. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  100. 100. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  101. 101. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  102. 102. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  103. 103. Example: AWS Item Service Cost/mo Storage S3 4.5 Data Transfer S3 30 Data Requests S3 1 DB Storage SimpleDB 45 DB CPU Usage SimpleDB 55 Server Usage EC2 144 TOTALS 279.5 25
  104. 104. $280 / month = $0.09 CPM 3,000,000 pages / month (0.9% @ $10 RPM) 26
  105. 105. Example: AWS • 300,000,000 page impressions • Avg. 100kiB / page (== 30 TB / mo), 1TB Data • 20 queries per page, 20msec / query • 30 objects per page ( == 9,000,000,000 GET reqs/month) • 100 reqs/server/sec ( == 259,000,000 reqs/server/month) • 35 servers 27
  106. 106. Example: AWS 28
  107. 107. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  108. 108. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  109. 109. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  110. 110. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  111. 111. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  112. 112. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  113. 113. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  114. 114. Example: AWS Item Service Cost/mo Storage S3 150 Data Transfer S3 4,300 Data Requests S3 9,000 DB Storage SimpleDB 1,500 DB CPU Usage SimpleDB 3,800 Server Usage EC2 2,500 TOTALS 21,250 28
  115. 115. $21,250 / month = $0.08 CPM 300,000,000 / month (0.8% @ $10 RPM) 29
  116. 116. Them You 30
  117. 117. Design Choose Scale 31
  118. 118. Design THINK BIG—ITS CHEAP! Choose Scale 31
  119. 119. Design THINK BIG—ITS CHEAP! Choose THE RIGHT TOOLS Scale 31
  120. 120. Design THINK BIG—ITS CHEAP! Choose THE RIGHT TOOLS Scale EVERYTHING, ALWAYS 31
  121. 121. Questions? Agree? Disagree? Want to rant? marcot@tabini.ca http://mtabini.blogspot.com http://mtabini.com/twitter 32

×