Answers.Body: <p>Tasks are just another PHP request and they are subject to the same web server and <code>php.ini</code> limitations as a "normal" request.</p>
  
  <p>Sounds like you just need to up your <a href="https://secure.php.net/manual/en/info.configuration.php#ini.max-execution-time" rel="nofollow">max_execution_time</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-26T07:27:46.467Z
Answers.Text: But are all the tasks run as _one_ request? Or are they split up into separate requests? Because each task takes less than a second to complete, but we're getting maxed out after 30 seconds of running tasks. It usually completes around 80-100 tasks before shutting down.
Answers.UserDisplayName: peirix
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-26T17:32:31.647Z
Answers.Text: Yes - a task is run as one request even if it has multiple sub-tasks.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-25T17:53:25.613Z
Answers.LastActivityDate: 2015-06-25T17:53:25.613Z
Answers.UserDisplayName: Brad Bell
Body: <p>We've set up a task that's supposed to run through an external folder with images and resize them into 3 sizes each. This results in about 13000 tasks (one task per image). I thought each task was on a separate thread? But now the tasks are running for only 60 seconds (max_execution_time), then stopping. The task says <code>running</code> in the database, but it has just stopped, and the error log says max execution time was exceeded.</p>
  
  <p>Is there a way around this? Would sub tasks change any behaviour?</p>
  
Tags: <tasks>
Title: Problems with tasks and max execution time
ThreadText: # Problems with tasks and max execution time
  
  (Asked by: username_0 on 2015-06-25)
  
  We've set up a task that's supposed to run through an external folder with images and resize them into 3 sizes each. This results in about 13000 tasks (one task per image). I thought each task was on a separate thread? But now the tasks are running for only 60 seconds (max\_execution\_time), then stopping. The task says `running` in the database, but it has just stopped, and the error log says max execution time was exceeded.
  
  Is there a way around this? Would sub tasks change any behaviour?
  
  **Tags:** tasks
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-25. Score: 3
  
  Tasks are just another PHP request and they are subject to the same web server and `php.ini` limitations as a "normal" request.
  
  Sounds like you just need to up your [max\_execution\_time](https://secure.php.net/manual/en/info.configuration.php#ini.max-execution-time).
  
  > **Comments:**
  > **username_0**: But are all the tasks run as _one_ request? Or are they split up into separate requests? Because each task takes less than a second to complete, but we're getting maxed out after 30 seconds of running tasks. It usually completes around 80-100 tasks before shutting down.  
  > **username_1**: Yes - a task is run as one request even if it has multiple sub-tasks.  
  
  ---
  
  