Forum

SCGI support with Loadbalancing

Peter
8 March 2010, 14:07
Hi Hugo,

How about adding SCGI support http://python.ca/scgi/protocol.txt with similar loadbalancing as for FastCGI. It's simple, efficient and nice way of getting benefits of FastCGI (without multiplexing) implemented. Also it would be nice to have hiawatha starting the SCGI application as needed.

Regards,
Peter

Hiawatha version: Latest
Operating System:
Hugo Leisink
8 March 2010, 14:17
I have no intention of implementing SCGI. All popular script languages (including Python) have support for FastCGI. So, I see no reason for implementing other protocols which do more or less the same as FastCGI.
Peter
8 March 2010, 15:08
Hello Hugo,

Except hiawatha does not support multiplexing - one of the key features of the protocol. Implementing FastCGI protocol with it's complexity without gaining the benefit does make much sense to me. All popular and unpopular scripting languages can support SCGI as well, so I do not see the scripting language as a reasoning for not implementing a newer, simpler and efficient protocol. Protocol and scripting language are two separate things, in my opinion.

But no worries, world is full of webservers.

Regards,
Peter
Hugo Leisink
8 March 2010, 15:20
Using PHP via FastCGI instead of normal CGI makes it 15 times faster. So, Hiawatha has a benefit of using FastCGI. Mutiplexing might make it a bit faster, but the con is much more complexer code. Complexer code increases the risk of introducing a bug, which might be a security bug. Since I don't want security bugs, I decided to keep things easy.

What benefit do I have by implementing SCGI while FastCGI already does the same thing?
Peter
8 March 2010, 15:36
Hi Hugo,

You just said it yourself. The more complex the implementation the more prone to bugs. FastCGI is a great protocol, do not get me wrong, but from developers point of view - developing "server" applications to talk with hiawatha - SCGI is much, much easier to implement, unless I gain something special with FastCGI. And if you took a closer look at the SCGI specification you might even agree with me.

It is not always your benefit, it might sometimes be a user, developer or customer benefit as well.

Regards,
Peter
Hugo Leisink
8 March 2010, 15:38
If chose FastCGI because PHP has FastCGI support and no SCGI support. At least, back then when I implemented it.
Peter
8 March 2010, 17:17
Hi Hugo,

I do understand your choice and FastCGI with Hiawatha is an excellent choice for PHP developers. They do not need to worry about the details of the protocol itself and they do get the benefit of the speed and scalability with it. You could not have gone wrong with that choice.

But what comes to SCGI, it is simple, fast and efficient protocol to implement for those developing and compiling their cgi applications themselves. It is maybe a bit different user group. Coding for features that do not exist on the webserver side; is such a waste of time and effort.

AND FOR ANYONE ELSE READING THIS THREAD; do not get me wrong: Hiawatha is one of the best, if not the best webserver out there. It is secure, well performing choice for anyone needing robust webserver solution. It only lacks SCGI support currently.. But unless you develop and compile your applications yourself, chances are that you won't ever be needing SCGI.

Regards,
Peter
Hugo Leisink
8 March 2010, 18:06
When you want to build your own application, it's very easy with FastCGI. A lot of libraries are available at www.fastcgi.com [www.fastcgi.com] which do all the technical FastCGI stuff for you.

To make it even more easier for developers, I've created sample programs for the major web languages. You can find them at the bottom of the CGI and FastCI HOWTO page. I advice you to read the entire FastCGI section on that page.

Hope this helps to get you going.
This topic has been closed.