SlideShare a Scribd company logo
1 of 34
Download to read offline
High Performance Solution for PHP
An introduction to the PHP extensions of mine
@laruence
About Me
• Author of Yaf, Yar, Yac, Yaconf, Taint
• Maintainer of Opcache, Msgpack, PHP-Lua
• PHP core developer since 2011
• Consultant at Zend since 2013
• Core developer of PHP7(NG branch)
• Chief architect at Lianjia.com
• Terrible english speaker
Overview
• Weibo V5 (2012 ~ 2015)
• Billions PV per day(PHPend)
• 300% Performance improvement
• 60% Response time reduced
• More than 1000 servers saved
• Nginx , PHP-5.4
Framework
Yaf
• Use or Not Use Framework was a problem
Yaf
• What should a PHP framework do
• Routing
• Dispatching
• Autoloading
• View?
• ORM?
Yaf - Yet Another Framework
• The first PHP framework in extension
Yaf
• Wildly used at Weibo, Baidu, Sina etc
• https://github.com/laruence/yaf
• Alternative: Phalcon
SOA
Yar
• Why SOA
• Decoupling
• Cooperation
• High Available
• Scale out
• ?
Yar
• Performance matters (latency or throughput)
• Latency is not always 1/throughput
• Trade Throughput for latency
• Concurrent
Yar - Yet Another RPC framework
• Concurrent, Light RPC framework in extension
• Multiply packagers supported(json, php, msgpack)
• Multiply types of backend supported(C, PHP, Java)
Yar
• Yar for C framework
• Multiply processes
• Async
• Event Driven
Yar
• Wildly used at Weibo
• https://github.com/laruence/yar
• https://github.com/laruence/yar-c
• Alternative: json-rpc, thrift
Cache
Yac
• Cache ~ Panacea for performance
• Memcached
• Redis
Yac
• Why not memcached
• Network
• Single point problem
• Complexity of operation and maintenance
Yac
• Lockless user data cache in shared memory
Yac - Yet Another Cache
• Yac is not safe
• less than 1/10000000 chance it will get a wrong result
• Where is can be used
Yac
• Not wildly used :)
• https://github.com/laruence/yac
• Alternative: APC, Memcached
Configurations
Yaconf
• Configurations is always not really configurations
• Envs, Dicts, Caches
• PHP, Json, Yaml
Yaconf
• What is wrong with it
• Parsing every time
• Release with codes
• Opaque for developer
• …
Yaconf - Yet Another Config Container
• Persistent configurations container in extension
• INI file
• Supports multiply files, sections
• Supports constants, environ variables in PHP
• Loading once serve multiply requests
Yaconf
• Wildly used at Weibo
• https://www.github.com/laruence/yaconf
• Alternative: Hidef
Security
Taint
• What is the top security issues in PHP
• XSS, SQL Injection, RCE
Taint
• How taint works
• echo, print, file_put_contents, die, exit, header etc
• require, include, eval, fopen etc
• mysql_query, mysqli_query, PDO::query, PDO::prepare etc
• system, exec, shell_exec, proc_open etc
• call_user_func, preg_replace_callback, unserialize etc
Taint
• It is not a cure
• Don’t use it in product env since it will slow down the performance
• https://wiki.php.net/rfc/taint
• https://github.com/laruence/taint
• Alternative: RIPS etc
Accelerator
Opcache
• It is not only a opcodes cache
• It also is a opcodes optimizer
• Contant propagation
• Dead codes removal
• Literations compact
• NOPS removal
• …
Opcache
• Wildly used everywhere
• Actually, it is shipped with PHP since PHP-5.5
• Always remember to enable it
PHP7
• Yaf 17%
• Yar 10%
• Yac 20%
• Yaconf (only for PHP7)
• Opcache
• file-based opcodes cache
• hugepagefy text segment
Q&A

More Related Content

What's hot

Reviewing CPAN modules
Reviewing CPAN modulesReviewing CPAN modules
Reviewing CPAN modulesneilbowers
 
CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5neilbowers
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvmNLJUG
 
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)Roes Wibowo
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansWindzoon Technologies
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015Tim Bracken
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introductionSimon Funk
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkBukhori Aqid
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to LaravelVin Lim
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to LaravelEli Wheaton
 
CPAN Dependency Heaven
CPAN Dependency HeavenCPAN Dependency Heaven
CPAN Dependency HeavenOpusVL
 
Perl in the Real World
Perl in the Real WorldPerl in the Real World
Perl in the Real WorldOpusVL
 
Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscriptBill Buchan
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5Soheil Khodayari
 

What's hot (20)

Laravel
LaravelLaravel
Laravel
 
Reviewing CPAN modules
Reviewing CPAN modulesReviewing CPAN modules
Reviewing CPAN modules
 
CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5CPAN Exporter modules for Perl 5
CPAN Exporter modules for Perl 5
 
