On 12-Mar-10 13:49, Jonathan Zuckerman wrote:
On Fri, Mar 12, 2010 at 9:36 AM, Reese <howell.r@xxxxxxxxxxxxxxxx> wrote:On 12-Mar-10 11:31, Nilesh Govindarajan wrote:On Fri, Mar 12, 2010 at 6:49 PM, Bruno - e-comBR <bruno@xxxxxxxxxxxxxx> wrote:It's causing a little throuble for me. When a PHP script generates abigger report(taking about ten minutes or more), the user seems to be impatient. They're doing refreshs on the page. So, for each refresh apache is queuing a new script, and just begin running this when the queue is empty again. What do you suggest me? Thank you, Bruno Moreira GuedesI don't use mod_php, so don't know about its behavior. But I recommend you inform the users that the report can take upto ten minutes to generate and to be patient. That's the only solution I see.Else, if you can make the PHP script 'smart' in some way so that a popup or other visual indicator will give constant, visual feedback on the progress of the request. With a "Cancel" button that functions to kill the original request while blocking page refreshes. They can start over from scratch if they like. Reese --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxxIs there any way to cache the report?
You could get the parameters sorted out, then create a cron job from it and feed it to a .log file. This log file could be made available to administrators only, the world or something in between, depending on where in the file system it is located and the associated permissions.
To eventually ensure the user sees the report when it's done being generated, you could do some fancy Keep-alive with the http request, or just have some javascript on the page that automatically reloads it, and upon reload the script will check to see if there's a report built for that user, otherwise it checks to see if there's a lock. If there's a lock, it stops and waits to try again soon. If there is no lock, it starts a new report.
Or compress and store or mail it to them (and others?), starting a new log file after each clock cycle. This is starting to feel like reinventing HTTP access logs. We got off track somewhere. Reese --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx