DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Languages
  4. New Dedicated Application Server Revs PHP to Peak Performance

New Dedicated Application Server Revs PHP to Peak Performance

Find the perfect platform for you!

John Griffin user avatar by
John Griffin
·
Sep. 20, 19 · Analysis
Like (2)
Save
Tweet
Share
8.88K Views

Join the DZone community and get the full member experience.

Join For Free

How does this Peak Perform?

How does this Peak Perform?


Running a PHP application offers a wholly unique experience compared to running applications in other programming languages like Java or Golang. In most languages, you have to start your application in order to respond to a client request; whereas, with PHP, you have a simple “.php” file that sits quietly until it is invoked by a top-level web server like Nginx+PHP-FPM or Apache mod_php.

You may also like: How to Improve the Performance of a Java Application

While this church mouse approach helps avoid some common application issues like memory leaks, it also, unfortunately, results in massive overhead associated with restarting your application for every single request. For a simple HTTP request, for example, a PHP application requires significant loading on behalf of the framework in use (i.e. Symfony, Laravel, etc.) in addition to the time and computational power used up establishing database connections and processing logic. The worse part? After one simple request, it all has to be destroyed to start again from scratch.

On top of all that, PHP does not provide an easy way for developers to integrate alternative methods for communicating and processing into their applications. Even consuming simple data from message broker software like RabbitMQ typically requires a sizeable library or extension. Plus you have to configure the supervisor to ensure that your PHP scripts don’t die or crontab at the top to restart scripts in case of an external error.

These common complaints are why many developers have called PHP a dying programming language (despite almost 80% of the world’s top 10M websites using PHP as their primary code). While many other languages have solved similar issues by dedicating part of their infrastructure logic to application servers (i.e. you’ll be hard-pressed to find a Java engineer who does not employ TomCat or its analog), when it comes to PHP, there has not been a similar solution...until now.

Meet Roadrunner, a High-Performance PHP Application Server, Load-Balancer and Process Manager Written in Golang

Imagine building your PHP application once and then reusing it for multiple requests without having to tear it down. RoadRunner makes this possible.

RoadRunner builds using Golang which creates massive room for simple extensions and project-specific customizations. It allows you to integrate any existing Golang library with PHP and communicates with your application over PSR-7 standard. Compatible with all major frameworks available today, RoadRunner is MIT-licensed and has already been downloaded from Github 12.000 times.

This powerful application server runs your application in a daemonized mode which significantly improves performance by offloading some of the burdens on the framework. Public benchmarks demonstrate 10-20 times higher performance with RoadRunner than with PHP-FPM.

RoadRunner also includes a lot of instruments to ensure that your application runs safely, such as memory leak controls and TTL controls. It can serve static files without the presence of Nginx, therefore, simplifying the creation of Docker containers.

On top of all of that, RoadRunner provides a number of extensions. For example, with RoadRunner you can serve the GRPC API for a PHP application to simplify integration with other technologies. The queue (https://github.com/spiral/jobs) extension handles all the logic of working with queue brokers, such as durable reconnects and prefetch control making it possible to perform a 20-line integration with brokers like RabbitMQ, Amazon SQS, Beanstalk or run async PHP in server memory.

With RoadRunner, Golang effectively does all the “heavy lifting” when it comes to starting, stopping, and managing your PHP application as well as controlling how many worker processes can run at a given time. Using another open-source solution, Goridge, you can bridge the Golang and PHP sides of your application and pass PSR7 Request and Responses faster and more efficiently than ever too.

RoadRunner accelerates development, improves application efficiency and performance, and has the power to overturn many of the assumptions people have of PHP. 


Further Reading

Steps Improve Your Google PageSpeed Insight Score

How to Improve the Performance of a Java Application

PHP application Application server

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Create a Failover Client Using the Hazelcast Viridian Serverless
  • Automated Testing With Jasmine Framework and Selenium
  • Low-Code Development: The Future of Software Development
  • A Deep Dive Into AIOps and MLOps

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: