1

I'm using Google's latest Windows App Engine PHP SDK, v1.9.38 to run some long running scripts on the local dev server and for some reason they're timing out at 30 seconds. Error is e.g. "Fatal error: The request was aborted because it exceeded the maximum execution time. in [my script path]\timertest.php on line 8"

The time out is supposed to be 60 seconds for automatic scaling! I'm not sure what I'm missing here... I'm doing various file processing in one script but I then wrote a test script to see if that failed at 30 secs too, and it did. Script is:

<?php

$a = 1;

do
    {
    syslog(LOG_INFO, $a.' Sleeping for 10 secs...\n');
    sleep(10);
    $a++;
    }
while($a < 8)

?>

Output is:

INFO: 1 Sleeping for 10 secs...\n
INFO: 2 Sleeping for 10 secs...\n
INFO: 3 Sleeping for 10 secs...\n
ERROR:root:php failure (255) with:

stdout:

X-Powered-By: PHP/5.5.26

Content-type: text/html

<br />

<b>Fatal error</b>:  The request was aborted because it exceeded the maximum execution time. in <b>[my script path]\timertest.php</b> on line <b>8</b><br />

INFO     2016-06-02 20:52:56,693 module.py:788] default: "GET /testing/timertest.php HTTP/1.1" 500 195

I was thinking it was a config error somewhere, but not sure what or where. My app.yaml is very standard:

application: ak2016-1
version: 1
runtime: php55
api_version: 1

handlers:
# Serve php scripts.
- url: /(.+\.php)$
  script: \1
  login: admin

and php.ini too:

google_app_engine.disable_readonly_filesystem = 1
upload_max_filesize = 8M
display_errors = "1"
display_startup_errors = "1"

As I say, this is an issue with the local dev SDK server only, I'm not bothered about the online live side as files I'm processing are local (and need to remain so).

Thanks for any suggestions etc!

Alex Kerr
  • 956
  • 15
  • 44

1 Answers1

2

I deployed the app sample on the Request Timer documentation, and was not able to duplicate your issue. My requests all timeout after ~60 seconds:

$ time curl https://<project-id>.appspot.com/timeout.php 
Got timeout! Cleaning up...
real    1m0.127s
user    0m0.021s
sys     0m0.010s

I then copied your code, app.yaml, and php.ini to see if I could duplicate that, and received the following in my syslogs:

INFO: 1 Sleeping for 10 secs...\n
INFO: 2 Sleeping for 10 secs...\n
INFO: 3 Sleeping for 10 secs...\n
INFO: 4 Sleeping for 10 secs...\n
INFO: 5 Sleeping for 10 secs...\n
INFO: 6 Sleeping for 10 secs...\n
INFO: PHP Fatal error:  The request was aborted because it exceeded the maximum execution time. in /base/data/home/apps/.../timeout2.php on line 9

However, if you continue to have issues with requests timing out after 30 seconds, I would suggest moving the offending code into task queues. I hope this helps!

Brent Shaffer
  • 491
  • 3
  • 11