Phalcon performance. Should I expect better?

So I installed Phalcon on a cPanel-managed server configured with FastCGI, suexec and Xcache. It runs one primary website built on raw PHP. The current site makes numerous database connections on each request, but has some custom caching of pages as html fragments. It performs really well because the server is a powerhouse of CPU and RAM.

We're planning a rebuild using Phalcon, so I created a staging site in order to evaluate compatibility. I installed Phalcon using the cPanel extension, then followed the basic tutorial in the Phalcon docs to create a Hello World page. It worked fine.

The problem is that the basic Hello World page is having some inconsistent performance, from 80ms to 600ms response times (no database connections). The current live site is consistently returning responses in 40-80ms (with database connections). There is little to no load showing on the server for either one.

Should I expect better from Phalcon? What could be causing the inconsistency?

Live site (Raw PHP): http://www.dirtondirt.com/weekly-tracks.php

Staging site (Phalcon): http://staging.dirtondirt.com/

Am I missing something? A configuration setting for Phalcon or some defaults that can be turned off?

Thanks for your help,

Corey

This type of comparison amaze me. Raw PHP will be always faster than using any framework, even Phalcon or any other. On the other hand, a framework provides a working structure, a philosophy, pre-made classes and interfaces ready for use, some minimum level of security, complementary tools and more.

Your results are the expected, see these benchmarks: http://www.techempower.com/benchmarks/#section=data-r9&hw=peak&test=json&l=sg

I'm totally okay with that level of performance. I just wanted to make sure that there wasn't more to be had. I also thought the inconsistency was strange considering there is virtually no load on the server. A variance of 80ms - 600ms seemed strange for a basic view so I thought maybe there was something I did incorrect.

Don't get me wrong, I think Phalcon is great. I just needed to ensure there was no server configuration that was holding back the response time.

Thanks for your response.



1.9k

Surely that depends completely on your environment. But "80ms - 600ms" on a "powerhouse of CPU and RAM" sounds strange to me, too.

I'm running a test-proejct on a tiny V-Server with 3G RAM, 4x1,6GHz CPU (imo the converse of a powerhouse), debian 7, php5-fpm 5.4, php-apc 3.1 and nginx 1.6. A simple page generation takes 30±5ms.

So Phalcon could be much faster. But the 'Problem' is your Server, i think.

That was my thinking as well. It's running cPanel, so who knows what odd configuration details could be holding it back. Not being a Linux admin I'm just not sure what utility I could run to find the culprit.



1.9k

Administrating a Linux-Server while not beeing a Linux-Admin is ... difficult ;-).

To speed up your PHP you should check out some cPanel Forums and/or try to find someone who is familiar with CPanel and your Linux-Distribution (and PHP and Apache).

good luck