The power of CFML,
now on a Raspberry Pi

Starting the CFML Server On Boot

CFML, ColdFusion, CommandBox, Raspberry Pi

Tonight, AJ Mercer asked me on Twitter if it was possible to start the CommandBox server on boot.  This is what I threw together to ensure this blog will come back online in the event of my Raspberry Pi losing power or just being rebooted for maintenance.

I followed these instructions on how to make a script that runs on startup


Neo, the (LED) Matrix Has You

ColdFusion, CommandBox, GPIO, Raspberry Pi

In my last post, I completed the "hello world" of digital electronics-- making a single LED blink.  Today we'll be turning it up a notch and controlling 64 separate LEDs.  Ok, there ARE 64 LEDs, but the Pi's GPIO doesn't actually have enough output pins to control that many pins individually.  What's a hardware hacker to do??  


Programming the Raspberry Pi's GPIO With CFML

ColdFusion, CommandBox, GPIO, Raspberry Pi

I know I promised to blog some more about how I set this blog up, but I've been too excited to to get playing with the GPIO (General Purpose Output) pins on my Pi.  The input/output pins are what make the Pi really similar to my Arduino. They're the glue that allow hardware and software to really meet.  Except on my Arduino, I must use C that's compiled to machine code and loaded onto a basic microcontroller.  My Pi runs an actual operating system, so I can use whatever high-level language I fancy and bring whatever syntax and productivity I want along for the ride.


Performance Tests Show Over 1000 Requests Per Second

CFML, ColdFusion, CommandBox, ContentBox, Raspberry Pi

When I installed CFML on a Raspberry Pi, top performance was really the least of my worries.  I'm using ContentBox Modular CMS which allowed me to get this site up and running (via the CommandBox CLI) literally in about 30 minutes after booting a Raspberry Pi for the first time in my life.  

This was incredibly easy and the site performs great for a single page page load with its in-memory H2 database.  Hitting the home page locally loads in less than 200ms.  Of course, ContentBox is a full-fledged CMS running on Hibernate ORM with theming support, dynamic content rendering, and modular plugins.  It's not necessarily optimized for an embedded device.  However, I'm still able to get about 15 requests a second to a ContentBox page which is a decent amount of traffic.



Rate Limiting Against DOS

ColdFusion, CommandBox, ContentBox, Raspberry Pi

Since I was feeling adventurous, I posted this blog on Reddit. I used the word "ColdFusion' in the title knowing full well the knee-jerk reaction many people have with the hopes it would spark some good discussion. That's also why I added an "About CFML" page to the site.  I've been enjoying some good conversation, though I'm generally disappointed at the lopsided attention given to performance above all things.  

To "prove" to me how slow CFML is, several of the Reddit readers launched a DOS attack on my Pi with load testing tools.


Adding A Hit Counter Plus ContentBox Cache-Busting

ColdBox, ContentBox, Raspberry Pi

In my previous two posts, I showed how I added live CPU usage and Memory usage to my blog layout to let people see how my Raspberry Pi is holding up hosting a CFML site.  There's one more stat I wanted to add and that is a hit counter so you know how many requests have been served in the last hour.  Since there's no web server logs to parse, I added a simple counter in CFML.  



Adding Live Memory Load

Raspberry Pi

So I said I wanted to add the number of requests per hour next to the top of the site so people could see its load, but Gavin pinged me on Twitter and asked about showing memory usage.  I had thought about memory, so I decided to tackle it.  In addition to getting the amount of used system memory, I decided to also show heap allocation and usage as well.


Adding Live CPU Load

Raspberry Pi

I've been fairly pleased with the performance of my new Pi-based blog, even though the amount of traffic it's received has been fairly small.  I found myself with a PuTTY SSH window open most of the day running a "top" command to see what the CPU usage was.  I wanted to know how much those quad-core ARM cores were getting tickled.

I still don't know how long I'll leave my Pi set up with this blog, but all of a sudden it seemed like a real cool idea to add a live CPU load graph to the top of the site just so other people could see how well it was humming along and whether it was breaking a sweat or not.


Say Hello to CFML on a Pi

CFML, CommandBox, ContentBox, Raspberry Pi

Please welcome the newest CFML site on the Internet.  This one's a little different though because it's running on a $35 device called a Raspberry Pi 2.  These newer versions have 1GB of RAM and a 900MHz quad-core CPU.  The CMS in use is ContentBox Modular CMS and is running on the embedded server of CommandBox (Undertow and Railo Lucee).  

Comments are currently closed