Well, I finally got something like a 0.3 release for Ruby/Event with an included SCGI server that can run Rails applications. The release is real quick so people can play with it and give me feedback: You can read the announcement at http://www.zedshaw.com/ This release includes the following stuff that Rails users will find interesting: 1. An SCGI protocol for clients and servers. 2. An SCGI server that can run Rails applications directly, and even supports pre-forked child listeners. The forking probably only really works on POSIX systems. 3. It only depends on libevent. Everything else is written in Ruby. 4. It''s as fast as the current FCGI based on my tests, but I''m not sure if that''s the libfcgi C binding or the Ruby one. Hell, who even knows which one is really working these days right? Now would be a really good time for people to talk about how they would want to configure this thing. Enjoy the mayhem, Zed A. Shaw http://www.zedshaw.com/
Hi Zed, Just wondering what kind of memory usage each forked listener attracts with this? We''ve noticed that each FastCGI listener consumes quite a lot of memory - something a bit more efficient would be great. I''ll have a play around with it tonight and get back to you. Ben Myles RailsAppHosting (www.railsapphosting.com) On 7/26/05, Zed A. Shaw <zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org> wrote:> Well, I finally got something like a 0.3 release for Ruby/Event with an > included SCGI server that can run Rails applications. The release is > real quick so people can play with it and give me feedback: > > You can read the announcement at http://www.zedshaw.com/ > > This release includes the following stuff that Rails users will find > interesting: > > 1. An SCGI protocol for clients and servers. > 2. An SCGI server that can run Rails applications directly, and even > supports pre-forked child listeners. The forking probably only really > works on POSIX systems. > 3. It only depends on libevent. Everything else is written in Ruby. > 4. It''s as fast as the current FCGI based on my tests, but I''m not sure > if that''s the libfcgi C binding or the Ruby one. Hell, who even knows > which one is really working these days right? > > Now would be a really good time for people to talk about how they would > want to configure this thing. > > Enjoy the mayhem, > > Zed A. Shaw > http://www.zedshaw.com/
Great work! I just configured the RaH typo blog for scgi (very straightforward!) and it''s now running at http://63.247.78.123:9000/ with 3 listeners. Looking good! Ben On 7/26/05, Zed A. Shaw <zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org> wrote:> Well, I finally got something like a 0.3 release for Ruby/Event with an > included SCGI server that can run Rails applications. The release is > real quick so people can play with it and give me feedback: > > You can read the announcement at http://www.zedshaw.com/ > > This release includes the following stuff that Rails users will find > interesting: > > 1. An SCGI protocol for clients and servers. > 2. An SCGI server that can run Rails applications directly, and even > supports pre-forked child listeners. The forking probably only really > works on POSIX systems. > 3. It only depends on libevent. Everything else is written in Ruby. > 4. It''s as fast as the current FCGI based on my tests, but I''m not sure > if that''s the libfcgi C binding or the Ruby one. Hell, who even knows > which one is really working these days right? > > Now would be a really good time for people to talk about how they would > want to configure this thing. > > Enjoy the mayhem, > > Zed A. Shaw > http://www.zedshaw.com/ > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Ben Myles RailsAppHosting (www.railsapphosting.com)
On Jul 26, 2005, at 12:24 AM, Zed A. Shaw wrote:> Well, I finally got something like a 0.3 release for Ruby/Event > with an > included SCGI server that can run Rails applications. The release is > real quick so people can play with it and give me feedback: > > You can read the announcement at http://www.zedshaw.com/ > > This release includes the following stuff that Rails users will find > interesting: > > 1. An SCGI protocol for clients and servers. > 2. An SCGI server that can run Rails applications directly, and even > supports pre-forked child listeners. The forking probably only really > works on POSIX systems. > 3. It only depends on libevent. Everything else is written in Ruby. > 4. It''s as fast as the current FCGI based on my tests, but I''m not > sure > if that''s the libfcgi C binding or the Ruby one. Hell, who even knows > which one is really working these days right? > > Now would be a really good time for people to talk about how they > would > want to configure this thing. > > Enjoy the mayhem, > > Zed A. Shaw > http://www.zedshaw.com/ > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >Hey Zed- I''m trying to play with your scgi with lighttpd and rails. I keep getting errors like the following: 2005-07-26 09:29:04: (log.c.67) server started 2005-07-26 09:29:27: (mod_scgi.c.2656) 2005-07-26 09:29:27: (mod_scgi.c.2668) 2005-07-26 09:29:27: (mod_scgi.c.2700) 2005-07-26 09:29:27: (mod_scgi.c.2656) 2005-07-26 09:29:27: (mod_scgi.c.2668) 2005-07-26 09:29:27: (mod_scgi.c.2700) 2005-07-26 09:29:27: (mod_scgi.c.2721) 2005-07-26 09:29:27: (connections.c.1254) error-handler not found: / dispatch.scgi And all I get in the browser is 404 errors or it tries to download page.rb(which is the controller in the url I tried). Do I need a dispatch.scgi? I don''t see one in the download. Help? Oh and than you for your hard work. I think this will be a great way to run rails! -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
Hi, You need to just create an empty dispatch.scgi file: touch public/dispatch.scgi and set it executable: chmod +x public/dispatch.scgi Cheers, Ben
Hey Zed- I''m loving this scgi setup. I have it working with lighttpd and it definitely holds its own with fcgi. Only much simpler to set up and manage it seems. I have a question though. Now I want to set this up to work with apache1.3. I already have mod_scgi installed and working, but I am wondering how to configure a vhost to use the scgi stuff. Any ideas? This is what I have tried so far: <VirtualHost vintnerssecret.com> ServerName vintnerssecret.com DocumentRoot /home/users/vintner/cart/public <Location "/"> SCGIServer 127.0.0.1 9999 SCGIHandler On </Location> </VirtualHost> I also tried this: <LocationMatch "^/(page|store)($|/)"> SCGIServer 127.0.0.1 9999 SCGIHandler On </LocationMatch> But no luck. Any ideas on how to config this to work? Thanks again for your work on this project. -Ezra On Jul 26, 2005, at 12:24 AM, Zed A. Shaw wrote:> Well, I finally got something like a 0.3 release for Ruby/Event > with an > included SCGI server that can run Rails applications. The release is > real quick so people can play with it and give me feedback: > > You can read the announcement at http://www.zedshaw.com/ > > This release includes the following stuff that Rails users will find > interesting: > > 1. An SCGI protocol for clients and servers. > 2. An SCGI server that can run Rails applications directly, and even > supports pre-forked child listeners. The forking probably only really > works on POSIX systems. > 3. It only depends on libevent. Everything else is written in Ruby. > 4. It''s as fast as the current FCGI based on my tests, but I''m not > sure > if that''s the libfcgi C binding or the Ruby one. Hell, who even knows > which one is really working these days right? > > Now would be a really good time for people to talk about how they > would > want to configure this thing. > > Enjoy the mayhem, > > Zed A. Shaw > http://www.zedshaw.com/ > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
So I am still working on getting this going with apache 1.3. So the vhost now looks like this: <VirtualHost vintnerssecret.com> ServerName vintnerssecret.com DocumentRoot /home/users/vintner/cart/public <Location /> SCGIServer 127.0.0.1 9999 SCGIHandler On </Location> </VirtualHost> With this setup I can request url in my browser and the request runs fine and shows up in my development log with no problems. But the browser just displays an Internal Server Error. So mod_scgi is forwarding the requests to my scgi_server.rb but the content is now making it back to the browser. When I look in my apache error.log These are what I get thats relevant: [Tue Jul 26 15:33:24 2005] [error] [client 66.224.1.206] malformed header from script. Bad header=HTTP/1.1 200 OK: /store [Tue Jul 26 15:33:24 2005] [error] [client 66.224.1.206] scgi: error reading response headers [Tue Jul 26 15:33:29 2005] [error] [client 66.224.1.206] malformed header from script. Bad header=HTTP/1.1 200 OK: /page [Tue Jul 26 15:33:29 2005] [error] [client 66.224.1.206] scgi: error reading response headers Any Ideas? Thanks- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
On Tue, 2005-07-26 at 03:24 -0400, Zed A. Shaw wrote:> 3. It only depends on libevent. Everything else is written in Ruby.I was able to get this working in Linux just fine. Woohoo! But, I don''t see a version of libevent for Win32. Will it compile? Is there a port?
On Jul 26, 2005, at 10:09 PM, Kevin Williams wrote:> On Tue, 2005-07-26 at 03:24 -0400, Zed A. Shaw wrote: > >> 3. It only depends on libevent. Everything else is written in Ruby. >> > > I was able to get this working in Linux just fine. Woohoo! But, I > don''t > see a version of libevent for Win32. Will it compile? Is there a port? > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Yeah it works great on linux and OSX, I don''t have windows to try it on. There is one problem though.. caches_page doesn''t work. As soon as I flip to production, I get errors in my production logs and application error in the browser. It seems like it''s having problems writing the cached files. But my public folder is wide open and it still doesn''t cache. With lighttpd/fcgi and with webrick cahing works fine. But when I switch to scgi/lighttpd it doesn''t cache. But its very young still. I''m sure with a bit more development it will be a great alternative to fcgi and all the hassles that brings. Plus I love being able to restart my rails app without having top restart the webserver. Cheers -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster 509-577-7732 ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org
zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org
2005-Jul-28 16:33 UTC
Re: [ANN] SCGI Server for Rails using Ruby/Event
Thanks for the bug report. I''ll look into this. It might be some of IO magic I have to do in order for the CGI class to work. Zed> > On Jul 26, 2005, at 10:09 PM, Kevin Williams wrote: > >> On Tue, 2005-07-26 at 03:24 -0400, Zed A. Shaw wrote: >> >>> 3. It only depends on libevent. Everything else is written in Ruby. >>> >> >> I was able to get this working in Linux just fine. Woohoo! But, I >> don''t >> see a version of libevent for Win32. Will it compile? Is there a port? >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > Yeah it works great on linux and OSX, I don''t have windows to > try it on. There is one problem though.. caches_page doesn''t work. As > soon as I flip to production, I get errors in my production logs and > application error in the browser. It seems like it''s having problems > writing the cached files. But my public folder is wide open and it > still doesn''t cache. With lighttpd/fcgi and with webrick cahing works > fine. But when I switch to scgi/lighttpd it doesn''t cache. But its > very young still. I''m sure with a bit more development it will be a > great alternative to fcgi and all the hassles that brings. Plus I > love being able to restart my rails app without having top restart > the webserver. > > Cheers > > -Ezra Zygmuntowicz > Yakima Herald-Republic > WebMaster > 509-577-7732 > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hi, I have successfully deployed SCGI adapter to Rails, although with some complications. I think you have probably developer and tested it on some linux distribution. On FreeBSD 5.3 I had to symlink event.h from /usr/local/include/ to /usr/local/lib/ruby/1.8/i386-freebsd5/ as the Makefile was generated without inclusion of /usr/local/include/ directory. I have no idea how to patch it in that ruby scripts and configuration files, so I can only help with this bug report. BTW, configure successfully detected functional libevent. PS> Libevent is installed in version libevent-1.0b, so you can update info about minimal version on your page. On 7/28/05, zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org <zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org> wrote:> Thanks for the bug report. I''ll look into this. It might be some of IO > magic I have to do in order for the CGI class to work. > > Zed > > > > > On Jul 26, 2005, at 10:09 PM, Kevin Williams wrote: > > > >> On Tue, 2005-07-26 at 03:24 -0400, Zed A. Shaw wrote: > >> > >>> 3. It only depends on libevent. Everything else is written in Ruby. > >>> > >> > >> I was able to get this working in Linux just fine. Woohoo! But, I > >> don''t > >> see a version of libevent for Win32. Will it compile? Is there a port? > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > Yeah it works great on linux and OSX, I don''t have windows to > > try it on. There is one problem though.. caches_page doesn''t work. As > > soon as I flip to production, I get errors in my production logs and > > application error in the browser. It seems like it''s having problems > > writing the cached files. But my public folder is wide open and it > > still doesn''t cache. With lighttpd/fcgi and with webrick cahing works > > fine. But when I switch to scgi/lighttpd it doesn''t cache. But its > > very young still. I''m sure with a bit more development it will be a > > great alternative to fcgi and all the hassles that brings. Plus I > > love being able to restart my rails app without having top restart > > the webserver. > > > > Cheers > > > > -Ezra Zygmuntowicz > > Yakima Herald-Republic > > WebMaster > > 509-577-7732 > > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > > > > _______________________________________________ > > 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 >
Thanks, that''s great news. The event.h error you mention is probably because the version of ruby_event you have doesn''t regenerate the Makefile properly. Try deleting the ext/event/Makefile file and then re-run:> sudo ruby setup.rb clean > sudo ruby setup.rb(I use sudo, do what you need to become root.) That should clean you out, then regenerate the Makefile properly. Zed On Wed, 10 Aug 2005 16:21:46 +0200 Rastislav Kassak <kasou.sk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I have successfully deployed SCGI adapter to Rails, although with some > complications. > I think you have probably developer and tested it on some linux > distribution. On FreeBSD 5.3 I had to symlink event.h from > /usr/local/include/ to /usr/local/lib/ruby/1.8/i386-freebsd5/ as the > Makefile was generated without inclusion of /usr/local/include/ > directory. > > I have no idea how to patch it in that ruby scripts and configuration > files, so I can only help with this bug report. BTW, configure > successfully detected functional libevent. > > PS> Libevent is installed in version libevent-1.0b, so you can update > info about minimal version on your page. > > On 7/28/05, zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org <zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org> wrote: > > Thanks for the bug report. I''ll look into this. It might be some of IO > > magic I have to do in order for the CGI class to work. > > > > Zed > > > > > > > > On Jul 26, 2005, at 10:09 PM, Kevin Williams wrote: > > > > > >> On Tue, 2005-07-26 at 03:24 -0400, Zed A. Shaw wrote: > > >> > > >>> 3. It only depends on libevent. Everything else is written in Ruby. > > >>> > > >> > > >> I was able to get this working in Linux just fine. Woohoo! But, I > > >> don''t > > >> see a version of libevent for Win32. Will it compile? Is there a port? > > >> > > >> _______________________________________________ > > >> Rails mailing list > > >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > >> http://lists.rubyonrails.org/mailman/listinfo/rails > > >> > > > Yeah it works great on linux and OSX, I don''t have windows to > > > try it on. There is one problem though.. caches_page doesn''t work. As > > > soon as I flip to production, I get errors in my production logs and > > > application error in the browser. It seems like it''s having problems > > > writing the cached files. But my public folder is wide open and it > > > still doesn''t cache. With lighttpd/fcgi and with webrick cahing works > > > fine. But when I switch to scgi/lighttpd it doesn''t cache. But its > > > very young still. I''m sure with a bit more development it will be a > > > great alternative to fcgi and all the hassles that brings. Plus I > > > love being able to restart my rails app without having top restart > > > the webserver. > > > > > > Cheers > > > > > > -Ezra Zygmuntowicz > > > Yakima Herald-Republic > > > WebMaster > > > 509-577-7732 > > > ezra-gdxLOakOTQ9oetBuM9ipNAC/G2K4zDHf@public.gmane.org > > > > > > _______________________________________________ > > > 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 > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails