<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>

CC BY-SA 3.0
2015-06-26T07:27:46.467Z
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.
peirix
CC BY-SA 3.0
2015-06-26T17:32:31.647Z
Yes - a task is run as one request even if it has multiple sub-tasks.
Brad Bell
CC BY-SA 3.0
2015-06-25T17:53:25.613Z
2015-06-25T17:53:25.613Z
Brad Bell
<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>

<tasks>
Problems with tasks and max execution time
# 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.  

---

