SlideShare a Scribd company logo
Web Performace 
with Adflex.vn 
Đoàn Văn Tuyển 
CTO Eway JSC
Giới thiệu 
 Họ Tên: Đoàn Văn Tuyển 
 Chức vụ: Giám đốc kỹ thuật Eway JSC 
 Sản phẩm: Adflex.vn và Sangame.net
Adflex.vn 
 Sản phẩm quảng cáo trên di 
động: in-app& web 
 1 năm tuổi với khoảng 12 triệu 
người dùng (80% ở Việt Nam) 
 DAU ~ 800k-1M, ~ 25-30 triệu 
request/ ngày 
 Tốc độ xử lý: 4ms-40ms / request
Nội dung trình bày 
 Thiết kế hệ thống 
 Web Server & CDN 
 PHP 
 Database (MongoDB) 
 Cache server (Redis) 
 Job server (RabbitMQ) 
 Monitoring 
 Debug & Profiling
Thiết kế hệ thống
Web Server & CDN 
 Proxy (Nginx): Nhận request và phân chia vào 
nhiều server để xử lý 
 Server (Apache & PHP): Xử lý business chính 
 CDN: trả về các nội dung tĩnh như image, 
CSS & JS 
 Config for Performace: 
- Gzip / Cache time 
- Log reponse time / server time
PHP & Opcode cache
PHP Configuration 
 Cấu hình opcode cache: APC 
 Giới hạn memory: 32MB-64MB 
 Giới hạn execute time: 2-10s
Database Server
Database Server 
 Sử dụng ổ SSD 
 Chia làm 2 DB 
- 1 DB xử lý realtime. Yêu cầu update nhiều, số 
lượng request lớn 
- 1 DB xử lý report: yêu cầu query phức tạp. 
 Monitoring 
- Mongotop 
- Mongo slow query log 
- Http console log
Cache Server 
 Sử dụng Redis làm cache server 
- Lưu dữ liệu thường xuyên truy cập 
- Lưu dữ liệu yêu cầu tạm thời (một vài ngày) 
 Cache file PHP + APC
Job Server: Rabbit MQ
Job Server: Rabbit MQ 
 Xử lý tất cả những tác vụ tốn thời gian qua job 
server: Gửi mail, log dữ liệu, tính toán... 
 Sử dụng RabbitMQ làm Job Server 
 Sử dụng PHP làm worker (Chạy lệnh PHP) 
 Worker sử lý theo Batch
Monitoring - Newrelic 
 RAM 
 CPU 
 Network 
 Disk 
Used /IO
Monitoring - Newrelic 
 Response 
time 
 Appdex 
Score 
 Throughput 
 Error & Alert
Debug & Profiling
Debug & Profiling 
 Profiling: xhprof 
 Debug: Apache log4php 
 Manual: 
- microtime 
- register_shutdown_function 
- debug_print_backtrace 
- ...
Q&A
Tham khảo 
http://www.slideshare.net/tuyenbk83/php-web-server-performace 
http://java.dzone.com/articles/php-performance-crash-course 
http://on.fb.me/1hAc7vL 
https://developers.google.com/speed/docs/best-practices/rules_intro 
http://developer.yahoo.com/performance/rules.html 
http://www.slideshare.net/lonelywolf/web-optimization 
http://code.google.com/p/modpagespeed/ 
https://github.com/pagespeed/ngx_pagespeed 
://developer.yahoo.com/yslow/ 
https://developers.google.com/speed/pagespeed/insights_extensions 
https://addons.mozilla.org/en-US/firefox/addon/firebug 
http://php.net/manual/en/book.apc.php 
http://php.net/manual/en/book.xhprof.php 
http://www.mdproductions.ca/guides/50-best-practices-to-optimize-php-code-performance 
http://www.chazzuka.com/63-best-practice-to-optimize-php-code-performances-58/ 
http://fuscata.com/kb/set-maxclients-apache-prefork

More Related Content

PPTX
Scaling php
PDF
Giới thiệu Embulk
PDF
Zing Me & PHP
PPTX
Maria db spider engine
PPTX
Phương pháp và chiến lược đối ứng tải trong Web Application Server
PPT
Một số ứng dụng của Redis, NoSQL tại Tamtay - PHPDay 2012
DOC
Lab 3 phân loại dùng nbar
 
PDF
Postgre sql and_enterprise_level_database_features
Scaling php
Giới thiệu Embulk
Zing Me & PHP
Maria db spider engine
Phương pháp và chiến lược đối ứng tải trong Web Application Server
Một số ứng dụng của Redis, NoSQL tại Tamtay - PHPDay 2012
Lab 3 phân loại dùng nbar
 
Postgre sql and_enterprise_level_database_features

What's hot (6)

PDF
Postgre sql & enterprise level database features
PPTX
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVER
PPT
Báo cáo thực tập - Huỳnh Anh Tuấn
DOCX
Install ssl xampp
DOCX
Xd email server zimbra
PPTX
Training about hardware server.1
Postgre sql & enterprise level database features
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVER
Báo cáo thực tập - Huỳnh Anh Tuấn
Install ssl xampp
Xd email server zimbra
Training about hardware server.1
Ad

Similar to Web performace with Adflex (20)

