Date post: | 01-Jul-2015 |
Category: |
Technology |
Upload: | dpc |
View: | 2,689 times |
Download: | 0 times |
1
SOFTWAREand the Taste of Mayo
Marco Tabiniphp|architect
1
Marco Tabini
1
Marco Tabini
1
Marco Tabini
1
Marco Tabini
1
Marco Tabini
1
Marco Tabini
1
Marco Tabini
1
Marco Tabini
1
2
What is Mayo?
2
3
3
4
4
4
5
5
5
5
WTF????
5
6
6
Where did they get this guy?
7
What does this have to do withSOFTWARE???
8
9
CODE
9
CODE
DATA
+
9
CODE
DATA
+
INTERFACE
+
9
CODE
DATA
APP
+
=
INTERFACE
+
9
CODE
10
CODE
10
CODE
HARDWARE
10
CODE
HARDWAREFIRMWARE
10
CODE
HARDWAREFIRMWAREO/S
10
CODE
HARDWAREFIRMWAREO/SWEB SERVER
10
CODE
HARDWAREFIRMWAREO/SWEB SERVERPHP
10
CODE
HARDWAREFIRMWAREO/SWEB SERVERPHPFRAMEWORK
10
CODE
HARDWAREFIRMWAREO/SWEB SERVERPHPFRAMEWORKYOUR CODE
10
11
Hello, World!
11
Hello, World!
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
Language System CallsC 47
Shell (TCSH) 146PHP (CLI) 368
PHP (Apache) 887
Once
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
Language System CallsC 47
Shell (TCSH) 146PHP (CLI) 368
PHP (Apache) 887
Once
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
Language System CallsC 47
Shell (TCSH) 146PHP (CLI) 368
PHP (Apache) 887
Once
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
Language System CallsC 47
Shell (TCSH) 146PHP (CLI) 368
PHP (Apache) 887
Once
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
Language System CallsC 47
Shell (TCSH) 146PHP (CLI) 368
PHP (Apache) 887
Once
11
Hello, World!
Language System CallsC 46
Shell (TCSH) 37PHP (CLI) 362
PHP (Apache) 881
Language System CallsC 47
Shell (TCSH) 146PHP (CLI) 368
PHP (Apache) 887
Once Twice
11
12
Language TimeC 2.5hrs
Erlang 1.8hrsPHP (CLI) N/A*
12
Language TimeC 2.5hrs
Erlang 1.8hrsPHP (CLI) N/A*
12
Language TimeC 2.5hrs
Erlang 1.8hrsPHP (CLI) N/A*
12
Language TimeC 2.5hrs
Erlang 1.8hrsPHP (CLI) N/A*
* Sorry, had to catch flight to Amsterdam
12
Ease of use Performance
13
ASM C PHP Rails
Ease of use Performance
13
ASM C PHP Rails
Ease of use Performance
13
ASM C PHP Rails
Ease of use Performance
13
ASM C PHP Rails
Ease of use Performance
13
ASM C PHP Rails
Ease of use Performance
13
Single or double quotes?
14
Single or double quotes?
vs.
file_get_contents(‘3gb_file.txt’)
14
for? foreach? while?
15
for? foreach? while?
vs.
select * fromgigantic_unindexed_tableinner joinworld_population_databaseinner join i_should_be_growing_plants_instead_of_coding
15
SOURCE
PERFORMANCE
CODE
SCALABILITY
DATA
SCALABILITY
IT
ORGANIZATION
INFRA
STRUCTURE
COST
OF
OWNERSHIP
16
SOURCE
PERFORMANCE
CODE
SCALABILITY
DATA
SCALABILITY
IT
ORGANIZATION
INFRA
STRUCTURE
COST
OF
OWNERSHIP
16
Profit Density(Profit / Pages)
Revenue Density Page Impressions
17
Profit Density(Profit / Pages)
Revenue Density Page Impressions
17
Profit Density(Profit / Pages)
Revenue Density Page Impressions
17
Profit Density(Profit / Pages)
Revenue Density Page Impressions
17
Profit Density(Profit / Pages)
Revenue Density Page Impressions
17
Profit Density(Profit / Pages)
Revenue Density Page Impressions
17
Cost Density(Cost / Pages)
18
Cost Density(Cost / Pages)
18
Cost Density(Cost / Pages)
18
Cost Density(Cost / Pages)
18
Cost Density(Cost / Pages)
18
Cost Density(Cost / Pages)
18
Cost Density(Cost / Pages)
19
Cost Density(Cost / Pages)
19
Cost Density(Cost / Pages)
19
Cost Density(Cost / Pages)
19
Cost Density(Cost / Pages)
FAIL!
19
Cost Density(Cost / Pages)
Bad Good
20
Cost Density(Cost / Pages)
Bad Good
20
Cost Density Problems
• Wrong scalability strategy
• Wrong database type
• Wrong database use
Database
21
Cost Density Problems
• Architecture not scalable
• No use of parallelization
• No use of queuing
22
Solving your infrastructure problems
(let someone else deal with them)
23
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
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
Item Service Cost/moStorage S3 4.5
Data Transfer S3 30Data Requests S3 1
DB Storage SimpleDB 45DB CPU Usage SimpleDB 55Server Usage EC2 144
TOTALS 279.5
Example: AWS
25
$280 / month
3,000,000 pages / month= $0.09 CPM
(0.9% @ $10 RPM)
26
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
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
Item Service Cost/moStorage S3 150
Data Transfer S3 4,300Data Requests S3 9,000
DB Storage SimpleDB 1,500DB CPU Usage SimpleDB 3,800Server Usage EC2 2,500
TOTALS 21,250
Example: AWS
28
$21,250 / month
300,000,000 / month= $0.08 CPM
(0.8% @ $10 RPM)
29
Them
You
30
Design
Choose
Scale31
Design
Choose
Scale
THINK BIG—ITS CHEAP!
31
Design
Choose
Scale
THINK BIG—ITS CHEAP!
THE RIGHT TOOLS
31
Design
Choose
Scale
THINK BIG—ITS CHEAP!
THE RIGHT TOOLS
EVERYTHING, ALWAYS
31
Questions? Agree? Disagree? Want to rant?
http://mtabini.blogspot.com
http://mtabini.com/twitter
32