Discovered Quercus

Scalability, security, pooling, long lived connections , container services in general are all aspects where Java has a lot to offer. PHP on the other side is good for fast development cycles with a low maintenance infrastructure, request response orientend with not so much support for long lived connections, caching etc.

On one of my favorite sites on scaling you can find out all the tricks how popular SNS and web 2.0 sites overcame the drawbacks of using such a scripting language in the long term, which served them well at the start for a quick front-end result. Why drawbacks? I agree scripting languages are actually a trend, think of Groovy or RoR, however for a solid backend with good session data handling, distributed caching, management tools, security etc. I would still prefer a compiled language, statically typed, sandboxed with security features, with all the API’s and services like Java has to offer – or maybe C#.

So thinking of todays Social Networking Applications, most require a lot of session data a combined solution: scripting in the front-end and the JVM/JEE in the backend would maybe a good solution. The backend might be a messaging layer or business logic layer with domain oriented architecture or something else.

There it comes the guys from Caucho Resin, an appserver I have used actually once for a University project long long time ago, have implemented the complete PHP language in Java! They call it Quercus and as of the time of this post its version 3.1. Quercus is deployed as a standard webapp and can be run on any JEE container. A Drupal installation apparently benefited from a 4x improvements over standard mod_php. However for a fair performance comparison it has to be compared with op-code caches – i heard good things about XCache – (php code compiled and cached), which typically reduces server load and increases the speed of PHP code anywhere from 2-10 times. Also lighthttp maybe faster than apache.

Performance aside, more important to me is actually to test if I can integrate my php app with my JEE apps and share a Persistence layer /ORM cache as well as clustering aspects with e.g. Terracotta. I will defenetly follow up on this with some results of this technology “mash-up”.

This entry was posted in java, php, Scalability and tagged , , . Bookmark the permalink. Both comments and trackbacks are currently closed.


  1. Posted December 3, 2009 at 6:10 am | Permalink

    Just a short note: I tried Quercus with Glassfish v2.1 and the v3 prelude edition but didn’t succeed in deploying the quercus war. Here are the notes I took:

    Tried out Quercus: Effort: 3 hours
    - Simple quercus app was running.
    - 4.0.1 : Loop of nullpointer exceptions in
    at com.caucho.util.Alarm.extractAlarm(
    at com.caucho.util.Alarm$
    - 3.2.1: java.lang.NoClassDefFoundError: com/caucho/quercus/function/AbstractFunction
    - Impression from mailing list and bugreports that this product is not so ready.

    It might run ok if professional version is purchased & run on resin.

  2. Tjerk
    Posted December 16, 2009 at 6:43 pm | Permalink

    Yes is agree that the comparison of Quercus to PHP without opcode chaching is a lame one. Every major php site uses some kind of accalerator. So i would only recommend Quercus if you really need tight integration with Java.