Softwares on Large Scale Internet Services

28
Softwares on Large Scale Internet Services 2013/07/18 at Tokyo Univ. SATOSHI TAGOMORI (@tagomoris) LINE Corp.

Transcript of Softwares on Large Scale Internet Services

Page 1: Softwares on Large Scale Internet Services

Softwareson Large Scale Internet Services

2013/07/18 at Tokyo Univ.SATOSHI TAGOMORI (@tagomoris)

LINE Corp.

Page 2: Softwares on Large Scale Internet Services

topics

About LINE Corp.

Service scales

Large is worse

Internet (Web) service architecture

Case studies on LINE Corp.

Q&A

Page 3: Softwares on Large Scale Internet Services

TAGOMORI Satoshi (@tagomoris)LINE corp.

Page 4: Softwares on Large Scale Internet Services

tagomoris: 田籠 聡

-2005.03:東京大学計数工学科システム情報工学コース新研究室

2005.04-2006.03: 朝日ネット2006.03-2010.06: NTTデータ先端技術2010.08-:ライブドア → NHN Japan → LINE

Page 5: Softwares on Large Scale Internet Services
Page 6: Softwares on Large Scale Internet Services

Service scales

small, middle, large and huge scale

Scale(1): Users, traffics, data amount, market share, ...

Scale(2): Servers, programmers, lines of code, ...

Page 7: Softwares on Large Scale Internet Services

Service scales

small middle large huge

users ~100k ~1m ~10m 100m~

servers 1, 2 or 3 ... tens handreds thousandsor more

ex. … …livedoor blog

cookpadAmeba, 楽天, ...

Google, TwitterFacebook

Amazon, ...

Page 8: Softwares on Large Scale Internet Services

More/less servers

Servers

less: computing power-- / management cost--

more: computing power++ / management cost++

Server types (complexity)

less: efficiency-- / management cost--

more: efficiency++ / management cost++

Page 9: Softwares on Large Scale Internet Services

Large is worse:more traffics needs more computing power

less server types more server types

less servers

more servers

small middle

huge large

Page 10: Softwares on Large Scale Internet Services

Small scale internet (web) serviceserver-side architecture

Users (PC, smartphone, mobilephone, ...)

Database(RDBMS, NoSQL)

Web Server + Application Server(Apache + PHP, nginx + passenger(ruby), ...)

External API

Page 11: Softwares on Large Scale Internet Services

Middle scale internet (web) serviceserver-side architecture

Users (PC, smartphone, mobilephone, ...)

Database(RDBMS, NoSQL)External API

Application Server(Java, Perl, Ruby, ...)

Caches(memory, disk)

Web Server (Apache, nginx, ...)

Page 12: Softwares on Large Scale Internet Services

Large scale internet (web) serviceserver-side architecture

Users (PC, smartphone, mobilephone, ...)

Database(RDBMS, NoSQL)External API

Application Server(Java, Perl, Ruby, ...)

Caches(memory, disk)

CDN

Storage Service

Web Server (Apache, nginx, ...)

Dataanalysis

Page 13: Softwares on Large Scale Internet Services

Huge scale internet (web) serviceserver-side architecture

Users (PC, smartphone, mobilephone, ...)

Distributed datastore(GFS+BigTable, HDFS+HBase, ...)

Application server farm (IaaS, PaaS)

Web server cluster + CDN

Page 14: Softwares on Large Scale Internet Services

Software engineering:for large scale services

Performance: application, database, storage, cpu

Stability: network, high availability, monitoring, logging

Low costs: deployment, continuous testing

Incomes: response time, data analysis, visualization

Page 15: Softwares on Large Scale Internet Services

Our scope in server side

Users (PC, smartphone, mobilephone, ...)

Database(RDBMS, NoSQL)External API

Application Server(Java, Perl, Ruby, ...)

Caches(memory, disk)

CDN

Storage Service

Web Server (Apache, nginx, ...)

Dataanalysis

Page 16: Softwares on Large Scale Internet Services

Our scope in server side

Users (PC, smartphone, mobilephone, ...)

Database(RDBMS, NoSQL)External API

Application Server(Java, Perl, Ruby, ...)

Caches(memory, disk)

CDN

Storage Service

Web Server (Apache, nginx, ...)

Dataanalysis

Page 17: Softwares on Large Scale Internet Services

BREAK.

Page 18: Softwares on Large Scale Internet Services

CASE STUDIES OFLINE CORP.

Page 19: Softwares on Large Scale Internet Services

LINE secret sale:traffic spike

Heavy traffic on sale timetransactionsremaining updatesimage outbounds

SSDApplication tuning

transactionscache updates

Page 20: Softwares on Large Scale Internet Services

LINE manga:content delivery

content (image) delivery

STF

distributed object storage

Page 21: Softwares on Large Scale Internet Services

livedoor blog:heavy traffic

STF based image storage + cache

CDN

MySQL database cluster

Server Side Include (SSI)

Access analysis tools

Page 22: Softwares on Large Scale Internet Services

system administration:server setup, deployment, monitoring, ...

server setup / deployment:automation(kickstart), testing(serverspec)itempotent deployment(chef, puppet)transactional operation

monitoring:server/switch metricsCDN API integration

Page 23: Softwares on Large Scale Internet Services

Service monitoring:Hadoop, stream processing, ...

Daily service metrics (hadoop+hive)

Pageviews, Unique users, ...

(Semi-)Real-time service metrics (fluentd+norikra)

Req/sec, Error rate, Response time percentile, ...

+ system integration

autoscaling, service status for end users, ...

Page 24: Softwares on Large Scale Internet Services

micro level tunings

Log archive serverlinux md raid-6 → hardware raid-1+0I/O performance dramatically decreasedI/O schedular: CFQ → deadline

Stream processing node (ruby, fluentd)Increasing memory usage (fragmentation)Memory allocator: glibc malloc → jemalloc

Page 25: Softwares on Large Scale Internet Services

Our scope in server side

Users (PC, smartphone, mobilephone, ...)

Database(RDBMS, NoSQL)External API

Application Server(Java, Perl, Ruby, ...)

Caches(memory, disk)

CDN

Storage Service

Web Server (Apache, nginx, ...)

Dataanalysis

Page 26: Softwares on Large Scale Internet Services

Our scope of computer stack

PC/smartphone browser iOS/Android App

web servers / application serversapplication code

language runtime object stores RDBMS / KVS

OSserver, NIC, memory, HDD/SSD, ...

network, firewall, load balancingauthentication(policies), audit

logger / watchdogs / cron / ...

HTML/CSS, Javascript ...

Page 27: Softwares on Large Scale Internet Services

Softwareson large scale internet services

All of available things!

linux, lvs, haproxy, apache, nginx, squid, varnish, memcached, mysql, kyoto tycoon, mongodb, cassandra, redis, riak, perl, ruby, php, python, java, javascript, node.js, hadoop, hbase, hive, fluentd, ...

except for

global-scale distributed systems

processor design

Page 28: Softwares on Large Scale Internet Services

ALL OPTIONSARE AVAILABLEINSERVICE PROVIDERS.