Google Groups Home Help | Sign in
Recent pages and files
Frequently Asked Questions    

What is SwitchPipe?


SwitchPipe is a proof of concept "Web application server." More accurately, it's a Web application process manager and request dispatcher / proxy. Backend HTTP-speaking applications (Web applications) do not run directly within SwitchPipe, but are loaded into their own processes making SwitchPipe language and framework agnostic.

SwitchPipe takes control of, and manages, the backend application processes, including loading and proxying to multiple instances of each application in a round-robin style configuration. As an administrator, you can define the maximum number of backend processes to run for each app, along with other settings so that you do not exceeded preferred resource limits. SwitchPipe quickly removes processes that "break" or otherwise outlive their welcome. For example, you can let SwitchPipe kill any backend processes that have not been accessed for, say, 20 seconds. This makes hosting many multiple Rails applications, for example, a quick and non-memory demanding process, ideal for shared hosting environments.

SwitchPipe proxies incoming HTTP requests at the TCP level, using information extracted from the HTTP request and headers to work out which backend application is required to handle the request.

 

Is SwitchPipe really language / technology agnostic?

 

Other than only running on UNIX-style operating systems, yes. Anything that can be run as a process on these operating systems and which makes itself available via HTTP on a TCP socket can be controlled by SwitchPipe in one way or another. That includes Rails applications, simple WEBrick servers, Python apps, JRuby apps, whatever. If it talks TCP and it runs as a process and a port number can be given to that application for it to talk on, we're good to go!


Why not just use Mongrel, LiteSpeed, FastCGI, <some other technology>?


HTTP daemons do not typically do the same job that SwitchPipe can. If you set up a Rails application with a Mongrel cluster, you still have to make decisions on port numbers, and expect processes to be running all of the time. SwitchPipe is NOT an HTTP daemon and actually runs, stops, and manages the processes for backend applications. Some FastCGI arrangements sort of do this, but they demand that backend applications can deal with FastCGI, whereas SwitchPipe merely uses regular HTTP (or hopefully, in the future, UNIX sockets). FastCGI has also proven unstable in many environments. At the end of the day, however, if another technology does the job for you, please use it! SwitchPipe is just here to solve a problem in another way.

 

Is SwitchPipe reliable?

 

Remember that SwitchPipe is still VERY NEW software. That said, I have tested it one 3 live, in production, applications for several days now with only a couple of bugs cropping up, which have both since been fixed. Therefore, I think SwitchPipe is relatively reliable, but it has not been tested in the wild for weeks on end or had intensive stress testing (although it deals with ApacheBench throwing it tens of thousands of requests okay). This means that you might need to hold SwitchPipe's hand a little, depending on your platform and rollout strategy. This is par for the course with "first major version" software, however. Do post on the discussion board if you have any particular reliability issues as hopefully we can stamp them all out!

 

Does it support SSL?

 

No. The reason for this is that SwitchPipe just handles things cleanly through a regular connection, with no handler for setting up a secure connection / handshaking / etc. If you wanted to use SwitchPipe with SSL, the best method would probably to put "Pound" in front of it, as Pound can provide SSL services to regular HTTP daemons.

 

What are the security implications?

 

Security is, I feel, mostly a topic for each individual systems administrator. However, because it launches processes that could belong to multiple users, it is necessary to run SwitchPipe either as root or a user which can execute all of the relevant backend applications in one way or another. Currently SwitchPipe has no suEXEC type support for backend applications, but luckily many backend applications support passing in the user / group name to run as, and will therefore be as secure as if you launched them from the command line. For scripts without this ability, they will run as the same user that SwitchPipe is running under (for now) which may or may not be suitable in your environment. Some form of suEXEC-esque support is planned for the near future.


As SwitchPipe merely proxies requests back to other daemons, there are no natural ways in to accessing data directly in SwitchPipe itself. If a request is malformed, SwitchPipe drops the connection. It is theoretically possible to overload SwitchPipe with significant numbers of requests, but this is true of most network facing services. Hopefully someone with a more formal understanding of network security will be able to audit SwitchPipe to some level and present more precise information, however.

 

What's SwitchPipe's history?

 

The inspiration for SwitchPipe followed on from a discussion in the Ruby community about deploying Ruby applications easily on the Web. The developer, Peter Cooper, decided to build a proof of concept "application server" (although that's not exactly what SwitchPipe really is) and produced a basic attempt within several hours and called it RBoss (in homage to JBoss). It was flawed in many ways, so over the course of a week or two, it was honed into what became SwitchPipe 1, and then 1.01, and so on. To the current date, Peter Cooper is the only developer involved with SwitchPipe although this is likely to change in the future.


Why does SwitchPipe start with version 1?


Simply because the author, while a programmer who respects the power of zero, is a regular human being and things in the real world start from the "first" and move on up. SwitchPipe is an extremely pragmatic piece of software, so it starts at 1.


Why is SwitchPipe written in a supposedly inefficient language like Ruby rather than C or C++?


The author knows Ruby well, and SwitchPipe was started as a mere proof of concept. There is definitely room to "port" SwitchPipe over to C / C++ / Python or some other faster language one day. However, the popular "Perlbal" software (which performs a similar task in a wholly different way) is written in Perl, so perhaps Ruby can deal with things for now. Performance is not the #1 focus for SwitchPipe at the moment, but ease of use and installation.

 

Why is SwitchPipe in the public domain?


I just want to make SwitchPipe available to help others solve their problems. I don't expect to make any money or achieve any fame from it, so why encumber users with any one of the many ridiculous licenses out there? If you're a company and you want to integrate this into some application stack you're building, go ahead! Life is too short to be territorial over a few bits and bytes.



Version: 
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google