We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

CLI Application


Just a little story:

I've had to deal with a Java application for over three years now. It sends messages to users at a high volume (50 msgs/sec with possible peaks of 100 msgs/sec) and It's had problems with stability, cpu and memory utilization from the start. It's built on top of a JBoss Application Server

So, about a year and a half ago I discovered phalcon. I began using it for all my web related projects, and when I found the CLI functionality began working on a prototype of the Java app but in phalcon.

Yesterday, with phalcon 3 and php 7, I put the new app in production. It consumes 10% of the cpu and memory the Java app did, It's way more stable and in the same machine the Java app was running It sends 200 msgs/sec without breaking a sweat.

So to the phalcon team, thank you, your framework is great and you just cured a very tired developer of a three year long headache.

;o Didn't expect this.

@Jurigag: Why not? Java "tools" in general are champions in bloatware. For certain (many) use cases out there that's overkill and I'm not surprised that Phalcon (PHP) won this one. Basically the app server itself is bloated to start with, then Java frameworks and dozen of tools on top of that. For a message broker service as I understand @darxed description.

On the other hand CLI mode does not even need web server. And PHP7 is 5 times faster than PHP5.x, it comes very close to native C programs!

The Holy grail of speed, stability and low resource consumption (remember, it was designed to work on low power hardware too) has been debunked, again. Java debunked. :/


Actually, the app is not that simple, it has to integrate with several services and make quite a few reads and writes to the BD per msg. It also receives callbacks via http, I use nginx and phalcon again for that

Also, I tried this before, phalcon 2 and php 5.4. Didn't work, the app leaked memory after a couple of hours and was way slower. PHP 7 really is a big improvement.

Now, I don't think the Java thing was a myth. Java was designed to handle heavy loads with limited hardware, thing is, hardware evolved faster than the language, probably because of the complexity of it, and the Java world chose to prioritize adding functionality over streamlining efficiency.

Anyways, after this, I don't think there's any app that can't be done on PHP, with phalcon of course :)