On Wed, Jul 22, 2009 at 3:36 AM, robert hickman<[email protected]> wrote: > > ---- You could use FastCGI to accomplish this, though you would have to > ---- write the interface. > ---- http://www.fastcgi.com/ > ---- FastCGI would remove the long startup times for the JVM, etc. > > I will look into fast CGI.
Your pain is my pain. Writing your web app in PHP, Ruby, Python etc. means that you have your pick of a very large number of cheap hosting services. Depending on the service, you may be able to simply copy over your script source and have it run almost automatically, or you may need to create a CGI and/or ask that the interpreter for whatever language be installed, but still this is very commonly available. Especially for a low-volume, low-revenue sites these inexpensive options are very attractive. Java and therefore Clojure does not play nicely in this niche as far as I can tell. Even if a service allows ssh access such that you can install a JVM, Clojure, etc. it's almost certain you will not be allowed to keep a long-running process going (which rules out simple Jetty solutions). A simple CGI, while usually possible in such an environment, incurs such a heavy CPU and time cost on JVM startup that it's not a practical solution. FastCGI is indeed a theoretical option. While not as widely supported as plain CGI by cheap hosting services, you'd still have many providers to choose from. There is even a Java interface. I attempted to use this several months ago, but failed for reasons I don't remember -- I hope you have more success. The reason that FastCGI is works when other kinds of separate-server-processes don't is because the web server (Apache or lighttpd) can start up and shut down these processes on demand based on policies controlled by the server admin. I even got working a solution where a very small CGI (written in C) forwards requests to a separate server process (which could be running Jetty or whatever), but if no such server is available the little CGI would start it up. Unfortunately my hosting service still got sore about the long-running process -- perhaps if the server shut itself down after a few idle minutes that would keep the admins happy, but I didn't pursue it. So as far as I can tell, your best options for hosting a Clojure web app are still either to get FastCGI working or pay for a more expensive service: Java servlet container provider, private virtual machine, co-locate, or on up from there. --Chouser --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
