<p>We are constantly seeing the deleting stale template cache timeout problem on our servers - try increasing the time PHP can execute for to something very long. It seems like clearing the caches counts as one PHP request and not a bunch of tasks, so they can time out.</p>

<p>Good use of cache tags helps, and caching globally can also help - but other than that all I've found to make complex Craft builds faster is using something like Varnish or nginx. Neither of which are simple and both of which I've avoided so far.</p>

<p>PHP7 will help a lot, but I'm not aware of any distro that has PHP7 available yet.</p>

CC BY-SA 3.0
2015-12-14T15:58:44.740Z
If you don't mind running PPAs and use Ubuntu or Debian, [Andrej Sury's](https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0) PHP PPAs are popular and updated regularly.
RitterKnight
CC BY-SA 3.0
2015-12-14T15:45:17.070Z
2015-12-14T15:45:17.070Z
Matt Wilcox
<p>You probably already know and have done everything I'm about to say.  Our site is not that large, on shared hosting, and has been, not consistently, but frequently, VERY SLOW (60 seconds!) to load pages and especially to make any kind of edits on the control panel.  So I just did the following in our cPanel:</p>

<pre><code>Changed from PHP 5.5 to 7.0
Increased max_execution_time from 60 to 90
Increased mem_limit from 128M to 256M
Increased upload_max_filesize from 2M to 8M
Increased post_max_size from 8M to 16M.
</code></pre>

<p>I know little about this, but it is <em>zippy</em> now!  Pages are loading before Firefox can even make a full circle in either direction.</p>

<p>UPDATE: OK, some not-too-scientific stats:</p>

<pre><code>PHP 7.0, mem_limit 256M
HomePage initial GETs(on F5 refresh): 870ms 1.03s 1.11s 938ms
CP SaveAndContinueEditing inital POSTs: 10.47s 3.92s 3.18s 2.37s 3.57s 4.54s

PHP 5.5, mem_limit 256M
HomePage initial GETs(on F5 refresh): 1.23s 1.08s 1.28s 1.42s
CP SaveAndContinueEditing initial POSTs: 8.52s 4.06s 4.1s 5.15s 5.08s 3.63s

PHP 5.5, mem_limit 128M
HomePage initial GETs(on F5 refresh): 1.04s 1.44s 1.14s 1.25s
CP SaveAndContinueEditing initial POSTs: 4.15s 5.21s 4.33s 6.41s 4.31s 3.9s
</code></pre>

<p>I am not able to duplicate the incredibly slow responses I had previously, in which I frequently could walk away from the computer and come back and it hadn't loaded yet. When I said zippy, I meant a second or two instead of 30 seconds.</p>

CC BY-SA 3.0
2016-02-02T13:32:57.200Z
Do you have some graphs about the "Zipiness" of your site 5.5 vs 7.0 ?
KSPR
CC BY-SA 3.0
2016-02-02T17:15:55.373Z
FWIW, most benchmarks I've seen have PHP 7 executing almost twice as fast as 5.6. A lot of db calls will slow that down but I just did a new server build with PHP 7 and my local Mac on 5.6. The server—even over the Internet—is quite noticeably faster.  Makes you wonder what PHP 5.x is *doing.*
RitterKnight
CC BY-SA 3.0
2016-02-01T23:14:11.733Z
2016-02-04T15:22:22.940Z
2016-02-04T15:22:22.940Z
kr37
<p>Looking for hints and tips on speeding up and streamlining performance of a Craft site as we prepare for launch. </p>

<p>The database is approaching 100MB and whilst it is a fairly large and complex build (multiple locales with fairly extensive use of Matrix) this seems fairly excesive and page load times can be slow. Have looked at the Patrick Pohler post but any general, system level wins would be great as site is crawling a fair bit.</p>

<p>Am getting some performance increase through use of {% cache %} tags but then hitting DeleteStaleTemplateCaches issue qiute regularly which is stopping tasks running.</p>

<p>Any help appreciated!</p>

