Home / Jetendo Lucee Extensions /

Jetendo Web Server Lucee Extension (Not Released Yet)

Creating a single Java thread often measures around 0.3ms seconds in my benchmarks.  If every request requires a new thread, the maximum performance possible is around 3000 threads per second per CPU before your code even runs.   However, a simple Java server based on Java 7's AIO can finish entire requests in less time then then it takes to create a single thread, so in these situations, it makes more sense to serve the request in the same thread, and not spin up a thread, just like Nginx and other servers that are more event driven instead of the thread per connection model.   

3000 threads per second is pretty good performance, but it actually degrades substantially by the time you reach the first line of CFML code.  Lucee and Tomcat are about 5 times slower then Java's asynchronous socket (AIO) technology with a lightweight custom web server before you write any code.  I ran the benchmarks myself with both of them being tuned the best I could get out of them, and warming up the cpu plenty.  Once you start writing CFML and database queries, it just gets worse from there to the point that you can only handle a few dozen requests per second on a high end cpu in many real world cases.   We need to do more I/O in parallel and asynchronously to improve overall performance.  At the same time, we also have to make sure we don't waste any time running slower CFML code on abusive traffic and make sure real users don't have to wait for bulk/slow operations. 

A lot of web requests, even dynamic ones, can be answered faster without threads, but Lucee and other servlet technology doesn't let us do that today.

My goal is to allow executing CFML with Lucee PageContext objects without creating a separate thread by creating a backdoor entrypoint into the CFML engine that is able to create objects that bypass thread creation and servlet features.   In Lucee a PageContext is an object that tracks the local functions and active CFML source code in use, but it doesn't require its own thread to function.  You can copy the PageContext and run other CFML code with that copy and they can both coexist safely.  

Intelligent Agent

To further modernize, protect and accelerate Lucee and Jetendo, I'm going to build an intelligent agent in Java that monitors the abuse and runtime behavior of the application very close to the socket connection so that our URL routing and threading can be deterministic based on the current system activity at that moment.  It will open and close fast lanes to service more work to guarantee the best user experience possible for each request.  It will give a request all of the cpus it wants there is not much going on, but then throttle back to single threaded performance when busy.    

Jetendo Java Framework

In addition to the Jetendo Web Server Lucee Extension running Lucee faster, I have also developed a new Java web site framework for Jetendo that will let us build pure Java responses and create a bridge between Lucee and Java.  We want to do more new work in Java, while still leveraging our existing CFML codebase and application scope-based caches.    If all we need is a few CFML objects in application scope, we can grab that directly and bypass the overhead of Lucee/Tomcat request flow and respond more directly at Java speed.

This is a complex project that is a work in progress, it will be released here after we start using it in Jetendo applications.


Top of Page