Shootout! template engines on the jvm
Shootout! template engines on the jvmShootout! template engines on the jvm
Shootout! template engines on the jvm
 
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
What's New in Laravel 5 (Laravel Meetup - 23th Apr 15, Yogyakarta, ID)
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Laravel Webcon 2015
Laravel Webcon 2015Laravel Webcon 2015
Laravel Webcon 2015
 
Thymeleaf, will it blend?
Thymeleaf, will it blend?Thymeleaf, will it blend?
Thymeleaf, will it blend?
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP framework
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Intro to Laravel
Intro to LaravelIntro to Laravel
Intro to Laravel
 
Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Introduction to Laravel
Introduction to LaravelIntroduction to Laravel
Introduction to Laravel
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
CPAN Dependency Heaven
CPAN Dependency HeavenCPAN Dependency Heaven
CPAN Dependency Heaven
 
Perl in the Real World
Perl in the Real WorldPerl in the Real World
Perl in the Real World
 
Speed geeking-lotusscript
Speed geeking-lotusscriptSpeed geeking-lotusscript
Speed geeking-lotusscript
 
Web Development with Laravel 5
Web Development with Laravel 5Web Development with Laravel 5
Web Development with Laravel 5
 

Viewers also liked

What's New In PHP7
What's New In PHP7What's New In PHP7
What's New In PHP7Petra Barus
 
Php 5.4 performance
Php 5.4 performancePhp 5.4 performance
Php 5.4 performanceXinchen Hui
 
China PHP Technology Summit 2011 ppt
China PHP Technology Summit 2011 pptChina PHP Technology Summit 2011 ppt
China PHP Technology Summit 2011 pptXinchen Hui
 
Weibo lamp improvements
Weibo lamp improvementsWeibo lamp improvements
Weibo lamp improvementsXinchen Hui
 
A History of PHP
A History of PHPA History of PHP
A History of PHPXinchen Hui
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best PerformanceXinchen Hui
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life CycleXinchen Hui
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?Nikita Popov
 

Viewers also liked (10)

What's New In PHP7
What's New In PHP7What's New In PHP7
What's New In PHP7
 
Php performance
Php performancePhp performance
Php performance
 
Php 5.4 performance
Php 5.4 performancePhp 5.4 performance
Php 5.4 performance
 
China PHP Technology Summit 2011 ppt
China PHP Technology Summit 2011 pptChina PHP Technology Summit 2011 ppt
China PHP Technology Summit 2011 ppt
 
Weibo lamp improvements
Weibo lamp improvementsWeibo lamp improvements
Weibo lamp improvements
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
PHP7 - For Its Best Performance
PHP7 - For Its Best PerformancePHP7 - For Its Best Performance
PHP7 - For Its Best Performance
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
Data Types In PHP
Data Types In PHPData Types In PHP
Data Types In PHP
 
PHP 7 – What changed internally?
PHP 7 – What changed internally?PHP 7 – What changed internally?
PHP 7 – What changed internally?
 

Similar to High Performance Solution for PHP7

CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011Graham Weldon
 
CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development LetsConnect
 
Zend Framework 2, What's new, Confoo 2011
Zend Framework 2, What's new, Confoo 2011Zend Framework 2, What's new, Confoo 2011
Zend Framework 2, What's new, Confoo 2011Bachkoutou Toutou
 
Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9PrinceGuru MS
 
Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UKRicard Clau
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoPaul Withers
 
Eugene PHP June 2015 - Let's Talk Laravel
Eugene PHP June 2015 - Let's Talk LaravelEugene PHP June 2015 - Let's Talk Laravel
Eugene PHP June 2015 - Let's Talk Laravelanaxamaxan
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architectureElizabeth Smith
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceJen Wei Lee
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standarddenis Udod
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Vincent Partington
 
Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterSteven Chau
 
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
O365Con18 - SharePoint Framework for Administrators - Waldek MastykarzO365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
O365Con18 - SharePoint Framework for Administrators - Waldek MastykarzNCCOMMS
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseOSSCube
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfileRudy De Busscher
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfilePayara
 

Similar to High Performance Solution for PHP7 (20)

CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011CakePHP 2.0 - PHP Matsuri 2011
CakePHP 2.0 - PHP Matsuri 2011
 
CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development CrossWorlds: Unleash the Power of Domino for Connections Development
CrossWorlds: Unleash the Power of Domino for Connections Development
 
Zend Framework 2, What's new, Confoo 2011
Zend Framework 2, What's new, Confoo 2011Zend Framework 2, What's new, Confoo 2011
Zend Framework 2, What's new, Confoo 2011
 
Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9Phpworks enterprise-php-1227605806710884-9
Phpworks enterprise-php-1227605806710884-9
 
Scaling with Symfony - PHP UK
Scaling with Symfony - PHP UKScaling with Symfony - PHP UK
Scaling with Symfony - PHP UK
 
Social Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and DominoSocial Connections 2015 CrossWorlds and Domino
Social Connections 2015 CrossWorlds and Domino
 
Eugene PHP June 2015 - Let's Talk Laravel
Eugene PHP June 2015 - Let's Talk LaravelEugene PHP June 2015 - Let's Talk Laravel
Eugene PHP June 2015 - Let's Talk Laravel
 
