Top Banner
Scaling Tech in Asia How we scaled Tech in Asia
15
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Scaling Tech in Asia

Scaling Tech in AsiaHow we scaled Tech in Asia

Page 2: Scaling Tech in Asia

About Me

• WordPress Plugins Developer– Since 2003– Created > 22 plugins• wp-pagenavi, wp-polls, wp-postratings, wp-postviews,

wp-dbmanager, etc• http://profiles.wordpress.org/gamerz

• Tech Guy in Tech in Asia– Started officially on 1st September 2014– We are still hiring

Lester Chan (@gamerz) [ 2 ]

Page 3: Scaling Tech in Asia

Timeline

• July 2014– Willis approached me to join Tech in Asia and

expand the engineering team• August 2014– Hired an awesome engineer, Li Soon– Both of us started work to scale Tech in Asia

Lester Chan (@gamerz) [ 3 ]

Page 4: Scaling Tech in Asia

Previous Servers

• Previous– Digital Ocean• 1 server• 32 GB/12 CPUS, 320 GB SSD Disk and 7TB transfer• US$320/month• Crashed when we have about 500 users online at the

same time

Lester Chan (@gamerz) [ 4 ]

Page 5: Scaling Tech in Asia

Lester Chan (@gamerz)

Current Servers

• Current– SoftLayer• Catalyst Startup Program• USD$10,000 credits per month• 5 Bare Metal Servers

– 1x Load Balancer– 3x Web Servers– 2x Database Server– 1x Ops Server

• Highest recorded users online is 2,734

[ 5 ]

Page 6: Scaling Tech in Asia

Lester Chan (@gamerz)

Monitoring

• Graphite– Push based

• Grafana– Front-end for Graphite

• collectd– data-collecting daemon– network, cpu, load, etc

[ 6 ]

Page 7: Scaling Tech in Asia

Lester Chan (@gamerz)

User Uploaded Files

• /wp-content/uploads– File uploads are stored here

• GlusterFS– Write once, read everywhere

• Distributed architecture for syncing files• Avoids a single point of failure (i.e. NAS)

[ 7 ]

Page 8: Scaling Tech in Asia

Lester Chan (@gamerz)

WordPress

• Moved WordPress to a folder /core/– Prevent automated attacks– /core/ is a git checkout of WordPress

• HTTPS– Encrypts sensitive data between computers– Prevents man in the middle attacks– Ranking boost in Google SEO

[ 8 ]

Page 9: Scaling Tech in Asia

Lester Chan (@gamerz)

Cleaning Up Plugins

• Removed 48 plugins– From 83 plugins to 35 plugins

• Some plugins are poorly coded– No uninstall.php

• Manually removed plugin options from wp_options table

– Remove meta• Comment• Post• User

[ 9 ]

Page 10: Scaling Tech in Asia

Lester Chan (@gamerz)

CDN

• Previous– EdgeCast• Horrible UI/UX admin interface• No free shared SSL cert

• Current– MaxCDN• Free for us• YC Deal

[ 10 ]

Page 11: Scaling Tech in Asia

Lester Chan (@gamerz)

Redesigning Theme

• The TiA theme was poorly coded– No proper use of WordPress API– Unnecessary SQL queries all over the place– Not minifying CSS/JS– Unused features still in code

[ 11 ]

Page 12: Scaling Tech in Asia

Lester Chan (@gamerz)

Redesigning Theme

• Rewrote the theme from scratch– Removed unused or unnecessary features– Use of SVG and Font Icons– Flatter UI– CSS/JS more efficient• Combine + Minify

– Caching

[ 12 ]

Page 13: Scaling Tech in Asia

Lester Chan (@gamerz)

Web Stack

• Previous– Apache– PHP– MySQL

• Current– nginx– HHVM– MariaDB

[ 13 ]

Page 14: Scaling Tech in Asia

Lester Chan (@gamerz)

Summary

• Moving Servers• Cleaning up WordPress Plugins• Redesigning theme• Changing our web stack

[ 14 ]

Page 15: Scaling Tech in Asia

Lester Chan (@gamerz)

Questions?

• Any questions?• You can also find me at– Blog: https://lesterchan.net– Twitter: @gamerz– Facebook: https://fb.com/lesterchan– Instagram: @gamerz

[ 15 ]