Hi All I am trying to generate pdf reports/documents based on time consuming database queries and associated calculations. When these are run in development mode they work fine (apart from taking a long time 5-10mins) but when these are run on the production system they result in timeout errors. Is there a better way to approach this problem? The controller method using the following statement: send_data pdf.render, :filename => "financial_summary.pdf", :type => "application/pdf" Any help appreciated. Thanks Adrian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You could use a cron job to run the reports periodically and send the PDF files from the file system. Background drb is another option Sent from my iPhone On Dec 12, 2007, at 9:15 PM, Adrian <AdrianLloydSmith-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi All > > I am trying to generate pdf reports/documents based on time consuming > database queries and associated calculations. When these are run in > development mode they work fine (apart from taking a long time > 5-10mins) but when these are run on the production system they result > in timeout errors. > > Is there a better way to approach this problem? The controller method > using the following statement: > > send_data pdf.render, :filename => "financial_summary.pdf", :type => > "application/pdf" > > Any help appreciated. > > Thanks > Adrian > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Could a separate thread be used? On Dec 13, 4:41 pm, Bcp <bcpar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You could use a cron job to run the reports periodically and send the > PDF files from the file system. > > Background drb is another option > > Sent from my iPhone > > On Dec 12, 2007, at 9:15 PM, Adrian <AdrianLloydSm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi All > > > I am trying to generate pdf reports/documents based on time consuming > > database queries and associated calculations. When these are run in > > development mode they work fine (apart from taking a long time > > 5-10mins) but when these are run on the production system they result > > in timeout errors. > > > Is there a better way to approach this problem? The controller method > > using the following statement: > > > send_data pdf.render, :filename => "financial_summary.pdf", :type => > > "application/pdf" > > > Any help appreciated. > > > Thanks > > Adrian--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Drb uses separate thread Sent from my iPhone On Dec 12, 2007, at 10:54 PM, Adrian <AdrianLloydSmith-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Could a separate thread be used? > > On Dec 13, 4:41 pm, Bcp <bcpar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> You could use a cron job to run the reports periodically and send the >> PDF files from the file system. >> >> Background drb is another option >> >> Sent from my iPhone >> >> On Dec 12, 2007, at 9:15 PM, Adrian <AdrianLloydSm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >> >> >>> Hi All >> >>> I am trying to generate pdf reports/documents based on time >>> consuming >>> database queries and associated calculations. When these are run in >>> development mode they work fine (apart from taking a long time >>> 5-10mins) but when these are run on the production system they >>> result >>> in timeout errors. >> >>> Is there a better way to approach this problem? The controller >>> method >>> using the following statement: >> >>> send_data pdf.render, :filename => "financial_summary.pdf", :type => >>> "application/pdf" >> >>> Any help appreciated. >> >>> Thanks >>> Adrian > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If possible, generating the report in advance is the best option, since the generation seems to be rally expensive (5-10min)... Cheers, Sazima On Dec 13, 5:10 am, Bcp <bcpar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Drb uses separate thread > > Sent from my iPhone > > On Dec 12, 2007, at 10:54 PM, Adrian <AdrianLloydSm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Could a separate thread be used? > > > On Dec 13, 4:41 pm, Bcp <bcpar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> You could use a cron job to run the reports periodically and send the > >> PDF files from the file system. > > >> Background drb is another option > > >> Sent from my iPhone > > >> On Dec 12, 2007, at 9:15 PM, Adrian <AdrianLloydSm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> wrote: > > >>> Hi All > > >>> I am trying to generate pdf reports/documents based on time > >>> consuming > >>> database queries and associated calculations. When these are run in > >>> development mode they work fine (apart from taking a long time > >>> 5-10mins) but when these are run on the production system they > >>> result > >>> in timeout errors. > > >>> Is there a better way to approach this problem? The controller > >>> method > >>> using the following statement: > > >>> send_data pdf.render, :filename => "financial_summary.pdf", :type => > >>> "application/pdf" > > >>> Any help appreciated. > > >>> Thanks > >>> Adrian--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---