PDF
BDCLPM_6.pdfnkjhghfdfsfdxgfchvgjbhjbhgfdzsxdcfvg
PDF
Tìm nền tảng lập trình cho 5 năm tới
PPTX
ITLC HN 14 - Bizweb Microservices Architecture
PDF
Bizweb Microservices Architecture
PPT
10 buoc tro thanh lap trinh vien chuyen nghiep
PDF
PHP.pdf
PPT
19 web server
PPTX
Chuong 1 tong quan về lập trình web động
PDF
Sapo Microservices Architecture
PDF
Kinh nghiệm triển khai Microservices tại Sapo.vn
PDF
Web server là gì? Cách thức hoạt động và các loại máy chủ web phổ biến
PDF
PPT
Php - Xu Huong Ung Dung Va Cong Nghe 2010
PDF
[Relipa Software] Giới thiệu về AWS - Áp dụng xây dựng website 1M requests
PDF
(HoaND) giao trinh webservice
PPT
Web Architecture
PDF
Đề tài: Xây dựng Website cho công ty cổ phần tin học, HOT
PDF
Luận văn xây dựng cổng thông tin điện tử ubnd tỉnh quảng bình bằng wordpress
PDF
KHUNG HƯỚNG DẪN LẬP ĐỀ CƯƠNG VÀ DỰ TOÁN CHI TIẾT CHO CÁC DỰ ÁN CNTT NĂM 2015 ...
DOCX
Web service
BDCLPM_6.pdfnkjhghfdfsfdxgfchvgjbhjbhgfdzsxdcfvg
Tìm nền tảng lập trình cho 5 năm tới
ITLC HN 14 - Bizweb Microservices Architecture
Bizweb Microservices Architecture
10 buoc tro thanh lap trinh vien chuyen nghiep
PHP.pdf
19 web server
Chuong 1 tong quan về lập trình web động
Sapo Microservices Architecture
Kinh nghiệm triển khai Microservices tại Sapo.vn
Web server là gì? Cách thức hoạt động và các loại máy chủ web phổ biến
Php - Xu Huong Ung Dung Va Cong Nghe 2010
[Relipa Software] Giới thiệu về AWS - Áp dụng xây dựng website 1M requests
(HoaND) giao trinh webservice
Web Architecture
Đề tài: Xây dựng Website cho công ty cổ phần tin học, HOT
Luận văn xây dựng cổng thông tin điện tử ubnd tỉnh quảng bình bằng wordpress
KHUNG HƯỚNG DẪN LẬP ĐỀ CƯƠNG VÀ DỰ TOÁN CHI TIẾT CHO CÁC DỰ ÁN CNTT NĂM 2015 ...
Web service
Ad

Web performace with Adflex

  • 1. Web Performace with Adflex.vn Đoàn Văn Tuyển CTO Eway JSC
  • 2. Giới thiệu  Họ Tên: Đoàn Văn Tuyển  Chức vụ: Giám đốc kỹ thuật Eway JSC  Sản phẩm: Adflex.vn và Sangame.net
  • 3. Adflex.vn  Sản phẩm quảng cáo trên di động: in-app& web  1 năm tuổi với khoảng 12 triệu người dùng (80% ở Việt Nam)  DAU ~ 800k-1M, ~ 25-30 triệu request/ ngày  Tốc độ xử lý: 4ms-40ms / request
  • 4. Nội dung trình bày  Thiết kế hệ thống  Web Server & CDN  PHP  Database (MongoDB)  Cache server (Redis)  Job server (RabbitMQ)  Monitoring  Debug & Profiling
  • 6. Web Server & CDN  Proxy (Nginx): Nhận request và phân chia vào nhiều server để xử lý  Server (Apache & PHP): Xử lý business chính  CDN: trả về các nội dung tĩnh như image, CSS & JS  Config for Performace: - Gzip / Cache time - Log reponse time / server time
  • 7. PHP & Opcode cache
  • 8. PHP Configuration  Cấu hình opcode cache: APC  Giới hạn memory: 32MB-64MB  Giới hạn execute time: 2-10s
  • 10. Database Server  Sử dụng ổ SSD  Chia làm 2 DB - 1 DB xử lý realtime. Yêu cầu update nhiều, số lượng request lớn - 1 DB xử lý report: yêu cầu query phức tạp.  Monitoring - Mongotop - Mongo slow query log - Http console log
  • 11. Cache Server  Sử dụng Redis làm cache server - Lưu dữ liệu thường xuyên truy cập - Lưu dữ liệu yêu cầu tạm thời (một vài ngày)  Cache file PHP + APC
  • 13. Job Server: Rabbit MQ  Xử lý tất cả những tác vụ tốn thời gian qua job server: Gửi mail, log dữ liệu, tính toán...  Sử dụng RabbitMQ làm Job Server  Sử dụng PHP làm worker (Chạy lệnh PHP)  Worker sử lý theo Batch
  • 14. Monitoring - Newrelic  RAM  CPU  Network  Disk Used /IO
  • 15. Monitoring - Newrelic  Response time  Appdex Score  Throughput  Error & Alert
  • 17. Debug & Profiling  Profiling: xhprof  Debug: Apache log4php  Manual: - microtime - register_shutdown_function - debug_print_backtrace - ...
  • 18. Q&A
  • 19. Tham khảo http://www.slideshare.net/tuyenbk83/php-web-server-performace http://java.dzone.com/articles/php-performance-crash-course http://on.fb.me/1hAc7vL https://developers.google.com/speed/docs/best-practices/rules_intro http://developer.yahoo.com/performance/rules.html http://www.slideshare.net/lonelywolf/web-optimization http://code.google.com/p/modpagespeed/ https://github.com/pagespeed/ngx_pagespeed ://developer.yahoo.com/yslow/ https://developers.google.com/speed/pagespeed/insights_extensions https://addons.mozilla.org/en-US/firefox/addon/firebug http://php.net/manual/en/book.apc.php http://php.net/manual/en/book.xhprof.php http://www.mdproductions.ca/guides/50-best-practices-to-optimize-php-code-performance http://www.chazzuka.com/63-best-practice-to-optimize-php-code-performances-58/ http://fuscata.com/kb/set-maxclients-apache-prefork