Php internal architecture
Php internal architecturePhp internal architecture
Php internal architecture
 
Introduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital WorkplaceIntroduction To Web Development & The New Digital Workplace
Introduction To Web Development & The New Digital Workplace
 
ReactPHP + Symfony
ReactPHP + SymfonyReactPHP + Symfony
ReactPHP + Symfony
 
LatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 StandardLatJUG. JSF2.0 - The JavaEE6 Standard
LatJUG. JSF2.0 - The JavaEE6 Standard
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
Heroku
HerokuHeroku
Heroku
 
Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011Presentation about Overthere for J-Fall 2011
Presentation about Overthere for J-Fall 2011
 
Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles Nutter
 
Php
PhpPhp
Php
 
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
O365Con18 - SharePoint Framework for Administrators - Waldek MastykarzO365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
O365Con18 - SharePoint Framework for Administrators - Waldek Mastykarz
 
Debugging with Zend Studio for Eclipse
Debugging with Zend Studio for EclipseDebugging with Zend Studio for Eclipse
Debugging with Zend Studio for Eclipse
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfile
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfile
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

High Performance Solution for PHP7

  • 1. High Performance Solution for PHP An introduction to the PHP extensions of mine @laruence
  • 2. About Me • Author of Yaf, Yar, Yac, Yaconf, Taint • Maintainer of Opcache, Msgpack, PHP-Lua • PHP core developer since 2011 • Consultant at Zend since 2013 • Core developer of PHP7(NG branch) • Chief architect at Lianjia.com • Terrible english speaker
  • 3. Overview • Weibo V5 (2012 ~ 2015) • Billions PV per day(PHPend) • 300% Performance improvement • 60% Response time reduced • More than 1000 servers saved • Nginx , PHP-5.4
  • 5. Yaf • Use or Not Use Framework was a problem
  • 6. Yaf • What should a PHP framework do • Routing • Dispatching • Autoloading • View? • ORM?
  • 7. Yaf - Yet Another Framework • The first PHP framework in extension
  • 8. Yaf • Wildly used at Weibo, Baidu, Sina etc • https://github.com/laruence/yaf • Alternative: Phalcon
  • 9. SOA
  • 10. Yar • Why SOA • Decoupling • Cooperation • High Available • Scale out • ?
  • 11. Yar • Performance matters (latency or throughput) • Latency is not always 1/throughput • Trade Throughput for latency • Concurrent
  • 12. Yar - Yet Another RPC framework • Concurrent, Light RPC framework in extension • Multiply packagers supported(json, php, msgpack) • Multiply types of backend supported(C, PHP, Java)
  • 13. Yar • Yar for C framework • Multiply processes • Async • Event Driven
  • 14. Yar • Wildly used at Weibo • https://github.com/laruence/yar • https://github.com/laruence/yar-c • Alternative: json-rpc, thrift
  • 15. Cache
  • 16. Yac • Cache ~ Panacea for performance • Memcached • Redis
  • 17. Yac • Why not memcached • Network • Single point problem • Complexity of operation and maintenance
  • 18. Yac • Lockless user data cache in shared memory
  • 19. Yac - Yet Another Cache • Yac is not safe • less than 1/10000000 chance it will get a wrong result • Where is can be used
  • 20. Yac • Not wildly used :) • https://github.com/laruence/yac • Alternative: APC, Memcached
  • 22. Yaconf • Configurations is always not really configurations • Envs, Dicts, Caches • PHP, Json, Yaml
  • 23. Yaconf • What is wrong with it • Parsing every time • Release with codes • Opaque for developer • …
  • 24. Yaconf - Yet Another Config Container • Persistent configurations container in extension • INI file • Supports multiply files, sections • Supports constants, environ variables in PHP • Loading once serve multiply requests
  • 25. Yaconf • Wildly used at Weibo • https://www.github.com/laruence/yaconf • Alternative: Hidef
  • 27. Taint • What is the top security issues in PHP • XSS, SQL Injection, RCE
  • 28. Taint • How taint works • echo, print, file_put_contents, die, exit, header etc • require, include, eval, fopen etc • mysql_query, mysqli_query, PDO::query, PDO::prepare etc • system, exec, shell_exec, proc_open etc • call_user_func, preg_replace_callback, unserialize etc
  • 29. Taint • It is not a cure • Don’t use it in product env since it will slow down the performance • https://wiki.php.net/rfc/taint • https://github.com/laruence/taint • Alternative: RIPS etc
  • 31. Opcache • It is not only a opcodes cache • It also is a opcodes optimizer • Contant propagation • Dead codes removal • Literations compact • NOPS removal • …
  • 32. Opcache • Wildly used everywhere • Actually, it is shipped with PHP since PHP-5.5 • Always remember to enable it
  • 33. PHP7 • Yaf 17% • Yar 10% • Yac 20% • Yaconf (only for PHP7) • Opcache • file-based opcodes cache • hugepagefy text segment
  • 34. Q&A