504 Gateway Timeout Error while processing big data files
Hello Hughes, Thanks for your solution. Can you elaborate the process by using my code? I am newbie in web development and never worked on AJAX. So I am having little bit hard time to connect front-end and back-end pieces. I hope this make sense. Thanks again for your help. Best, Tushar On Tue, Oct 14, 2014 at 7:00 AM, <dancer-users-request@dancer.pm> wrote:
Send dancer-users mailing list submissions to dancer-users@dancer.pm
To subscribe or unsubscribe via the World Wide Web, visit http://lists.preshweb.co.uk/mailman/listinfo/dancer-users or, via email, send a message with subject or body 'help' to dancer-users-request@dancer.pm
You can reach the person managing the list at dancer-users-owner@dancer.pm
When replying, please edit your Subject line so it is more specific than "Re: Contents of dancer-users digest..."
Today's Topics:
1. 504 Gateway Timeout Error while processing big data files (Tushar Dave) 2. Dancer2 0.152000 on its way to CPAN (Sawyer X) 3. Re: 504 Gateway Timeout Error while processing big data files (Hugues)
----------------------------------------------------------------------
Message: 1 Date: Mon, 13 Oct 2014 09:45:12 -0400 From: Tushar Dave <tushardave26@gmail.com> To: dancer-users@dancer.pm Subject: [dancer-users] 504 Gateway Timeout Error while processing big data files Message-ID: <CA+8TAD= AV+-bPirEK_HtJKV6MzPSsicU+hHWES-ZWvDu30AQqg@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Hello,
I am working on my Dancer Project (using Perl 5.20.0, apache2, RHEL 6 and Dancer) in which I am providing a web form to user. When user submits the form with appropriate values, a Q-Q plot will be generated by R code on backend. Once the plot is available on server I am sending user an email with the link of generated plot.
My code works completely fine with smaller data file (e.g. 100KB ? 10 MB) upload. But, if user uploads the large data files (e.g. > 30MB), the upload works fine but processing of data and generating of plot will take more time which caused 504 Gateway Time Out Error. I can use below options to resolve this.
(1) Change Time Out time in apache configuration file (2) Submit a job through batch queuing system such as SGE (3) Use Proc::Simple or Proc::Background to run the process in background and keep checking whether process is running in background or not.
I am using the 3rd option. What I am trying to do is I am using Proc::Simple to run Perl-R-code (i.e. listed in below list as 2) in background. Then I am using poll() method of Proc::Simple to check whether the process is running or not. If the process is running, render a template that shows user that process is still running. When process is finished, render another template with generated Q-Q plot. Below are my codes:
(1) Dancer code under lib/ ---- http://pastebin.com/QGCFtq2X < http://l.facebook.com/l.php?u=http%3A%2F%2Fpastebin.com%2FQGCFtq2X&h=rAQEet8...
(2) Perl + R code that generate Q-Q plot ----http://pastebin.com/U5hg45dQ (3) qqPlot.tt ---- http://pastebin.com/u30XArVr (4) processing.tt ---- http://pastebin.com/RSH1kptp < http://l.facebook.com/l.php?u=http%3A%2F%2Fpastebin.com%2FRSH1kptp&h=RAQE1lH...
The problem I am facing right now that my Dancer code (i.e. listed as 1 above) execute while loop on line 77 of (1) but the template ? processing.tt? is not coming up on browser. I don?t know what am I doing wrong?
Can someone help me to figure out my error? Or please suggest me any other way to resolve Gateway Time Out Error.
Thanks for any help.
participants (1)
-
Tushar Dave