SlideShare a Scribd company logo
8
Most read
9
Most read
10
Most read
REACTPHP & SYMFONY
David Bergunder
Lead Web Developer
April, 2017
HTTP SERVER
ReactPHP as an Event-Driven, Non-Blocking I/O http
server.
ReactPHP
Your application runs inside ReactPHPs event loop.
Request -> Response pattern (Symfony!)
Acts as the http server.
• No more bootstrap and initialization of code on every
request.
• Dramatically increases performance of the application.
• Start multiple servers and balance with a proxy.
• Best used alongside nginx or properly configured apache
for static content.
Symfony
• Request -> Response Framework
• Symfony 4.x is extremely light weight (deprecated silex,
a popular lightweight PHP framework for APIs)
• Supports modern software development practices and
paradigms.
• Components can be found in most modern PHP
frameworks:
• Drupal
• Laravel
• Magento
• Wordpress haha just kidding
Caveats
• Memory Management (Symfony debug mode has a huge
memory leak due to the profiling features)
• Process manager could terminate and restart periodically
• Git gud (at memory management) scrub
• File Upload / Streaming of data can be challenging.
• Haven’t tested this myself.
• Managing Running Processes and Memory
• There are other feature rich frameworks using ReactPHP that can
manage this.
• Database Interaction
• Doctrine can be a real pain in long running processes if you aren’t
careful
Demo
• https://github.com/dbergunder/reactphp-symfony
• Symfony: v4.0.8
• ReactPHP
• event-loop: v0.5
• http: v0.8
• Symfony Bridge
• psr-http-message-bridge
• Convert React Request to Symfony Request
• zend-diactoros
• Convert Symfony Response to React Response
BENCHMARKS
73.6% of all statistics are made up.
Benchmarks – Default Symfony
Apache
PHP-FPM
No opcache
ab -c 1 -t 10 http://reactphp.icc:8080/public/
Benchmark – ReactPHP + Symfony
php bin/react
ab -c 1 -t 10 http://127.0.0.1:8081/
Disclaimers
• PHP 7.2
• No opcache – or any caching
• Local development environment
• ā€œHello Worldā€ is not data or operation intensive
• No database interaction
QUESTIONS?
You have to be odd to be number one.
-- Dr. Seuss

More Related Content

What's hot (20)

PDF
Introduction to HTML5
Gil Fink
Ā 
PPT
Introduction to Javascript
Amit Tyagi
Ā 
PPTX
Event In JavaScript
ShahDhruv21
Ā 
PPTX
Dom(document object model)
Partnered Health
Ā 
PPTX
Php
Shyam Khant
Ā 
PPT
JavaScript - An Introduction
Manvendra Singh
Ā 
PPTX
Javascript operators
Mohit Rana
Ā 
PPTX
Laravel Tutorial PPT
Piyush Aggarwal
Ā 
PPTX
.Net Core
Bertrand Le Roy
Ā 
PPTX
Add an interactive command line to your C++ application
Daniele Pallastrelli
Ā 
PDF
Rust system programming language
robin_sy
Ā 
PDF
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Matt Raible
Ā 
PPTX
JavaScript Event Loop
Designveloper
Ā 
PDF
JavaScript - Chapter 6 - Basic Functions
WebStackAcademy
Ā 
PPTX
Files in php
sana mateen
Ā 
PDF
[2018] MyBatisģ—ģ„œ JPA딜
NHN FORWARD
Ā 
PPTX
Javax.servlet,http packages
vamsi krishna
Ā 
PPT
PHP
sometech
Ā 
PPTX
Introduction to php
Taha Malampatti
Ā 
PPTX
All you need to know about the JavaScript event loop
SaŔa Tatar
Ā 
Introduction to HTML5
Gil Fink
Ā 
Introduction to Javascript
Amit Tyagi
Ā 
Event In JavaScript
ShahDhruv21
Ā 
Dom(document object model)
Partnered Health
Ā 
JavaScript - An Introduction
Manvendra Singh
Ā 
Javascript operators
Mohit Rana
Ā 
Laravel Tutorial PPT
Piyush Aggarwal
Ā 
.Net Core
Bertrand Le Roy
Ā 
Add an interactive command line to your C++ application
Daniele Pallastrelli
Ā 
Rust system programming language
robin_sy
Ā 
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Matt Raible
Ā 
JavaScript Event Loop
Designveloper
Ā 
JavaScript - Chapter 6 - Basic Functions
WebStackAcademy
Ā 
Files in php
sana mateen
Ā 
[2018] MyBatisģ—ģ„œ JPA딜
NHN FORWARD
Ā 
Javax.servlet,http packages
vamsi krishna
Ā 
PHP
sometech
Ā 
Introduction to php
Taha Malampatti
Ā 
All you need to know about the JavaScript event loop
SaŔa Tatar
Ā 

Similar to ReactPHP + Symfony (20)