CC BY-SA 3.0
2015-12-14T15:41:46.610Z
what kind of server specs are you running on?
Steven Grant
CC BY-SA 3.0
2015-12-14T15:50:18.033Z
VPS with Memset using 2 x 0.80 GHz/4 GB Ram but similar problems running locally on Mamp (1.86 GHz/4 GB Ram)
Cole Henley
CC BY-SA 3.0
2015-12-14T16:00:30.657Z
Do you have any logged in users? if your content is fairly static, nginx would help you immensely.
RitterKnight
<database><cache><performance><speed>
General speed/performance on large Craft build
# General speed/performance on large Craft build

(Asked by: username_0 on 2015-12-14)

Looking for hints and tips on speeding up and streamlining performance of a Craft site as we prepare for launch.

The database is approaching 100MB and whilst it is a fairly large and complex build (multiple locales with fairly extensive use of Matrix) this seems fairly excesive and page load times can be slow. Have looked at the Patrick Pohler post but any general, system level wins would be great as site is crawling a fair bit.

Am getting some performance increase through use of {% cache %} tags but then hitting DeleteStaleTemplateCaches issue qiute regularly which is stopping tasks running.

Any help appreciated!

**Tags:** database, cache, performance, speed
> **Comments:**
> **username_1**: what kind of server specs are you running on?  
> **username_0**: VPS with Memset using 2 x 0.80 GHz/4 GB Ram but similar problems running locally on Mamp (1.86 GHz/4 GB Ram)  
> **username_2**: Do you have any logged in users? if your content is fairly static, nginx would help you immensely.  

---

## 2 answers

### Answer by username_3 on 2015-12-14. Score: 4

We are constantly seeing the deleting stale template cache timeout problem on our servers - try increasing the time PHP can execute for to something very long. It seems like clearing the caches counts as one PHP request and not a bunch of tasks, so they can time out.

Good use of cache tags helps, and caching globally can also help - but other than that all I've found to make complex Craft builds faster is using something like Varnish or nginx. Neither of which are simple and both of which I've avoided so far.

PHP7 will help a lot, but I'm not aware of any distro that has PHP7 available yet.

> **Comments:**
> **username_2**: If you don't mind running PPAs and use Ubuntu or Debian, [Andrej Sury's](https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0) PHP PPAs are popular and updated regularly.  

---

### Answer by username_4 on 2016-02-01. Score: 2

You probably already know and have done everything I'm about to say.  Our site is not that large, on shared hosting, and has been, not consistently, but frequently, VERY SLOW (60 seconds!) to load pages and especially to make any kind of edits on the control panel.  So I just did the following in our cPanel:
Changed from PHP 5.5 to 7.0
Increased max_execution_time from 60 to 90
Increased mem_limit from 128M to 256M
Increased upload_max_filesize from 2M to 8M
Increased post_max_size from 8M to 16M.

I know little about this, but it is zippy now!  Pages are loading before Firefox can even make a full circle in either direction.
UPDATE: OK, some not-too-scientific stats:
PHP 7.0, mem_limit 256M
HomePage initial GETs(on F5 refresh): 870ms 1.03s 1.11s 938ms
CP SaveAndContinueEditing inital POSTs: 10.47s 3.92s 3.18s 2.37s 3.57s 4.54s

PHP 5.5, mem_limit 256M
HomePage initial GETs(on F5 refresh): 1.23s 1.08s 1.28s 1.42s
CP SaveAndContinueEditing initial POSTs: 8.52s 4.06s 4.1s 5.15s 5.08s 3.63s

PHP 5.5, mem_limit 128M
HomePage initial GETs(on F5 refresh): 1.04s 1.44s 1.14s 1.25s
CP SaveAndContinueEditing initial POSTs: 4.15s 5.21s 4.33s 6.41s 4.31s 3.9s

I am not able to duplicate the incredibly slow responses I had previously, in which I frequently could walk away from the computer and come back and it hadn't loaded yet. When I said zippy, I meant a second or two instead of 30 seconds.

> **Comments:**
> **username_5**: Do you have some graphs about the "Zipiness" of your site 5.5 vs 7.0 ?  
> **username_2**: FWIW, most benchmarks I've seen have PHP 7 executing almost twice as fast as 5.6. A lot of db calls will slow that down but I just did a new server build with PHP 7 and my local Mac on 5.6. The server—even over the Internet—is quite noticeably faster.  Makes you wonder what PHP 5.x is *doing.*  

---

