Long-running requests (don't return results after 240 seconds)

19 views
Skip to first unread message

Oliver Bock

unread,
Oct 8, 2015, 6:52:14 AM10/8/15
to rapache
I am using rapache on the latest Ubuntu Server 14.04.  I am having trouble with long-running scripts never returning their results.  I have created this script for testing:

sleeptest <- function(){

  getrapache("setStatus")(200);

  getrapache("setContentType")("text/plain");

  t = as.numeric(getrapache("GET")$t)

  Sys.sleep(t)

  print(t)

  return(getrapache("OK"));

}


configured in Apache with

<Location /sleep>

        SetHandler r-handler

        RHandler filename:::sleeptest

</Location>


which lets me test long-running requests using, for example, http://myhost/sleep?t=5 to sleep for 5 seconds.  Sleep times less than 240 seconds return the expected result (after the expected delay).  Sleep times greater than 240 seconds never return results to my browser.

What I have tried:
  • I have used logging to files to confirm that Sys.sleep()s longer than 240 seconds do finish, so something is becoming detached between R and Apache.  Perhaps something in rapache is timing out.
  • There is nothing in error.log.
  • I have tried increasing Apache's Timeout setting, but this does not help.  That is unsurprising because its default is 300 seconds.

Any ideas?


  Oliver
Reply all
Reply to author
Forward
0 new messages