FastCGI ?

Are you using LiveCode to create server scripts or CGIs?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

FastCGI ?

Post by bangkok » Wed Jul 28, 2010 12:00 pm

For RunRev CGI or RunServer, I'm wondering if FastCGI as a module for Apache is relevant, or interesting ?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9852
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: FastCGI ?

Post by FourthWorld » Wed Jul 28, 2010 2:36 pm

On the use-rev list Andre Garzia wrote:
The problem with FastCGI is that it uses a single engine for all connection,
so if for some weird reason your code blocks, all the requests block too and
your application is on Denial of Service till this is solved. In the end my
FastCGI implementation, although cool, was never released to public use due
to the pain it would be to support all the blocked services.
http://lists.runrev.com/pipermail/use-r ... 03489.html

In that post he also describes using multiple copies of the engine with Apache 2.0's mod_proxy_balancer to enhance performance, which may be worth reading if you're running into performance issues.

I experimented with FastCGI myself last year, and abandoned it for the reasons Andre described.

In fact, I currently have an ordinary Rev-based CGI using used by hundreds of emergency medical facilities throughout Australia (a seemingly reasonable test case), and we've had no performance issues yet which would merit changing the system. I should note that this is on a shared-hosting account; if performance were an issue I'd get more speed more easily by just migrating to a dedicated server, and could consider any further modification of the CGI mechanism only when that also ran into performance bottlenecks. But even as modest as it is, it's been serving those visitors well 24/7 for more than a year.

Remember that when running faceless as the CGI engine does, load time is pretty much limited to reading the engine file from disk, something most servers can do almost instantly since it's only 2.4 MBs. Even on the desktop the Rev engine boots pretty fast, but most of that time is spent initializing its GUI capabilities; without a GUI it's darned quick to load.

I see far more time spent in Apache's own overhead and of course in the time it takes to transfer data over the wire than I find in loading the CGI.

Of course if I were running Google I'd need something faster, but for sites where your CGI will get several thousand hits a day you may find that running in standard CGI mode will be sufficient.

That said, on hosts that support FastCGI I've seen nothing in the Rev engine which prevents it from being used there. If you decide to experiment with FastCGI please let us know how it goes.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “CGIs and the Server”