After the release of the first part of our Appserver series, it was clear through the ensuing discussions on both SitePoint and Reddit that we had touched a nerve for a good number of PHP channel’s devoted readers. I also quickly realized this new (for PHP) technology had a good number of serious doubters. One of the most poignant responses in the discussions was something along the lines of,
“with the way pthreads works internally with PHP, appserver can never be as fast as a regular LEMP or even LAMP stack.”
Needless to say, those doubtful and critical comments sounded like a real challenge. I was also very interested in finding out where appserver would land, if it were to be benchmarked against another well known PHP framework.
I decided to use my favorite framework, Symfony, to make the comparison. This is because appserver, as a stock PHP application server, also offers a good bit of important application functionality similar to Symfony. These functions include a dependency injection container, a request and response object, a method for persistence, etc. In other words, appserver gives the developer the basics to build an MVC application, just like Symfony.
For those of you wondering what pthreads is, it is a PHP extension used in the core of appserver, which allows PHP, and thus appserver, to build a multi-threaded PHP server environment. If you aren’t sure what that means, or why it is at all relevant, please read the first part of the series on appserver.
LEMP or LAMP stacks are the usual way PHP applications are served with Linux.
Linux, Nginx (EngineX), MySql and PHP -> LEMP
Linux, Apache, MySQL and PHP -> LAMP
The basic idea of this post is to try to dispel the criticism about appserver performing poorly, or at least much worse than a framework like Symfony.
The tests were run with simple programs, so we can see the overhead we’d find with standard programs built on top of a larger framework. I consider the overhead typical for any enterprise-grade, professional PHP application.
We will be testing for 3 types of responses.
Continue reading %Benchmarking: Can AppServer Beat Symfony’s Performance?%