I''m having trouble uploading 2+ files simultaneously (from different client machines)... the upload page just hangs... I''m running... - ruby 1.8.4 (2005-12-24) [i686-linux] - rails 1.1.4 - red hat el 4 - apache - fcgi (0.8.7, 0.8.6.1) - firefox 1.5.0.5 - httpd.conf <IfModule mod_fastcgi.c> FastCgiIpcDir /tmp/fcgi_ipc/ AddHandler fastcgi-script .fcgi FastCGIConfig -minProcesses 2 </IfModule> thoughts/suggestions? -- Posted via http://www.ruby-forum.com/.
I am having the same type of problems. I am running apache with 2 fastcgi instances. What is happening is each fastcgi instance is blocking during a file upload, so if 2 people are uploading files then both fastcgis are being blocked and no other web requests are processed. What is a solution to this problem? On 7/28/06, Michael Barinek <barinek@gmail.com> wrote:> > I''m having trouble uploading 2+ files simultaneously (from different > client machines)... > > the upload page just hangs... > > I''m running... > > - ruby 1.8.4 (2005-12-24) [i686-linux] > - rails 1.1.4 > - red hat el 4 > - apache > - fcgi (0.8.7, 0.8.6.1) > - firefox 1.5.0.5 > - httpd.conf > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > FastCGIConfig -minProcesses 2 > </IfModule> > > thoughts/suggestions? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060816/92258c13/attachment.html
Run more FCGI instances? I believe there are also some (really excellent) solutions forming around Mongrel. On Aug 15, 2006, at 6:15 PM, Davy Campano wrote:> I am having the same type of problems. I am running apache with 2 > fastcgi instances. What is happening is each fastcgi instance is > blocking during a file upload, so if 2 people are uploading files > then both fastcgis are being blocked and no other web requests are > processed. What is a solution to this problem? > > On 7/28/06, Michael Barinek <barinek@gmail.com> wrote: I''m having > trouble uploading 2+ files simultaneously (from different > client machines)... > > the upload page just hangs... > > I''m running... > > - ruby 1.8.4 (2005-12-24) [i686-linux] > - rails 1.1.4 > - red hat el 4 > - apache > - fcgi (0.8.7, 0.8.6.1) > - firefox 1.5.0.5 > - httpd.conf > > <IfModule mod_fastcgi.c> > FastCgiIpcDir /tmp/fcgi_ipc/ > AddHandler fastcgi-script .fcgi > FastCGIConfig -minProcesses 2 > </IfModule> > > thoughts/suggestions? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I am running 2 FCGI instances and they use about 22MB a piece. I can''t add too many more without maxing out my 128MB VPS box. Anyone know how 37signals guys handle this with backpack, etc? I''ll keep an eye out on Mongrel. On 8/15/06, Tom Mornini <tmornini@infomania.com> wrote:> > Run more FCGI instances? > > I believe there are also some (really excellent) solutions forming > around Mongrel. > > On Aug 15, 2006, at 6:15 PM, Davy Campano wrote: > > > I am having the same type of problems. I am running apache with 2 > > fastcgi instances. What is happening is each fastcgi instance is > > blocking during a file upload, so if 2 people are uploading files > > then both fastcgis are being blocked and no other web requests are > > processed. What is a solution to this problem? > > > > On 7/28/06, Michael Barinek <barinek@gmail.com> wrote: I''m having > > trouble uploading 2+ files simultaneously (from different > > client machines)... > > > > the upload page just hangs... > > > > I''m running... > > > > - ruby 1.8.4 (2005-12-24) [i686-linux] > > - rails 1.1.4 > > - red hat el 4 > > - apache > > - fcgi (0.8.7, 0.8.6.1) > > - firefox 1.5.0.5 > > - httpd.conf > > > > <IfModule mod_fastcgi.c> > > FastCgiIpcDir /tmp/fcgi_ipc/ > > AddHandler fastcgi-script .fcgi > > FastCGIConfig -minProcesses 2 > > </IfModule> > > > > thoughts/suggestions? > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060816/5d8ea33f/attachment.html
Hi, I don''t know what the solution to this problem is, however I''m having the exact same issues. If anyone has suggestions regarding how to handle this with FCGI, I would also appreciate it! -Steven On Aug 16, 2006, at 3:38 AM, Davy Campano wrote:> I am running 2 FCGI instances and they use about 22MB a piece. I > can''t add too many more without maxing out my 128MB VPS box. > Anyone know how 37signals guys handle this with backpack, etc? > I''ll keep an eye out on Mongrel. > > On 8/15/06, Tom Mornini <tmornini@infomania.com> wrote: Run more > FCGI instances? > > I believe there are also some (really excellent) solutions forming > around Mongrel. > > On Aug 15, 2006, at 6:15 PM, Davy Campano wrote: > > > I am having the same type of problems. I am running apache with 2 > > fastcgi instances. What is happening is each fastcgi instance is > > blocking during a file upload, so if 2 people are uploading files > > then both fastcgis are being blocked and no other web requests are > > processed. What is a solution to this problem? > > > > On 7/28/06, Michael Barinek <barinek@gmail.com> wrote: I''m having > > trouble uploading 2+ files simultaneously (from different > > client machines)... > > > > the upload page just hangs... > > > > I''m running... > > > > - ruby 1.8.4 (2005-12-24) [i686-linux] > > - rails 1.1.4 > > - red hat el 4 > > - apache > > - fcgi (0.8.7, 0.8.6.1) > > - firefox 1.5.0.5 > > - httpd.conf > > > > <IfModule mod_fastcgi.c> > > FastCgiIpcDir /tmp/fcgi_ipc/ > > AddHandler fastcgi-script .fcgi > > FastCGIConfig -minProcesses 2 > > </IfModule> > > > > thoughts/suggestions? > > > > -- > > Posted via http://www.ruby-forum.com/. > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I''m starting to feel like this is an issue that does not have a resolution, which would mean that it would not possible to create a rails app with multiple people uploading at the same time on anything less than a dedicated box. Is this really true? On 8/16/06, Steven Hansen <runner@berkeley.edu> wrote:> > > Hi, > > I don''t know what the solution to this problem is, however I''m having > the exact same issues. If anyone has suggestions regarding how to > handle this with FCGI, I would also appreciate it! > > -Steven > > > On Aug 16, 2006, at 3:38 AM, Davy Campano wrote: > > > I am running 2 FCGI instances and they use about 22MB a piece. I > > can''t add too many more without maxing out my 128MB VPS box. > > Anyone know how 37signals guys handle this with backpack, etc? > > I''ll keep an eye out on Mongrel. > > > > On 8/15/06, Tom Mornini <tmornini@infomania.com> wrote: Run more > > FCGI instances? > > > > I believe there are also some (really excellent) solutions forming > > around Mongrel. > > > > On Aug 15, 2006, at 6:15 PM, Davy Campano wrote: > > > > > I am having the same type of problems. I am running apache with 2 > > > fastcgi instances. What is happening is each fastcgi instance is > > > blocking during a file upload, so if 2 people are uploading files > > > then both fastcgis are being blocked and no other web requests are > > > processed. What is a solution to this problem? > > > > > > On 7/28/06, Michael Barinek <barinek@gmail.com> wrote: I''m having > > > trouble uploading 2+ files simultaneously (from different > > > client machines)... > > > > > > the upload page just hangs... > > > > > > I''m running... > > > > > > - ruby 1.8.4 (2005-12-24) [i686-linux] > > > - rails 1.1.4 > > > - red hat el 4 > > > - apache > > > - fcgi (0.8.7, 0.8.6.1) > > > - firefox 1.5.0.5 > > > - httpd.conf > > > > > > <IfModule mod_fastcgi.c> > > > FastCgiIpcDir /tmp/fcgi_ipc/ > > > AddHandler fastcgi-script .fcgi > > > FastCGIConfig -minProcesses 2 > > > </IfModule> > > > > > > thoughts/suggestions? > > > > > > -- > > > Posted via http://www.ruby-forum.com/. > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060817/518e309a/attachment.html
You need to add more dispatchers. You also need to make sure you can get the file there in a reasonable amount of time.... some hosts have a timeout on fastcgi so if the upload takes too long, it will just disconnect the client. The solution is to scale up. Rails requests are single-threaded. The "big guys" are running lots of dispatchers on multiple machines. I think someone on here from Strongspace mentioned that they currently use 20 dispatchers, but don''t quote me on that. People are working on plugins for Mongrel that offload the file uploads to a different process and then pass the file to Rails when the upload is done. I don''t know how that''s coming but perhaps someone else can shed some light on this. Beware: this is not just a problem with file uploads... it''s a problem with requests and Rails in general. If your machine can only handle 5 requests per second, then your 6th person is going to wait until someone else is done. They requests will queue up and you will see terrible performance unless you load-balance with multiple dispatchers. On 8/16/06, Davy Campano <dcampano@gmail.com> wrote:> > I''m starting to feel like this is an issue that does not have a > resolution, which would mean that it would not possible to create a rails > app with multiple people uploading at the same time on anything less than a > dedicated box. Is this really true? > > > On 8/16/06, Steven Hansen <runner@berkeley.edu> wrote: > > > > > > Hi, > > > > I don''t know what the solution to this problem is, however I''m having > > the exact same issues. If anyone has suggestions regarding how to > > handle this with FCGI, I would also appreciate it! > > > > -Steven > > > > > > On Aug 16, 2006, at 3:38 AM, Davy Campano wrote: > > > > > I am running 2 FCGI instances and they use about 22MB a piece. I > > > can''t add too many more without maxing out my 128MB VPS box. > > > Anyone know how 37signals guys handle this with backpack, etc? > > > I''ll keep an eye out on Mongrel. > > > > > > On 8/15/06, Tom Mornini <tmornini@infomania.com> wrote: Run more > > > FCGI instances? > > > > > > I believe there are also some (really excellent) solutions forming > > > around Mongrel. > > > > > > On Aug 15, 2006, at 6:15 PM, Davy Campano wrote: > > > > > > > I am having the same type of problems. I am running apache with 2 > > > > fastcgi instances. What is happening is each fastcgi instance is > > > > blocking during a file upload, so if 2 people are uploading files > > > > then both fastcgis are being blocked and no other web requests are > > > > processed. What is a solution to this problem? > > > > > > > > On 7/28/06, Michael Barinek <barinek@gmail.com> wrote: I''m having > > > > trouble uploading 2+ files simultaneously (from different > > > > client machines)... > > > > > > > > the upload page just hangs... > > > > > > > > I''m running... > > > > > > > > - ruby 1.8.4 (2005-12-24) [i686-linux] > > > > - rails 1.1.4 > > > > - red hat el 4 > > > > - apache > > > > - fcgi (0.8.7, 0.8.6.1) > > > > - firefox 1.5.0.5 > > > > - httpd.conf > > > > > > > > <IfModule mod_fastcgi.c> > > > > FastCgiIpcDir /tmp/fcgi_ipc/ > > > > AddHandler fastcgi-script .fcgi > > > > FastCGIConfig -minProcesses 2 > > > > </IfModule> > > > > > > > > thoughts/suggestions? > > > > > > > > -- > > > > Posted via http://www.ruby-forum.com/. > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060817/281af7e1/attachment-0001.html
Brian, thanks a ton for your excellent response! On 8/16/06, Brian Hogan <bphogan@gmail.com> wrote:> > You need to add more dispatchers. You also need to make sure you can get > the file there in a reasonable amount of time.... some hosts have a timeout > on fastcgi so if the upload takes too long, it will just disconnect the > client. > > The solution is to scale up. Rails requests are single-threaded. > > The "big guys" are running lots of dispatchers on multiple machines. I > think someone on here from Strongspace mentioned that they currently use 20 > dispatchers, but don''t quote me on that. > > People are working on plugins for Mongrel that offload the file uploads to > a different process and then pass the file to Rails when the upload is done. > I don''t know how that''s coming but perhaps someone else can shed some light > on this. > > Beware: this is not just a problem with file uploads... it''s a problem > with requests and Rails in general. If your machine can only handle 5 > requests per second, then your 6th person is going to wait until someone > else is done. They requests will queue up and you will see terrible > performance unless you load-balance with multiple dispatchers. > > > > On 8/16/06, Davy Campano <dcampano@gmail.com> wrote: > > > > I''m starting to feel like this is an issue that does not have a > > resolution, which would mean that it would not possible to create a rails > > app with multiple people uploading at the same time on anything less than a > > dedicated box. Is this really true? > > > > > > On 8/16/06, Steven Hansen < runner@berkeley.edu> wrote: > > > > > > > > > Hi, > > > > > > I don''t know what the solution to this problem is, however I''m having > > > the exact same issues. If anyone has suggestions regarding how to > > > handle this with FCGI, I would also appreciate it! > > > > > > -Steven > > > > > > > > > On Aug 16, 2006, at 3:38 AM, Davy Campano wrote: > > > > > > > I am running 2 FCGI instances and they use about 22MB a piece. I > > > > can''t add too many more without maxing out my 128MB VPS box. > > > > Anyone know how 37signals guys handle this with backpack, etc? > > > > I''ll keep an eye out on Mongrel. > > > > > > > > On 8/15/06, Tom Mornini <tmornini@infomania.com > wrote: Run more > > > > FCGI instances? > > > > > > > > I believe there are also some (really excellent) solutions forming > > > > around Mongrel. > > > > > > > > On Aug 15, 2006, at 6:15 PM, Davy Campano wrote: > > > > > > > > > I am having the same type of problems. I am running apache with 2 > > > > > fastcgi instances. What is happening is each fastcgi instance is > > > > > blocking during a file upload, so if 2 people are uploading files > > > > > then both fastcgis are being blocked and no other web requests are > > > > > processed. What is a solution to this problem? > > > > > > > > > > On 7/28/06, Michael Barinek <barinek@gmail.com> wrote: I''m having > > > > > trouble uploading 2+ files simultaneously (from different > > > > > client machines)... > > > > > > > > > > the upload page just hangs... > > > > > > > > > > I''m running... > > > > > > > > > > - ruby 1.8.4 (2005-12-24) [i686-linux] > > > > > - rails 1.1.4 > > > > > - red hat el 4 > > > > > - apache > > > > > - fcgi (0.8.7, 0.8.6.1) > > > > > - firefox 1.5.0.5 > > > > > - httpd.conf > > > > > > > > > > <IfModule mod_fastcgi.c> > > > > > FastCgiIpcDir /tmp/fcgi_ipc/ > > > > > AddHandler fastcgi-script .fcgi > > > > > FastCGIConfig -minProcesses 2 > > > > > </IfModule> > > > > > > > > > > thoughts/suggestions? > > > > > > > > > > -- > > > > > Posted via http://www.ruby-forum.com/. > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060817/b819b5f0/attachment-0001.html