LiteSpeed Web Server 2.2 includes Rails Support 20

Posted by Bob Silva Mon, 04 Sep 2006 22:45:00 GMT

LiteSpeed Web Server is a commercial product being marketed as "the world's best performing Ruby SAPI and easiest Ruby on Rails application setup". Having used LiteSpeed for over 6 months now and after running my own tests, I agree with that statement whole-heartedly. Being a recent Apple convert, to me LiteSpeed is the OS X of the web server world. Not open source, but it looks and works great and the developers actually listen to what the users need.

LiteSpeed offers a Standard Edition which is free for private and commercial use, the only restriction being that your site can't serve content related to pornography, warez or illegal activities. This is an odd restriction, but I guess it's cool that they stand by their principles.

To keep things DRY, I won't repeat LiteSpeeds feature set here. Instead, I'll "show" you why I choose LiteSpeed and why I think you should give it a test drive as well. I've put together two screencasts for your viewing pleasure. The first will demonstrate just how easy it is to get up and running with LiteSpeed. From installing the server to a fully deployed Rails application in under 4 minutes. Live and uncut. It moves along pretty fast, but I felt it was a good demonstration of the effort the LiteSpeed developers have put into supporting Ruby on Rails. In the second screencast, we'll take a more in-depth look at some of the cool features of LiteSpeed Web Server. Hope you enjoy them, I had fun making them.



Up and Running with Rails in Under 4 Minutes - 3:25 runtime - Flash

LiteSpeed In-Depth - 21:35 runtime - Flash

UPDATE: The screencasts show that you have to copy dispatch.lsapi into your public directory, with the 2.2 release, this requirement is lifted. The ruby-lsapi gem still needs to be installed, but LiteSpeed will handle the dispatching to Rails through their LSAPI automatically.

UPDATE: When running the script to restart LiteSpeed, make sure you run it as a user with root priviledges. So for Mac users: sudo lswsctrl restart
Comments

Leave a response

  1. matt about 4 hours later:
    Very helpful, linked in our forums.
  2. Carlos Gabaldon about 4 hours later:
    Bob, LiteSpeed looks very cool, great screencasts. I am going to download it and play with it tonight.
  3. steve odom about 4 hours later:
    Bob, just what I needed. I just started taking a look at litespeed and this helps me tremendously. Keep up the good work. One note. The movies would not play in Firefox for me. Nothing would pull up. But if I used Safari, they worked fine. Steve
  4. Bob Silva about 5 hours later:
    Hi Steve, I just tested on my mbp and mp with Firefox and it worked ok, I am unable to test on a PPC powered mac though. Thanks for the heads up.
  5. moxie about 5 hours later:
    Great post. Performance and deployment are the concerns we have when develop large scale Rails based system. LightSpeed is very promising. Wish someone comes up with a benchmark comparing all the Rails enabled web server deployment.
  6. chris about 16 hours later:
    does anyone know how it compares in performance to Mongrel?
  7. Bob Silva about 17 hours later:
    Not to take anything away from Mongrel, Zed Shaw has done an excellent job programming it, but putting Ruby up against C++ is not a fair comparison. A Mongrel cluster behind a proxy will perform fine for most installations. With that said, I tested Apache 2.2 Load-Balancing to a Mongrel Cluster and LiteSpeed was twice as fast. To avoid contention, I will not post numbers or examples of my tests because I don't know crap about benchmarking. But I'm not blind either, my numbers were sufficient for me to make a decision.
  8. chris about 17 hours later:
    If LiteSpeed really is as easy to setup as they say, does it push Mongrel out of the equation?
  9. chris about 17 hours later:
    This AJAX posting mechanism is a typical example of when NOT to use ajax. After i'd clicked Submit it wasn't immideately odvious that it had worked. Its made even worse by the "Chris is about to say" box still appearing.
  10. Bob Silva about 19 hours later:
    Hi Chris, Yea, typos handling of it is crap, I need to modify the source to disable the submit button, just haven't gotten around to it yet. I'll delete the extra posts. The 4 minute screencast (I could've made it in 3 with a few more takes) was done from installation to deployed app, so yes it can be easy, but it's even easier when you have been using LiteSpeed for awhile and know how everything fits together. As for Mongrel, LiteSpeed also makes a great load balancing proxy server. Core team member Rick Olson, last I heard was using LiteSpeed to proxy to a mongrel cluster. I'm just saying the LiteSpeeds performance is good enough with Rails, that it isn't necessary to proxy to a mongrel cluster (it's actually reducing your performance).
  11. Amr about 19 hours later:

    Thanks so much for posting it. Have you had any luck running applications using frozen edge rails versions? I'm trying to get Beast to work with litespeed, and though I can serve beast from webrick or lighty, when I try to get the app served through litespeed it just sits there and times out.

    I have litespeed serving other rails apps from two separate document-roots on two different ip/port combos.

    so I'm guessing there may be a trick to run the frozen edge rails apps with litespeed? assumption being that running an app with rails frozen (edge in this case) in the vendor dir, throws litespeed a curveball or sumpin'

    any comments on that would be most welcome!

    Thanks, Amr

  12. Bob Silva about 20 hours later:
    I run most of my development on edge through LiteSpeed, I also freeze all my production apps to a TAG and haven't had any problems. LiteSpeed only interfaces with the Dispatcher, it has nothing to do with how the Rails framework gets loaded. I'd suspect a missing configuration option somewhere. Be sure to check LiteSpeeds logs (Toggle the Debug Logging) and tail your development.log in your Rails to see if the request even arrives.
  13. Amr about 22 hours later:

    Thanks Bob, good to know, one less wrong tree for me to bark up :) . I did do the DEBUG mode thing, but didn't seem to find anything different as compared to the other VHOST which is serving the other rails app fine. Can't thank you enough for this screencast! really, this is extremely helpful, many many thanks.

    BTW, I saw you are running quite a few virtual hosts on a single LSWS instance. Do you have a writeup on that by chance? I mean running multiple rails apps under the same litespeed server (kind of what you have already setup..) I think I'm going about it in a very convoluted way (different listener on each ip with different ports and then the different rails app on that doc-root.. its really weird.. I think you'r setup is simpler because I only saw one listener on port 80)

    sorry if this question is too n00bish, and thanks for the screencast again!

  14. Bob Silva about 22 hours later:
    Amr, You can run unlimited Virtual Hosts in LiteSpeed, the sample I showed was my legacy domains server (running PHP). On my Rails production server I run 6 apps, all on port 80 as well. LiteSpeed uses name based virtual hosts much like apache does. Just add virtual hosts to your port 80 listener and give each a unique domain name. When a request arrives, LiteSpeed will look at the Host: header and determine which Virtual Host to send the request to. If you aren't using version 2.2 yet, be sure to upgrade and move your Rails apps to the new Rails context style of implementation. Also, make sure you have ruby-lsapi installed.
  15. Amr about 23 hours later:

    Bob, thanks for the pointer, I will check that out. I did have the 2.2 and lsapi installed but I forgot one more thing, I had the rails app running under "development" while my virtual host was configured to look at "production" in the rails context tab. When I aligned those two by changing the value in database.yml to "production:" , it worked like a charm! Many Thanks!!! :))

    Re: the VHosts all assigned to 80, are you giving each an "A" record on the DNS side? What I mean is, lets say I have tingoo.com, but I want to run forum.tingoo.com on 80 but want it to point to a different doc-root (RAILS_HOME) as it is a separate app, so basically I do still have to create an A record for each of the subdomain like x.tingoo.com, y.tingoo.com etc. then have the VHOST point to x.tingoo.com and then have 80 listener bound to this newly added VHOST. do I have this understood correctly?

    Please forgive me for hijacking your comments thread like this.

  16. Amr about 23 hours later:
    Spoke too soon, I can get it with A records or aliases. Thanks much! -Amr
  17. Radixhound 9 days later:
    I've set up a server with litespeed to do some testing. I really like the web interface and the ease of setting up rails apps! One thing that I'm investigating though is the memory usage. It creates many ruby processes of about 85456kb each, so memory gets chewed up fast. Any idea how this compares to Apache + Mongrel?
  18. Amr 17 days later:
    Radixhound: upgrade to the latest LSWS (2.2.2) and ruby-lsapi version 1.8 . this seems to have solved the problem for me.
  19. Radixhound 23 days later:
    Hmm.. bummer. I finally tried updating to the latest LSWS and now I'm having a problem with setting up my rails app. When I set it up the simple way (ala 4 minute demo), the server crashes when I try to do a graceful restart. So far I'm totally stumped.
  20. bobby about 1 month later:
    Hi, Bob. I just got a VPS with Rimuhosting, and found out no one else was using LiteSpeed over there. I'm a newbie at administering my own VPS, but I really want to try out LiteSpeed. My intent is to host a few (3 or 4) Rails apps and sundry CMS sites using PHP/MySQL for clients. My question is, looking at your screencast, is this a good scenario to use Litespeed in? Will it work with Capsitrano and Subversion? I'm just following instructions by the book, so I am basically looking to be pointed in the right direction.
Comments