SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Postgre sql & enterprise level database features
Postgre sql & enterprise level database featuresPostgre sql & enterprise level database features
Postgre sql & enterprise level database featuresthekid0611
 
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVER
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVERGIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVER
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVERPMC WEB
 
Báo cáo thực tập - Huỳnh Anh Tuấn
Báo cáo thực tập - Huỳnh Anh TuấnBáo cáo thực tập - Huỳnh Anh Tuấn
Báo cáo thực tập - Huỳnh Anh TuấnHuỳnh Tuấn
 
Xd email server zimbra
Xd email server zimbraXd email server zimbra
Xd email server zimbralaonap166
 
Training about hardware server.1
Training about hardware server.1Training about hardware server.1
Training about hardware server.1TranVy Vy
 

Mais procurados (6)

Postgre sql & enterprise level database features
Postgre sql & enterprise level database featuresPostgre sql & enterprise level database features
Postgre sql & enterprise level database features
 
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVER
GIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVERGIỚI THIỆU CÁC DẠNG MÁY CHỦ SERVER
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
Báo cáo thực tập - Huỳnh Anh TuấnBáo cáo thực tập - Huỳnh Anh Tuấn
Báo cáo thực tập - Huỳnh Anh Tuấn
 
Install ssl xampp
Install ssl xamppInstall ssl xampp
Install ssl xampp
 
Xd email server zimbra
Xd email server zimbraXd email server zimbra
Xd email server zimbra
 
Training about hardware server.1
Training about hardware server.1Training about hardware server.1
Training about hardware server.1
 

Semelhante a Web performace with Adflex

Web Architecture
Web ArchitectureWeb Architecture
Web ArchitectureHiep Luong
 
19 web server
19  web server19  web server
19 web serverCơn Gió
 
Chuong 1 tong quan về lập trình web động
Chuong 1 tong quan về lập trình web độngChuong 1 tong quan về lập trình web động
Chuong 1 tong quan về lập trình web độngTHPT Ngô Quyền
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnKinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnDotnet Open Group
 
Pham Anh Tu - TK Framework
Pham Anh Tu - TK FrameworkPham Anh Tu - TK Framework
Pham Anh Tu - TK FrameworkVu Hung Nguyen
 
10 buoc tro thanh lap trinh vien chuyen nghiep
10 buoc tro thanh lap trinh vien chuyen nghiep10 buoc tro thanh lap trinh vien chuyen nghiep
10 buoc tro thanh lap trinh vien chuyen nghiepVo Duc Thien
 
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
[123doc.vn]   xay dung he thong mang cho doanh nhiep nho[123doc.vn]   xay dung he thong mang cho doanh nhiep nho
[123doc.vn] xay dung he thong mang cho doanh nhiep nhoNguyễn Quân
 
Technical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vnTechnical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vnAsahina Infotech
 
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015IT Expert Club
 
Kiến thức cần thiết làm việc
Kiến thức cần thiết làm việcKiến thức cần thiết làm việc
Kiến thức cần thiết làm việcmanhvokiem
 
Thiết kế hệ thống mạng nội bộ cho cty vn transport
Thiết kế hệ thống mạng nội bộ cho cty vn transportThiết kế hệ thống mạng nội bộ cho cty vn transport
Thiết kế hệ thống mạng nội bộ cho cty vn transportHate To Love
 
Lab 8 dhcp server
Lab 8 dhcp server Lab 8 dhcp server
Lab 8 dhcp server tinhban269
 

Semelhante a Web performace with Adflex (20)

Zing
ZingZing
Zing
 
03 udpt php
03 udpt   php03 udpt   php
03 udpt php
 
Web Architecture
Web ArchitectureWeb Architecture
Web Architecture
 
07 web course 1 php co ban
07 web course   1 php co ban07 web course   1 php co ban
07 web course 1 php co ban
 
19 web server
19  web server19  web server
19 web server
 
Chuong 1 tong quan về lập trình web động
Chuong 1 tong quan về lập trình web độngChuong 1 tong quan về lập trình web động
Chuong 1 tong quan về lập trình web động
 
Báo cáo tuần đồ án
Báo cáo tuần đồ ánBáo cáo tuần đồ án
Báo cáo tuần đồ án
 
Sapo Microservices Architecture
Sapo Microservices ArchitectureSapo Microservices Architecture
Sapo Microservices Architecture
 
Kinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vnKinh nghiệm triển khai Microservices tại Sapo.vn
Kinh nghiệm triển khai Microservices tại Sapo.vn
 
Pham Anh Tu - TK Framework
Pham Anh Tu - TK FrameworkPham Anh Tu - TK Framework
Pham Anh Tu - TK Framework
 
10 buoc tro thanh lap trinh vien chuyen nghiep
10 buoc tro thanh lap trinh vien chuyen nghiep10 buoc tro thanh lap trinh vien chuyen nghiep
10 buoc tro thanh lap trinh vien chuyen nghiep
 
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
[123doc.vn]   xay dung he thong mang cho doanh nhiep nho[123doc.vn]   xay dung he thong mang cho doanh nhiep nho
[123doc.vn] xay dung he thong mang cho doanh nhiep nho
 
Arrowjs.io
Arrowjs.ioArrowjs.io
Arrowjs.io
 
Technical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vnTechnical note playframework_documentation_working with play - java_vn
Technical note playframework_documentation_working with play - java_vn
 
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
 
Kiến thức cần thiết làm việc
Kiến thức cần thiết làm việcKiến thức cần thiết làm việc
Kiến thức cần thiết làm việc
 
Thiết kế hệ thống mạng nội bộ cho cty vn transport
Thiết kế hệ thống mạng nội bộ cho cty vn transportThiết kế hệ thống mạng nội bộ cho cty vn transport
Thiết kế hệ thống mạng nội bộ cho cty vn transport
 
Node.js căn bản
Node.js căn bảnNode.js căn bản
Node.js căn bản
 
Lab 8 dhcp server
Lab 8 dhcp server Lab 8 dhcp server
Lab 8 dhcp server
 
Lab 8 dhcp server
Lab 8 dhcp server Lab 8 dhcp server
Lab 8 dhcp server
 

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