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.
Tối ưu hóa hệ thống
30 triệu người dùng
IT Expert Club
CONTENT
1. Introduction
2. Solution
3. Caching
4. Asynchronous
5. Scale
6. Distributed
7. Profiling and Turning
1. Introduction
CTO of Ecomobi
Contact info:
• EMAIL: TUYENDV@ECOMOBI.COM
• MOBILE: (+84)904.554.112
• SKYPE: ITBACHKHOA
1. Introduction
Ecomobi is a CPA Network focus on SEA Market.
Main Flow
Daily Information
Affiliate Networks
• 1.5M+ DAU
• 2-3M CLICK
• 1TB TRANSFER
• USER: VN, ID, IN, BR...
Ads Networks
• 30M+...
Our Issues
• High Availability
• Minimize Response time
• Concurrency
• High Bandwidth
• International user
2. Our Solutions
• Measurement tools
• Select Services Provider
• Programming language
• Database
• Others
2. Measurement
• Analytics
• Quick or Slow
• Error or Accuracy
• Stable or Unstable
• Better or Worse
2. Measurement Tools - New
Relic
2. Measurement Tools - New Relic
Services Provider?
• Dedicated Server in Viet nam
• Private cloud
• Docker
• VPS Provider in Vietnamese
• Amazon Web Servi...
Programming language?
• PHP
• JAVA
• Erlang / Elixir
• Node JS / Golang
Database
• MySQL / MariaDB
• PostgreSQL
• MongoDB
• Cassandra / couchbase / Riak
• Redis / Memcache
• Elasticsearch
Message Queue
• RabbitMQ
• Redis
• Activemq / Zeromq
• Kafka
• Gearman (Job Server)
Other
• Caching
• Asynchronous
• Scale out
• Distributed
Our Stack
3.Caching
• In-memory / variable caching
• Cache size => minimize (why)
• Increasing Cache Hit / Cache Miss
• Cache Read t...
3.Caching: memory
function getInfoWithCache($id) {
static $cache_contents = array();
if (isset($cache_contents[$id])) {
re...
Caching - Minimize cache size
3.Caching - increasing cache hit
$candidates = Campaign for
• Active campaigns
• Allow Android 4.0.1
• Allow Vietnam
• Not...
Cache read through issue!!!
function getData($id)
{
$data = getDataFromCache($id);
if (!empty($data) {
return $data;
}
$da...
4. Asynchronous
• Send a external HTTP request
• Send a email
• Working with file
• Working with DB
• …
4. Asynchronous
• Decreasing Response time
• Deal with huge of request
4. Asynchronous - MQ
4. Asynchronous - MQ
while (true) {
$msg = getMessageQueue();
if (empty($msg)) {
sleep(1);
continue;
}
processMQ($msg);
if...
5.1 Web Application Scale
5.2 Database layer
6. Distributed
6. Distributed
6. CDN
7. Profiling
Toi uu hoa he thong 30 trieu nguoi dung
Upcoming SlideShare
Loading in …5
×

Toi uu hoa he thong 30 trieu nguoi dung

3,360 views

Published on

ITEC - Tối ưu hóa hệ thống 30 triệu người dung - ngày 23/06/2016

Published in: Software
  • Follow the link, new dating source: ♥♥♥ http://bit.ly/36cXjBY ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❤❤❤ http://bit.ly/36cXjBY ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DỊCH VỤ THIẾT KẾ POWERPOINT (Thiết kế profile cho doanh nghiệp--- Thiết kế Brochure--- Thiết kế Catalogue--- slide bài giảng--- slide bài phát biểu---slide bài TIỂU LUẬN, LUẬN VĂN TỐT NGHIỆP--- dạy học viên thiết kế powerpoint…)-----(Giá từ 8.000 đ - 10.000 đ/1trang slide)------ Mọi chi tiết vui lòng liên hệ với chúng tôi: điện thoại 0973.764.894 hoặc zalo 0973.764.894 (Miss. Huyền) ----- • Thời gian hoàn thành: 1-2 ngày sau khi nhận đủ nội dung ----- Qui trình thực hiện: ----- 1. Bạn gửi nội dung cần thiết kế về địa chỉ email: dvluanvan@gmail.com ----- 2. DỊCH VỤ THIẾT KẾ POWERPOINT báo giá chi phí và thời gian thực hiện cho bạn ----- 3. Bạn chuyển tiền tạm ứng 50% chi phí để tiến hành thiết kế ----- 4. Gửi file slide demo cho bạn xem để thống nhất chỉnh sửa hoàn thành. ----- 5. Bạn chuyển tiền 50% còn lại. ----- 6. Bàn giao file gốc cho bạn.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Toi uu hoa he thong 30 trieu nguoi dung

  1. 1. Tối ưu hóa hệ thống 30 triệu người dùng IT Expert Club
  2. 2. CONTENT 1. Introduction 2. Solution 3. Caching 4. Asynchronous 5. Scale 6. Distributed 7. Profiling and Turning
  3. 3. 1. Introduction CTO of Ecomobi Contact info: • EMAIL: TUYENDV@ECOMOBI.COM • MOBILE: (+84)904.554.112 • SKYPE: ITBACHKHOA
  4. 4. 1. Introduction Ecomobi is a CPA Network focus on SEA Market.
  5. 5. Main Flow
  6. 6. Daily Information Affiliate Networks • 1.5M+ DAU • 2-3M CLICK • 1TB TRANSFER • USER: VN, ID, IN, BR... Ads Networks • 30M+ USERS • 1M+ DAU • 40M+ ADS REQUEST • 70K+ RPM • USERS: VN, ID, IN, BR...
  7. 7. Our Issues • High Availability • Minimize Response time • Concurrency • High Bandwidth • International user
  8. 8. 2. Our Solutions • Measurement tools • Select Services Provider • Programming language • Database • Others
  9. 9. 2. Measurement • Analytics • Quick or Slow • Error or Accuracy • Stable or Unstable • Better or Worse
  10. 10. 2. Measurement Tools - New Relic
  11. 11. 2. Measurement Tools - New Relic
  12. 12. Services Provider? • Dedicated Server in Viet nam • Private cloud • Docker • VPS Provider in Vietnamese • Amazon Web Service • Digital Ocean / Linode • VPS in Local Provider
  13. 13. Programming language? • PHP • JAVA • Erlang / Elixir • Node JS / Golang
  14. 14. Database • MySQL / MariaDB • PostgreSQL • MongoDB • Cassandra / couchbase / Riak • Redis / Memcache • Elasticsearch
  15. 15. Message Queue • RabbitMQ • Redis • Activemq / Zeromq • Kafka • Gearman (Job Server)
  16. 16. Other • Caching • Asynchronous • Scale out • Distributed
  17. 17. Our Stack
  18. 18. 3.Caching • In-memory / variable caching • Cache size => minimize (why) • Increasing Cache Hit / Cache Miss • Cache Read through issue
  19. 19. 3.Caching: memory function getInfoWithCache($id) { static $cache_contents = array(); if (isset($cache_contents[$id])) { return $cache_contents[$id]; } $data = getInfoWithoutCache($id) $cache_contents[$id] = $data; return $data; }
  20. 20. Caching - Minimize cache size
  21. 21. 3.Caching - increasing cache hit $candidates = Campaign for • Active campaigns • Allow Android 4.0.1 • Allow Vietnam • Not gambling • CPI or CPC • IF CPC: PRICE > $0.03 • IF CPI: PRICE > $0.5 • Did not install this game / app … Candidates = Campaign for • Active Campaigns • Allow Vietnam Candidates = Filter(Candidates) • Allow Android 4.0.1 • Not gambling • CPC or CPC …
  22. 22. Cache read through issue!!! function getData($id) { $data = getDataFromCache($id); if (!empty($data) { return $data; } $data = getDataWithoutCache($id); setDataToCache($id, $data, $exprire_time); return $data; }
  23. 23. 4. Asynchronous • Send a external HTTP request • Send a email • Working with file • Working with DB • …
  24. 24. 4. Asynchronous • Decreasing Response time • Deal with huge of request
  25. 25. 4. Asynchronous - MQ
  26. 26. 4. Asynchronous - MQ while (true) { $msg = getMessageQueue(); if (empty($msg)) { sleep(1); continue; } processMQ($msg); if ($need_stop) { break; } }
  27. 27. 5.1 Web Application Scale
  28. 28. 5.2 Database layer
  29. 29. 6. Distributed
  30. 30. 6. Distributed
  31. 31. 6. CDN
  32. 32. 7. Profiling

×