SlideShare a Scribd company logo
5
Most read
8
Most read
9
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

PDF
REST API Development with Spring
PDF
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
PPTX
Best practices for ansible
PDF
Php and threads ZTS
PDF
AstriCon 2017 - Docker Swarm & Asterisk
PPTX
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
PDF
PPTX
Terraform day1
REST API Development with Spring
[OpenInfra Days Korea 2018] Day 1 - T4-7: "Ceph 스토리지, PaaS로 서비스 운영하기"
Best practices for ansible
Php and threads ZTS
AstriCon 2017 - Docker Swarm & Asterisk
Apache Ignite vs Alluxio: Memory Speed Big Data Analytics
Terraform day1

What's hot (20)

PDF
Introduction of Docker and Docker Compose
PPTX
Wso2 api manager 특징 slide share
PPTX
Docker基礎
PDF
왕초보를 위한 도커 사용법
PPTX
Unix shell scripting basics
PDF
Go swagger tutorial how to create golang api documentation using go swagger (1)
PDF
Performance Wins with BPF: Getting Started
ODP
Developing Microservices with Apache Camel
PPTX
REST API 설계
PPTX
Jenkins as a Service - Code all the way down
PDF
Ansible Tutorial.pdf
PPTX
Kubernetes
PDF
Kubernetes Problem-Solving
PDF
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
PDF
Ansible, best practices
PDF
Dive into Fluentd plugin v0.12
PDF
Jenkins-CI
PDF
A Hands-On Introduction To Docker Containers.pdf
PPTX
Kubernetes Introduction
PDF
Op Liichtmëssdag gi mir liichten!
Introduction of Docker and Docker Compose
Wso2 api manager 특징 slide share
Docker基礎
왕초보를 위한 도커 사용법
Unix shell scripting basics
Go swagger tutorial how to create golang api documentation using go swagger (1)
Performance Wins with BPF: Getting Started
Developing Microservices with Apache Camel
REST API 설계
Jenkins as a Service - Code all the way down
Ansible Tutorial.pdf
Kubernetes
Kubernetes Problem-Solving
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
Ansible, best practices
Dive into Fluentd plugin v0.12
Jenkins-CI
A Hands-On Introduction To Docker Containers.pdf
Kubernetes Introduction
Op Liichtmëssdag gi mir liichten!
Ad

Similar to ReactPHP + Symfony (20)

PPTX
Top 10 php frameworks in 2021
PPTX
Web programming using PHP and Introduction with sample codes
PPTX
Introduction To Web Development & The New Digital Workplace
PPT
My cool new Slideshow!
PPTX
How to Supercharge your PHP Web API
PPTX
They why behind php frameworks
PDF
Top 7 php frameworks for startups 2019
PPTX
Introduction to PHP.pptx
PPTX
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
PDF
DrupalCampLA 2014 - Drupal backend performance and scalability
PDF
Scaling with Symfony - PHP UK
PPTX
What's the "right" PHP Framework?
PPT
PDF
2013 - Dustin whittle - Escalando PHP en la vida real
PDF
Php training in bhubaneswar
PDF
Php training in bhubaneswar
PPTX
Midwest PHP - Scaling Magento
PDF
A look at FastCgi & Mod_PHP architecture
PPTX
Caching strategies with lucee
PDF
PHP Web Development Frameworks & Advantages
Top 10 php frameworks in 2021
Web programming using PHP and Introduction with sample codes
Introduction To Web Development & The New Digital Workplace
My cool new Slideshow!
How to Supercharge your PHP Web API
They why behind php frameworks
Top 7 php frameworks for startups 2019
Introduction to PHP.pptx
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
DrupalCampLA 2014 - Drupal backend performance and scalability
Scaling with Symfony - PHP UK
What's the "right" PHP Framework?
2013 - Dustin whittle - Escalando PHP en la vida real
Php training in bhubaneswar
Php training in bhubaneswar
Midwest PHP - Scaling Magento
A look at FastCgi & Mod_PHP architecture
Caching strategies with lucee
PHP Web Development Frameworks & Advantages
Ad

Recently uploaded (20)

PDF
A REACT POMODORO TIMER WEB APPLICATION.pdf
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
PPTX
AIRLINE PRICE API | FLIGHT API COST |
PPTX
Presentation of Computer CLASS 2 .pptx
PDF
Exploring AI Agents in Process Industries
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
PDF
Convert Thunderbird to Outlook into bulk
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
PDF
Become an Agentblazer Champion Challenge Kickoff
PDF
A Practical Breakdown of Automation in Project Management
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
PDF
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
PDF
Build Multi-agent using Agent Development Kit
PDF
Best Mobile App Development Company in Lucknow - Code Crafter Web Solutions
PDF
The Future of Smart Factories Why Embedded Analytics Leads the Way
PPTX
Computer Hardware tool: hand tools, diagnostics, ESD and cleaning tools
PPTX
Benefits of DCCM for Genesys Contact Center
PDF
Sensix-Tech-Pvt-Ltd-Company-Profile (1).pdf
A REACT POMODORO TIMER WEB APPLICATION.pdf
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
AIRLINE PRICE API | FLIGHT API COST |
Presentation of Computer CLASS 2 .pptx
Exploring AI Agents in Process Industries
PTS Company Brochure 2025 (1).pdf.......
ShowUs: Pharo Stream Deck (ESUG 2025, Gdansk)
Convert Thunderbird to Outlook into bulk
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Become an Agentblazer Champion Challenge Kickoff
A Practical Breakdown of Automation in Project Management
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
How to Seamlessly Integrate Salesforce Data Cloud with Marketing Cloud.pdf
Build Multi-agent using Agent Development Kit
Best Mobile App Development Company in Lucknow - Code Crafter Web Solutions
The Future of Smart Factories Why Embedded Analytics Leads the Way
Computer Hardware tool: hand tools, diagnostics, ESD and cleaning tools
Benefits of DCCM for Genesys Contact Center
Sensix-Tech-Pvt-Ltd-Company-Profile (1).pdf

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