Hi all ! I have SCGI setup and working correctly on a new host. I configured a cluster using: scgi_cluster config -e production -p 20000 -c 2 Now, I want to tell mod_scgi that I have two children. How do I do that ? I can't seem to find anything on the SRR site, nor on the mailing list. Thanks for any tips ! -- François Beausoleil http://blog.teksol.info/ _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org
2005-Dec-07 22:30 UTC
Re: SCGI cluster configuration example for Apache
You know, I could have swore I did this to test the cluster, but now that I look at my setup I think it actually wasn''t working with a cluster. I''m actually quite stumped how you''d do this. In lighttpd you just say there''s 3 servers and that''s it. It uses them. In Apache I''m thinking you''ll have to scgimount the three backends to different URLs, and then *somehow* use mod_rewrite to balance between them. That seriously can''t be right. There''s got to be a simpler way. Anyone have other thoughts? Zed> Hi all ! > > I have SCGI setup and working correctly on a new host. I configured a > cluster using: > scgi_cluster config -e production -p 20000 -c 2 > > Now, I want to tell mod_scgi that I have two children. How do I do > that ? I can''t seem to find anything on the SRR site, nor on the > mailing list. > > Thanks for any tips ! > -- > François Beausoleil > http://blog.teksol.info/ > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Dec 7, 2005, at 3:24 PM, rails-request-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org wrote:>> I have SCGI setup and working correctly on a new host. I >> configured a >> cluster using: >> scgi_cluster config -e production -p 20000 -c 2 >> >> Now, I want to tell mod_scgi that I have two children. How do I do >> that ? I can''t seem to find anything on the SRR site, nor on the >> mailing list. > > You know, I could have swore I did this to test the cluster, but > now that > I look at my setup I think it actually wasn''t working with a > cluster. I''m > actually quite stumped how you''d do this. In lighttpd you just say > there''s 3 servers and that''s it. It uses them. In Apache I''m > thinking > you''ll have to scgimount the three backends to different URLs, and > then > *somehow* use mod_rewrite to balance between them. > > That seriously can''t be right. There''s got to be a simpler way. > Anyone > have other thoughts?It appears that mod_scgi for Apache is too stupid to load balance. It seems to just use a ''first path wins'' so specifying the same path multiple times with a different host:port will not use the second server. -- Eric Hodel - drbrain-48TerJ1FxhPk1uMJSBkQmQ@public.gmane.org - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com
2005/12/8, zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org <zedshaw-dd7LMGGEL7NBDgjK7y7TUQ@public.gmane.org>:> You know, I could have swore I did this to test the cluster, but now that > I look at my setup I think it actually wasn''t working with a cluster. I''m > actually quite stumped how you''d do this. In lighttpd you just say > there''s 3 servers and that''s it. It uses them. In Apache I''m thinking > you''ll have to scgimount the three backends to different URLs, and then > *somehow* use mod_rewrite to balance between them. >One could use random RewriteMap for "balancing". :) In Apache config: SCGIMount /scgi0/ 127.0.0.1:9999 SCGIMount /scgi1/ 127.0.0.1:10000 SCGIMount /scgi2/ 127.0.0.1:10001 RewriteMap scginums rnd:/web/scgi-nums.txt File /web/scgi-nums.txt: num 0|1|2 And change rewrite rule to "balance" between them: RewriteRule ^(.*)$ /scgi${scginums:num}/$1 [QSA,L] Setup Rails routing: config/routes.rb: map.connect '':controller/:action/:id'' map.connect ''scgi0/:controller/:action/:id'' map.connect ''scgi1/:controller/:action/:id'' map.connect ''scgi2/:controller/:action/:id'' Now, it will work as a cluster, but it''s definitely *very poor* "solution". :)> That seriously can''t be right. There''s got to be a simpler way. Anyone > have other thoughts? > > Zed >