Hello happy Railers, I used to develop with a local out-of-the-box Apache and load times were pretty slow (like a few seconds each page). "Well, it''s the price to pay for no compile / cache / etc..." I thought. Nonsense. Yesterday I installed SCGI, and now I''ve got the best of both worlds: rails development env uses my very latest modifications, while SCGI ensures I don''t pay Rails start-up cost each time. As a bonus, it'' a breeze to setup. Bottom line :if you''re doing Rails development with Apache, you''re wasting BIG time if you''re not using SCGI (or fastCGi for that matter). Go get it now (http://www.zedshaw.com/). Xavier PS : I''m not affiliated with Zed in any way, SCGI just made my developer''s life a lot better, and I wanted to share the love :)
David Heinemeier Hansson
2005-Oct-19 09:24 UTC
Re: Why you MUST use SCGI for Rails development
> PS : I''m not affiliated with Zed in any way, SCGI just made my > developer''s life a lot better, and I wanted to share the love :)SCGI is indeed very promising and cool already. But you can already get pretty decent speed just using WEBrick (script/server). And of course there''s also FCGI, which is the recommended production mode, but can be a pain to install. But yes, use this as a reminder that Rails was not meant to be run as vanilla CGI. It''s unbearable slow. -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
Xavier Priour wrote:> Bottom line :if you''re doing Rails development with Apache, you''re > wasting BIG time if you''re not using SCGI (or fastCGi for that matter). > Go get it now (http://www.zedshaw.com/).Thans Xavier for pointing this out. My development machine''s not the fastest, and each page has been taking ten or more seconds to render. Note that the full instructions for installing SCGI Rails Runner are at http://www.zedshaw.com/projects/scgi_rails/index.html . The rdoc link on Zed''s homepage does not include instructions on web server configuration. Anyway, I think I''ve installed and configured everything, but can''t get SCGI Rails Runner 0.4.2 to work. I''m getting Apache "Premature end of script headers" errors with Rails 0.13.1. Anyone in the same boat? -- We develop, watch us RoR, in numbers too big to ignore.
Mark Reginald James wrote:> Anyway, I think I''ve installed and configured everything, > but can''t get SCGI Rails Runner 0.4.2 to work. I''m getting > Apache "Premature end of script headers" errors with Rails > 0.13.1. Anyone in the same boat?Working now. Had to delete the /tmp session data because it is now no longer owned by the web server user but by the user who starts the SCGI server. Didn''t catch the error because it was delayed. Four times faster than CGI! Do I have to restart the SCGI server whenever I edit the app code? -- We develop, watch us RoR, in numbers too big to ignore.
Installation instructions are more detailed in the README file included in the download, it is really easy to set it up. -- Aníbal Rojas anibalrojas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
On 10/19/05, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote:> Four times faster than CGI! Do I have to restart the SCGI server > whenever I edit the app code?Not if you run in development mode: scgi_ctrl config -e development Even in development mode it''s still very fast. Ben
Ben Myles wrote:> On 10/19/05, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote: > >>Four times faster than CGI! Do I have to restart the SCGI server >>whenever I edit the app code? > > Not if you run in development mode: scgi_ctrl config -e developmentExcellent.> Even in development mode it''s still very fast.I''m getting a 5x speed-up in development mode: 2secs vs. 10secs. -- We develop, watch us RoR, in numbers too big to ignore.
Why weren''t you guys using Webrick anyway for development? I don''t even see 2 second delays--it''s just really fast. (Granted, depends on your application, but still seems like CGI mode was never really intended to be used for rails devel. On 10/19/05, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote:> I''m getting a 5x speed-up in development mode: 2secs vs. 10secs. > > -- > We develop, watch us RoR, in numbers too big to ignore.
On Oct 19, 2005, at 10:30 AM, Carl Youngblood wrote:> Why weren''t you guys using Webrick anyway for development? I don''t > even see 2 second delays--it''s just really fast. (Granted, depends on > your application, but still seems like CGI mode was never really > intended to be used for rails devel.I wouldn''t describe webrick for development as "really fast" on my Powerbook 1.33GHz G4 with 1.25GB RAM. Page loads are almost always in the 3 - 8 second range tending towards the higher end. Only simple login pages load at or below 3 seconds. I have an integration site setup on my server running FCGI in development mode. It works pretty much as you''d want it to: reloads classes as they''re updated. I''m not sure; but I think the only reason to have to restart the FCGI processes is when you change config/environment.rb or maybe stuff in lib/. I''ve got another integration environment on the same server running straight CGI (it''s the first environment I setup on a server). I can definitely tell an improvement between FCGI and CGI even while in development mode. I''ll get around to setting up FCGI on my Powerbook and do some benchmarks between it and Webrick in development mode.
Nicholas Van Weerdenburg
2005-Oct-19 16:02 UTC
Re: Re: Why you MUST use SCGI for Rails development
On 10/19/05, Carl Youngblood <carl-MJzSGySFh6ZUfOvSQQQpYw@public.gmane.org> wrote:> Why weren''t you guys using Webrick anyway for development? I don''t > even see 2 second delays--it''s just really fast. (Granted, depends on > your application, but still seems like CGI mode was never really > intended to be used for rails devel. > > On 10/19/05, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote: > > I''m getting a 5x speed-up in development mode: 2secs vs. 10secs. > > > > -- > > We develop, watch us RoR, in numbers too big to ignore. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >I was wondering the same thing. Any noticable difference between scgi in development mode nd webrick in development mode? I have noticed some slowdowns in webrick after running for a while- maybe scgi alleviates some of that? Thanks, Nick -- Nicholas Van Weerdenburg
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I''ve been using lighttpd + fastcgi fine for development. There isn''t anything wrong with that, right? On Oct 19, 2005, at 8:30 AM, Carl Youngblood wrote:> Why weren''t you guys using Webrick anyway for development? I don''t > even see 2 second delays--it''s just really fast. (Granted, depends on > your application, but still seems like CGI mode was never really > intended to be used for rails devel. > > On 10/19/05, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote: > >> I''m getting a 5x speed-up in development mode: 2secs vs. 10secs. >Joe Van Dyk http://www.pinkpucker.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFDVm6isWh6/7z1gt4RAvrMAKCCjzxNlHvgRIwzYzN2StRJNOfAvwCfXXyh wfFRAs7D4YxLtv+4QkrGExA=wPhr -----END PGP SIGNATURE-----
> I''ve been using lighttpd + fastcgi fine for development. > > There isn''t anything wrong with that, right?OMG You''re out of the club... That''s probably just fine as long as you''re not spending lots of time fiddling with either. Webrick is fiddle-free. If you''re having fun writing rails, then you''re doing ok :) The only issue I have is it gets slow on apps with lots of external files. Static files still go through the relatively slow web server. I''m thinking of switching to Apache/SCGI on my Mac for this reason on the effected apps. -- rick http://techno-weenie.net
I couldn''t ignore this thread any longer, so I reconfigured my win2000 + apache + fcgi box to use scgi. WOW. What a difference. I don''t know if it was because I didn''t configure fcgi properly, but scgi runs much, much quicker. Requests that were taking up to 4 seconds were reduced to less than 1. The whole installation/setup took me a whopping 20 minutes. I only have one minor issue, and it may be a mistake on my end, but does anyone know how to run scgi_service as an actual service? I don''t have control of when these dev boxes get rebooted and it would be nice to start scgi_service on startup. Thanks to all involved in scgi - Jin On 10/19/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''ve been using lighttpd + fastcgi fine for development. > > > > There isn''t anything wrong with that, right? > > OMG You''re out of the club... > > That''s probably just fine as long as you''re not spending lots of time > fiddling with either. Webrick is fiddle-free. If you''re having fun > writing rails, then you''re doing ok :) The only issue I have is it > gets slow on apps with lots of external files. Static files still go > through the relatively slow web server. I''m thinking of switching to > Apache/SCGI on my Mac for this reason on the effected apps. > > -- > rick > http://techno-weenie.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org
2005-Oct-19 19:08 UTC
Re: Re: Why you MUST use SCGI for Rails development
Hi Carl, I personally use WEBrick for development, and only test development mode with SCGI. But, I can see the following advantages over WEBrick: 1) One configuration. This is especially important with Apache since the Apache config is kind of a PITA. The main advantage here is that you only have to know one configuration and a simple switch turns you into development or production mode. This lets you iron out potential deployment issues before they happen. 2) WEBrick serves the static content too. If you run it under lighttpd or Apache then SCGI only deals with the Rails stuff. With WEBrick and big static content you''re having WEBrick service all requests. I can see how some applications might have a problem with this. 3) It actually might be faster even in development mode simply because SRR does less than WEBrick. I don''t have any direct evidence of this though. 4) The clustering config and the development config are much closer. Since the scgi_cluster command and configuration are fairly similar, you have less to do before you have a clustered setup. The only difficult part on this is the webserver config is now more complicated (but I''ll be fixing that soon). That''s just off the top of my head though. Since I don''t actually do this yet, you''d probably want to ask people why. I''m betting it''s related to configuring Apache vs. running WEBrick. Zed A. Shaw http://www.zedshaw.com/> Why weren''t you guys using Webrick anyway for development? I don''t > even see 2 second delays--it''s just really fast. (Granted, depends on > your application, but still seems like CGI mode was never really > intended to be used for rails devel. > > On 10/19/05, Mark Reginald James <mrj-bzGI/hKkdgQnC9Muvcwxkw@public.gmane.org> wrote: >> I''m getting a 5x speed-up in development mode: 2secs vs. 10secs. >> >> -- >> We develop, watch us RoR, in numbers too big to ignore. > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 10/19/05, Jin Lee <jinslee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I couldn''t ignore this thread any longer, so I reconfigured my win2000 + > apache + fcgi box to use scgi. > > WOW. What a difference. I don''t know if it was because I didn''t configure > fcgi properly, but scgi runs much, much quicker. Requests that were taking > up to 4 seconds were reduced to less than 1. > > The whole installation/setup took me a whopping 20 minutes. > > I only have one minor issue, and it may be a mistake on my end, but does > anyone know how to run scgi_service as an actual service? I don''t have > control of when these dev boxes get rebooted and it would be nice to start > scgi_service on startup. > > Thanks to all involved in scgi - > > JinIt doesn''t yet run as a service on Windows. It will eventually, though... so hang in there. Curt _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org
2005-Oct-19 19:18 UTC
Re: Re: Why you MUST use SCGI for Rails development
Hi,> I couldn''t ignore this thread any longer, so I reconfigured my win2000 + > apache + fcgi box to use scgi. > > WOW. What a difference. I don''t know if it was because I didn''t configure > fcgi properly, but scgi runs much, much quicker. Requests that were taking > up to 4 seconds were reduced to less than 1. >Very cool. Not sure why your fcgi was so slow before, but good to hear.> I only have one minor issue, and it may be a mistake on my end, but does > anyone know how to run scgi_service as an actual service? I don''t have > control of when these dev boxes get rebooted and it would be nice to start > scgi_service on startup. >Ah yes, the achilles heal of win32 scgi support. I need a service starter for ruby bad. Right now I''m seriously considering just breaking down and coding an EXE to do this in FreePASCAL. Yeah, that''s right. And, before people point me at the win32 service stuff on rubyforge: I already tried this and none of the compiled modules load, there''s no instructions for building them myself, I don''t have the required tools to figure it out myself, and none of the samples even work. Any takers on this? I''m pretty much stumped at the moment.> Thanks to all involved in scgi - >Uh, that''d be me and lots of testers. You''re welcome. :-) Zed A. Shaw http://www.zedshaw.com/
> > Date: Wed, 19 Oct 2005 12:18:15 -0700 (PDT) > From: zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org > Subject: Re: [Rails] Re: Why you MUST use SCGI for Rails development > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > And, before people point me at the win32 service stuff on rubyforge: I > already tried this and none of the compiled modules load, there''s no > instructions for building them myself, I don''t have the required tools to > figure it out myself, and none of the samples even work. > > Any takers on this? I''m pretty much stumped at the moment.I might be able to whip something up using RealBasic, it can create standalone EXEs and has support for Win32 Services, could also do this in .NET but that requires the massive .NET runtime. What exactly does the service need to do, just fire up the SCGI Ruby script and keep it running? I''ll look at the RealBasic docs to confirm. Chad _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Joe Van Dyk wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I''ve been using lighttpd + fastcgi fine for development. > > There isn''t anything wrong with that, right? >Not in my book. =) Although I still want to check out SCGI... Zach
Jack Christensen
2005-Oct-19 22:37 UTC
Re: Re: Why you MUST use SCGI for Rails development
zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org wrote: Hi, I couldn''t ignore this thread any longer, so I reconfigured my win2000 + apache + fcgi box to use scgi. WOW. What a difference. I don''t know if it was because I didn''t configure fcgi properly, but scgi runs much, much quicker. Requests that were taking up to 4 seconds were reduced to less than 1. I only have one minor issue, and it may be a mistake on my end, but does anyone know how to run scgi_service as an actual service? I don''t have control of when these dev boxes get rebooted and it would be nice to start scgi_service on startup. for ruby bad. Right now I''m seriously considering just breaking down and coding an EXE to do this in FreePASCAL. Yeah, that''s right. And, before people point me at the win32 service stuff on rubyforge: I already tried this and none of the compiled modules load, there''s no instructions for building them myself, I don''t have the required tools to figure it out myself, and none of the samples even work. Any takers on this? I''m pretty much stumped at the moment. Thanks to all involved in scgi - Uh, that''d be me and lots of testers. You''re welcome. :-) Zed A. Shaw http://www.zedshaw.com/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails Have you considered the srvany and instsrv? They are part of the Windows Resource Kit. They allow you to run programs as services. It is pretty easy to set up scgi as a service. -- Jack Christensen jackc-/SOt/BrQZzOj3I+7jmQ39gC/G2K4zDHf@public.gmane.org _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 10/19/05, Jack Christensen <jackc-/SOt/BrQZzMOf2zXYvRtkodd74u8MsAO@public.gmane.org> wrote:> > Have you considered the srvany and instsrv? They are part of the Windows > Resource Kit. They allow you to run programs as services. It is pretty easy > to set up scgi as a service.I was thinking about trying srvany at some point but I won''t have time for at least a week or so. What is instsrv? I haven''t heard of that. Curt _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
instsrv sets up the registry entries needed for a service to show up in the Services list. It goes hand-in-hand with the srvany wrapper. be -- Brad Ediger 866-EDIGERS On Oct 19, 2005, at 5:45 PM, Curt Hibbs wrote:> On 10/19/05, Jack Christensen <jackc-/SOt/BrQZzMOf2zXYvRtkodd74u8MsAO@public.gmane.org> wrote: > Have you considered the srvany and instsrv? They are part of the > Windows Resource Kit. They allow you to run programs as services. > It is pretty easy to set up scgi as a service. > > I was thinking about trying srvany at some point but I won''t have > time for at least a week or so. What is instsrv? I haven''t heard of > that. > > Curt > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 10/19/05, CLung <chad.lung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Date: Wed, 19 Oct 2005 12:18:15 -0700 (PDT) > > From: zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org > > Subject: Re: [Rails] Re: Why you MUST use SCGI for Rails development > > To: rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > > And, before people point me at the win32 service stuff on rubyforge: I > > already tried this and none of the compiled modules load, there''s no > > instructions for building them myself, I don''t have the required tools > > to > > figure it out myself, and none of the samples even work. > > > > Any takers on this? I''m pretty much stumped at the moment. > > > I might be able to whip something up using RealBasic, it can create > standalone EXEs and has support for Win32 Services, could also do this in > .NET but that requires the massive .NET runtime. What exactly does the > service need to do, just fire up the SCGI Ruby script and keep it running? > I''ll look at the RealBasic docs to confirm.Ok, adding a bit more to this.... There are a few tools already with Windows that allow a person to quickly create Windows Services: http://support.microsoft.com/?kbid=251192 http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en Also, it looks like the Windows Task Scheduler will so this as well. You need to go into the Scheduled Task Wizard and pick the file you want to run, then make sure that the "When my computer starts" radio button is selected, then just finish the Wizard''s steps to complete it. Perhaps a note in the Win32 readme is all thats required to point people to this info? Chad _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Nicholas Van Weerdenburg
2005-Oct-20 01:18 UTC
Re: Re: Why you MUST use SCGI for Rails development
On 10/19/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I''ve been using lighttpd + fastcgi fine for development. > > > > There isn''t anything wrong with that, right? > > OMG You''re out of the club... > > That''s probably just fine as long as you''re not spending lots of time > fiddling with either. Webrick is fiddle-free. If you''re having fun > writing rails, then you''re doing ok :) The only issue I have is it > gets slow on apps with lots of external files. Static files still go > through the relatively slow web server. I''m thinking of switching to > Apache/SCGI on my Mac for this reason on the effected apps. > > -- > rick > http://techno-weenie.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >I''ve noticed that the static stuff is killing me on Webrick. I think I''ll try scgi for that reason. -- Nicholas Van Weerdenburg
Nicholas Van Weerdenburg
2005-Oct-20 03:08 UTC
Re: Re: Why you MUST use SCGI for Rails development
On 10/19/05, Nicholas Van Weerdenburg <vanweerd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/19/05, Rick Olson <technoweenie-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I''ve been using lighttpd + fastcgi fine for development. > > > > > > There isn''t anything wrong with that, right? > > > > OMG You''re out of the club... > > > > That''s probably just fine as long as you''re not spending lots of time > > fiddling with either. Webrick is fiddle-free. If you''re having fun > > writing rails, then you''re doing ok :) The only issue I have is it > > gets slow on apps with lots of external files. Static files still go > > through the relatively slow web server. I''m thinking of switching to > > Apache/SCGI on my Mac for this reason on the effected apps. > > > > -- > > rick > > http://techno-weenie.net > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > I''ve noticed that the static stuff is killing me on Webrick. I think > I''ll try scgi for that reason. > -- > Nicholas Van Weerdenburg >scgi in development mode seems 2 to 5 times faster then webrick in development mode. It is a great improvement, reducing page loads from 3 to 10 seconds to < 2 seconds. I have a lot of static content, so that may be part of it. When I have time, I''ll configure rails to pull static content via apache, and compare. Configuration of scgi was a bit confusing due to web site having old documentation. Docs included in download are up to date. Follow the readme that''s in the downloaded package, and it only takes 10-15 minutes to read and configure. The only things not explicitly clear in downloaded docs- set Apache document root to railsapp\public, and don''t forget rule to have web server handle static content: <LocationMatch \..+$> # don''t handle those with SCGI SCGIHandler Off </LocationMatch> Nick -- Nicholas Van Weerdenburg
Carl Youngblood wrote:> Why weren''t you guys using Webrick anyway for development? I don''t > even see 2 second delays--it''s just really fast. (Granted, depends on > your application, but still seems like CGI mode was never really > intended to be used for rails devel.I didn''t realise that WEBrick was significantly faster than Apache-CGI. Page 441 of the Agile book rates it a bit faster, and I don''t understand from the description on page 445 what sort of state WEBrick hold the Rails environment in between requests. Does Rails stay loaded like in (F|S)CGI? I used Apache because I was already running it, and thought there was no advantage learning to deal with WEBrick as well. -- We develop, watch us RoR, in numbers too big to ignore.
It sounds like SCGI is more promising than FCGI for production though is it not? What benefits do you get running FCGI as opposed to SCGI for production mode? - Jim On Oct 19, 2005, at 2:24 AM, David Heinemeier Hansson wrote:>> PS : I''m not affiliated with Zed in any way, SCGI just made my >> developer''s life a lot better, and I wanted to share the love :) >> > > SCGI is indeed very promising and cool already. But you can already > get pretty decent speed just using WEBrick (script/server). And of > course there''s also FCGI, which is the recommended production mode, > but can be a pain to install. > > But yes, use this as a reminder that Rails was not meant to be run as > vanilla CGI. It''s unbearable slow. > -- > David Heinemeier Hansson > http://www.loudthinking.com -- Broadcasting Brain > http://www.basecamphq.com -- Online project management > http://www.backpackit.com -- Personal information manager > http://www.rubyonrails.com -- Web-application framework > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 19, 2005, at 9:21 AM, Rick Olson wrote:>> I''ve been using lighttpd + fastcgi fine for development. >> >> There isn''t anything wrong with that, right? >> > > OMG You''re out of the club... > > That''s probably just fine as long as you''re not spending lots of time > fiddling with either. Webrick is fiddle-free. If you''re having fun > writing rails, then you''re doing ok :) The only issue I have is it > gets slow on apps with lots of external files. Static files still go > through the relatively slow web server. I''m thinking of switching to > Apache/SCGI on my Mac for this reason on the effected apps. > >There''s no fiddling. All I need to do to start up lighty in development mode is script/lighty -p <port>. Joe Van Dyk http://www.pinkpucker.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFDVy+rsWh6/7z1gt4RAgWHAKCwB9kH4+rb/kd+jiH8kh8JfzjhGgCff+gz HLaKH3C/DTYOu9GBv8ZvYH8=jVa+ -----END PGP SIGNATURE-----
On Oct 19, 2005, at 10:45 PM, Mark Reginald James wrote:> Carl Youngblood wrote: > >> Why weren''t you guys using Webrick anyway for development? I don''t >> even see 2 second delays--it''s just really fast. (Granted, >> depends on >> your application, but still seems like CGI mode was never really >> intended to be used for rails devel. >> > > I didn''t realise that WEBrick was significantly faster than Apache- > CGI. > Page 441 of the Agile book rates it a bit faster, and I don''t > understand > from the description on page 445 what sort of state WEBrick hold > the Rails > environment in between requests. Does Rails stay loaded like in (F| > S)CGI?Webrick is a standalone server. It is basically just Rails and enough code to service HTTP requests. So, yes, you leave it running and it keeps things loaded and ready to go. Frankly, I''m surprised it''s not faster. From what I''ve heard Webrick isn''t intended for production use and doesn''t see a lot of optimization work. That''s just hearsay though and could be completely wrong.> I used Apache because I was already running it, and thought there > was no > advantage learning to deal with WEBrick as well.There is no "dealing with webrick". From your Rails project dir just run ''./script/server'' and then point your browser to http://localhost: 3000/. That''s all there is to it. In fact, that''s it''s main attraction. There''s literally zero setup. ----- Doug Alcorn - http://lathi.net/RubyOnRailsDeveloper doug-jGAhs73c5XxeoWH0uzbU5w@public.gmane.org
> Webrick is a standalone server. It is basically just Rails and > enough code to service HTTP requests. So, yes, you leave it running > and it keeps things loaded and ready to go. Frankly, I''m surprised > it''s not faster. From what I''ve heard Webrick isn''t intended for > production use and doesn''t see a lot of optimization work. That''s > just hearsay though and could be completely wrong.The Rails Wiki ran on Webrick for a long time. And, the limiting factor wasn''t even Webrick, but madeleine. It seems to process requests one at a time however. This is a limiting factor if your app has a lot of resources per page (images, stylesheets, javascript, etc). -- rick http://techno-weenie.net
Doug Alcorn wrote:> Webrick is a standalone server. It is basically just Rails and enough > code to service HTTP requests. So, yes, you leave it running and it > keeps things loaded and ready to go. Frankly, I''m surprised it''s not > faster. From what I''ve heard Webrick isn''t intended for production use > and doesn''t see a lot of optimization work. That''s just hearsay though > and could be completely wrong.Ah, so the Rails process itself effectively becomes the web server. Pity I didn''t understand this when I made my choice. At least there''s a fallback if SCGI has issues.>> I used Apache because I was already running it, and thought there was no >> advantage learning to deal with WEBrick as well. > > There is no "dealing with webrick". From your Rails project dir just > run ''./script/server'' and then point your browser to http://localhost: > 3000/. That''s all there is to it. In fact, that''s it''s main > attraction. There''s literally zero setup.Sounds simple, though I''d want to bind it to a 192.168 IP so I can do IE tests on a Windows box. Thanks Doug. -- We develop, watch us RoR, in numbers too big to ignore.
Rick Olson wrote:>>Webrick is a standalone server. It is basically just Rails and >>enough code to service HTTP requests. So, yes, you leave it running >>and it keeps things loaded and ready to go. Frankly, I''m surprised >>it''s not faster. From what I''ve heard Webrick isn''t intended for >>production use and doesn''t see a lot of optimization work. That''s >>just hearsay though and could be completely wrong. > > > The Rails Wiki ran on Webrick for a long time. And, the limiting > factor wasn''t even Webrick, but madeleine. It seems to process > requests one at a time however. This is a limiting factor if your app > has a lot of resources per page (images, stylesheets, javascript, > etc).I seem to recall that this was because there''s a global lock somewhere in ActionController, and the consensus at the time was that it wasn''t hard to remove, just no one had done it yet. That was a couple of months ago, I think. I presume that no one''s looked at it since... -- Alex
On Oct 20, 2005, at 10:44 AM, Rick Olson wrote:>> Webrick is a standalone server. It is basically just Rails and >> enough code to service HTTP requests. So, yes, you leave it running >> and it keeps things loaded and ready to go. Frankly, I''m surprised >> it''s not faster. From what I''ve heard Webrick isn''t intended for >> production use and doesn''t see a lot of optimization work. That''s >> just hearsay though and could be completely wrong. >> > > The Rails Wiki ran on Webrick for a long time. And, the limiting > factor wasn''t even Webrick, but madeleine. It seems to process > requests one at a time however. This is a limiting factor if your app > has a lot of resources per page (images, stylesheets, javascript, > etc).That''s a very interesting story. I didn''t know the wiki ran on Webrick. Thanks for sharing this significant production use of Webrick. From a simplicity point of view, I don''t think there could be a web server any simpler. ----- Doug Alcorn - http://lathi.net/RubyOnRailsDeveloper doug-jGAhs73c5XxeoWH0uzbU5w@public.gmane.org
What we really should be talking about is Rails in a production environment with SCGI. By far the biggest drag for me over the last 6 weeks or so of learning Rails was getting Red Hat/Fedora boxes to run my Rails app over FastCGI. And it seems like we''re all in the same boat. I like developing, I hate configuring. I''m watching very closely the progress of SCGI and really applaud Zed + co for all of their hard work, but is SCGI really ready for a primetime production environment? I started to go down that road and discovered some AJAX stuff broke, so I abandoned it. Maybe a new thread is warranted... For what it''s worth, I use webbrick for development - I end up switching between a desktop and powerbook quite a bit, and I don''t really want to bother setting up two machines with light or apache etc. On Oct 20, 2005, at 11:44 AM, Rick Olson wrote:>> Webrick is a standalone server. It is basically just Rails and >> enough code to service HTTP requests. So, yes, you leave it running >> and it keeps things loaded and ready to go. Frankly, I''m surprised >> it''s not faster. From what I''ve heard Webrick isn''t intended for >> production use and doesn''t see a lot of optimization work. That''s >> just hearsay though and could be completely wrong. >> > > The Rails Wiki ran on Webrick for a long time. And, the limiting > factor wasn''t even Webrick, but madeleine. It seems to process > requests one at a time however. This is a limiting factor if your app > has a lot of resources per page (images, stylesheets, javascript, > etc). > > -- > rick > http://techno-weenie.net > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Oct 20, 2005, at 12:12 PM, Mark Reginald James wrote:> > >>> I used Apache because I was already running it, and thought >>> there was no >>> advantage learning to deal with WEBrick as well. >>> >> There is no "dealing with webrick". From your Rails project dir >> just run ''./script/server'' and then point your browser to http:// >> localhost: 3000/. That''s all there is to it. In fact, that''s >> it''s main attraction. There''s literally zero setup. >> > > Sounds simple, though I''d want to bind it to a 192.168 IP so I can do > IE tests on a Windows box.Why not just point to dev IP from windows box? http://192.168.xxx.xxx: 3000 _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
cleaner416 wrote:> their hard work, but is SCGI really ready for a primetime production > environment? I started to go down that road and discovered some AJAX > stuff broke, so I abandoned it. Maybe a new thread is warranted...Zed has the following file in his downloads directory: http://zedshaw.com/downloads/scgi_rails/scgi-ajax_fix.tar.bz2 Don''t know if it''d solve your problem. -- We develop, watch us RoR, in numbers too big to ignore.
No, that works great. I run lighty as myself and mod_proxy to it, so it''s easy to change stuff in the server without needing root access. Always on the lookout for other stuff though, SCGI is looking better by the day. On 19/10/05, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I''ve been using lighttpd + fastcgi fine for development. > > There isn''t anything wrong with that, right?-- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/