PPTX
Top 10 php frameworks in 2021
MaryamAnwar10
Ā 
PPTX
Web programming using PHP and Introduction with sample codes
DivyaKS12
Ā 
PPTX
Introduction To Web Development & The New Digital Workplace
Jen Wei Lee
Ā 
PPT
My cool new Slideshow!
netzwelt12345
Ā 
PPTX
How to Supercharge your PHP Web API
Aurimas Niekis
Ā 
PPTX
They why behind php frameworks
Kirk Madera
Ā 
PDF
Top 7 php frameworks for startups 2019
ValueCoders
Ā 
PPTX
Introduction to PHP.pptx
MarianJRuben
Ā 
PPTX
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Jani Tarvainen
Ā 
PDF
DrupalCampLA 2014 - Drupal backend performance and scalability
cherryhillco
Ā 
PDF
Scaling with Symfony - PHP UK
Ricard Clau
Ā 
PPTX
What's the "right" PHP Framework?
Barry Jones
Ā 
PPT
Php
Ajay Kumar
Ā 
PDF
2013 - Dustin whittle - Escalando PHP en la vida real
PHP Conference Argentina
Ā 
PDF
Php training in bhubaneswar
litbbsr
Ā 
PDF
Php training in bhubaneswar
litbbsr
Ā 
PPTX
Midwest PHP - Scaling Magento
Mathew Beane
Ā 
PDF
A look at FastCgi & Mod_PHP architecture
Aimee Maree
Ā 
PPTX
Caching strategies with lucee
Gert Franz
Ā 
PDF
PHP Web Development Frameworks & Advantages
AditMicrosys Australia
Ā 
Top 10 php frameworks in 2021
MaryamAnwar10
Ā 
Web programming using PHP and Introduction with sample codes
DivyaKS12
Ā 
Introduction To Web Development & The New Digital Workplace
Jen Wei Lee
Ā 
My cool new Slideshow!
netzwelt12345
Ā 
How to Supercharge your PHP Web API
Aurimas Niekis
Ā 
They why behind php frameworks
Kirk Madera
Ā 
Top 7 php frameworks for startups 2019
ValueCoders
Ā 
Introduction to PHP.pptx
MarianJRuben
Ā 
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Jani Tarvainen
Ā 
DrupalCampLA 2014 - Drupal backend performance and scalability
cherryhillco
Ā 
Scaling with Symfony - PHP UK
Ricard Clau
Ā 
What's the "right" PHP Framework?
Barry Jones
Ā 
Php
Ajay Kumar
Ā 
2013 - Dustin whittle - Escalando PHP en la vida real
PHP Conference Argentina
Ā 
Php training in bhubaneswar
litbbsr
Ā 
Php training in bhubaneswar
litbbsr
Ā 
Midwest PHP - Scaling Magento
Mathew Beane
Ā 
A look at FastCgi & Mod_PHP architecture
Aimee Maree
Ā 
Caching strategies with lucee
Gert Franz
Ā 
PHP Web Development Frameworks & Advantages
AditMicrosys Australia
Ā 
Ad

Recently uploaded (20)

PPTX
Tally software_Introduction_Presentation
AditiBansal54083
Ā 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
Ā 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
Ā 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
Ā 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
Ā 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
Ā 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
Ā 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
Ā 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
Ā 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
Ā 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
Ā 
PDF
ģœ ė‹ˆķ‹°ģ—ģ„œ Burst Compiler+ThreadedJobs+SIMD ģ ģš©ģ‚¬ė”€
Seongdae Kim
Ā 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
Ā 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
Ā 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
Ā 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
Ā 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
Ā 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
Ā 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
Ā 
PDF
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
Ā 
Tally software_Introduction_Presentation
AditiBansal54083
Ā 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
Ā 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
Ā 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
Ā 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
Ā 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
Ā 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
Ā 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
Ā 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
Ā 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
Ā 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
Ā 
ģœ ė‹ˆķ‹°ģ—ģ„œ Burst Compiler+ThreadedJobs+SIMD ģ ģš©ģ‚¬ė”€
Seongdae Kim
Ā 
Human Resources Information System (HRIS)
Amity University, Patna
Ā 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
Ā 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
Ā 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
Ā 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
Ā 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
Ā 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
Ā 
Streamline Contractor Lifecycle- TECH EHS Solution
TECH EHS Solution
Ā 
Ad

ReactPHP + Symfony

  • 1. REACTPHP & SYMFONY David Bergunder Lead Web Developer April, 2017
  • 2. HTTP SERVER ReactPHP as an Event-Driven, Non-Blocking I/O http server.
  • 3. ReactPHP Your application runs inside ReactPHPs event loop. Request -> Response pattern (Symfony!) Acts as the http server. • No more bootstrap and initialization of code on every request. • Dramatically increases performance of the application. • Start multiple servers and balance with a proxy. • Best used alongside nginx or properly configured apache for static content.
  • 4. Symfony • Request -> Response Framework • Symfony 4.x is extremely light weight (deprecated silex, a popular lightweight PHP framework for APIs) • Supports modern software development practices and paradigms. • Components can be found in most modern PHP frameworks: • Drupal • Laravel • Magento • Wordpress haha just kidding
  • 5. Caveats • Memory Management (Symfony debug mode has a huge memory leak due to the profiling features) • Process manager could terminate and restart periodically • Git gud (at memory management) scrub • File Upload / Streaming of data can be challenging. • Haven’t tested this myself. • Managing Running Processes and Memory • There are other feature rich frameworks using ReactPHP that can manage this. • Database Interaction • Doctrine can be a real pain in long running processes if you aren’t careful
  • 6. Demo • https://github.com/dbergunder/reactphp-symfony • Symfony: v4.0.8 • ReactPHP • event-loop: v0.5 • http: v0.8 • Symfony Bridge • psr-http-message-bridge • Convert React Request to Symfony Request • zend-diactoros • Convert Symfony Response to React Response
  • 7. BENCHMARKS 73.6% of all statistics are made up.
  • 8. Benchmarks – Default Symfony Apache PHP-FPM No opcache ab -c 1 -t 10 http://reactphp.icc:8080/public/
  • 9. Benchmark – ReactPHP + Symfony php bin/react ab -c 1 -t 10 http://127.0.0.1:8081/
  • 10. Disclaimers • PHP 7.2 • No opcache – or any caching • Local development environment • ā€œHello Worldā€ is not data or operation intensive • No database interaction
  • 11. QUESTIONS? You have to be odd to be number one. -- Dr. Seuss