Try this please, Cache configuration


(Christian Müller) #1

Hi all,

if you don’t use any other cache than the default settings, would you mind trying the following configuration for me and see if it gives you any speed boosts (ideally report with the system you used it on - Win, OSX, Linux, VM, HDD, SDD etc.).

If you are willing try production and development context and make sure you clear caches after setting this.

EDITED:

You can put this in Configuration/Caches.yaml for example:

TYPO3_TypoScript_Content:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/TYPO3_TypoScript_Content.sqlite'

Flow_Mvc_Routing_Route:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/Flow_Mvc_Routing_Route.sqlite'
Flow_Mvc_Routing_Resolve:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/Flow_Mvc_Routing_Resolve.sqlite'

Flow_Persistence_Doctrine:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/Flow_Persistence_Doctrine.sqlite'

Flow_Security_Authorization_Privilege_Method:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/Flow_Security_Authorization_Privilege_Method.sqlite'

Flow_Cache_ResourceFiles:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/Flow_Cache_ResourceFiles.sqlite'

TYPO3_Media_ImageSize:
  backend: TYPO3\Flow\Cache\Backend\PdoBackend
  backendOptions:
    dataSourceName: 'sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/TYPO3_Media_ImageSize.sqlite'

NOTE: I edited out the session cache because that only works for Neos dev-master. The rest should work as of now.


(Martin Ficzel) #2

I have a slightly better performance (12%) on a Mac with SSD and PHP 7

# BEFORE

ab -c 1 -n 10 http://127.0.0.1:8081/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient).....done


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8081

Document Path:          /
Document Length:        65535 bytes

Concurrency Level:      1
Time taken for tests:   5.128 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      657180 bytes
HTML transferred:       655350 bytes
Requests per second:    1.95 [#/sec] (mean)
Time per request:       512.778 [ms] (mean)
Time per request:       512.778 [ms] (mean, across all concurrent requests)
Transfer rate:          125.16 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.5      0       2
Processing:   449  512 110.1    475     787
Waiting:      432  492 104.4    459     757
Total:        449  513 110.5    475     788

Percentage of the requests served within a certain time (ms)
  50%    475
  66%    480
  75%    490
  80%    627
  90%    788
  95%    788
  98%    788
  99%    788
 100%    788 (longest request)

# AFTER

 ab -c 1 -n 10 http://127.0.0.1:8081/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 127.0.0.1 (be patient).....done


Server Software:        
Server Hostname:        127.0.0.1
Server Port:            8081

Document Path:          /
Document Length:        65535 bytes

Concurrency Level:      1
Time taken for tests:   4.588 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      657180 bytes
HTML transferred:       655350 bytes
Requests per second:    2.18 [#/sec] (mean)
Time per request:       458.795 [ms] (mean)
Time per request:       458.795 [ms] (mean, across all concurrent requests)
Transfer rate:          139.88 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       1
Processing:   443  458  11.5    461     479
Waiting:      427  442  10.7    444     462
Total:        443  459  11.6    461     480

Percentage of the requests served within a certain time (ms)
  50%    461
  66%    465
  75%    467
  80%    468
  90%    480
  95%    480
  98%    480
  99%    480
 100%    480 (longest request)

(Michael Gerdemann) #3

Almost no performance boosts on Ubuntu VM (on SSD) with docker and PHP 7.

# Before 


ab -c 1 -n 10 http://neos.local/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking neos.local (be patient).....done


Server Software:        nginx/1.9.15
Server Hostname:        neos.local
Server Port:            80

Document Path:          /
Document Length:        202602 bytes

Concurrency Level:      1
Time taken for tests:   18.913 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      2028230 bytes
HTML transferred:       2026020 bytes
Requests per second:    0.53 [#/sec] (mean)
Time per request:       1891.320 [ms] (mean)
Time per request:       1891.320 [ms] (mean, across all concurrent requests)
Transfer rate:          104.73 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:  1797 1891  56.4   1890    1982
Waiting:     1775 1866  55.1   1865    1956
Total:       1798 1891  56.4   1890    1983

Percentage of the requests served within a certain time (ms)
  50%   1890
  66%   1895
  75%   1934
  80%   1957
  90%   1983
  95%   1983
  98%   1983
  99%   1983
 100%   1983 (longest request)

# After

~ ab -c 1 -n 10 http://neos.local/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking neos.local (be patient).....done


Server Software:        nginx/1.9.15
Server Hostname:        neos.local
Server Port:            80

Document Path:          /
Document Length:        202602 bytes

Concurrency Level:      1
Time taken for tests:   17.760 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      2028230 bytes
HTML transferred:       2026020 bytes
Requests per second:    0.56 [#/sec] (mean)
Time per request:       1776.048 [ms] (mean)
Time per request:       1776.048 [ms] (mean, across all concurrent requests)
Transfer rate:          111.52 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       1
Processing:  1750 1776  19.1   1773    1811
Waiting:     1723 1749  18.4   1746    1783
Total:       1750 1776  19.1   1773    1812

Percentage of the requests served within a certain time (ms)
  50%   1773
  66%   1776
  75%   1785
  80%   1803
  90%   1812
  95%   1812
  98%   1812
  99%   1812
 100%   1812 (longest request)

(Martin Huber) #4

Sorry, would like to help/share experience, but get the error:
#1370964557: The session meta data cache must provide a backend implementing the IterableBackendInterface, but the given backend "TYPO3\Flow\Cache\Backend\PdoBackend" does not implement it.

after I copy & paste your Code from [quote=“christianm, post:1, topic:1313”]
TYPO3_TypoScript_Content:
[/quote]
to [quote=“christianm, post:1, topic:1313”]
dataSourceName: ‘sqlite:%FLOW_PATH_TEMPORARY%Cache/Data/TYPO3_Media_ImageSize.sqlite’
[/quote]
(42 Lines)
into: root/neos-base-distribution/Configuration/Caches.yaml and flush the cash.

Same in other installation without neos-base-distribution: root/Configuration/Caches.yaml. After deleting the content in Caches.yaml all is like before :thinking:.
Maybe I misunderstood something in your advice!?


Problem with pages with a lot of content elements and Aloha initialization
(Michael Gerdemann) #5

@mad: The PdoBackend implements the IterableBackendInterface only in master-Branch.
(see this commit: 10276545b52e621e8549c50e9aaff382ba710071)


(Christian Müller) #6

FYI: I edited out the session stuff, should work in stable as well now.


(Gerhard Boden) #7

Is this for 2.2 only, or can i also try this on 2.1?


(Christian Müller) #8

I think the edited variant should work in 2.1 as well.


(Martin Huber) #9

Hi,
first time ab-using, hope these values helps. Suspect much longer time :weary: and three times not really pleasant results.

System OS X 10.11.6 on SSD, MAMP PRO

  • Medium complex website
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking test.neos (be patient).....done


Server Software:        Apache
Server Hostname:        test.neos
Server Port:            80

Document Path:          /
Document Length:        45864 bytes

Concurrency Level:      1
Time taken for tests:   55.915 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      460590 bytes
HTML transferred:       458640 bytes
Requests per second:    0.18 [#/sec] (mean)
Time per request:       5591.451 [ms] (mean)
Time per request:       5591.451 [ms] (mean, across all concurrent requests)
Transfer rate:          8.04 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       0
Processing:  5574 5591  28.8   5583    5671
Waiting:      556  571  27.9    562     648
Total:       5575 5591  28.7   5583    5671

Percentage of the requests served within a certain time (ms)
  50%   5583
  66%   5584
  75%   5587
  80%   5596
  90%   5671
  95%   5671
  98%   5671
  99%   5671
 100%   5671 (longest request)

# after flush cache and reload one-time in browser (otherwise much longer loading-time 90%-100%)

Benchmarking test.neos (be patient).....done


Server Software:        Apache
Server Hostname:        test.neos
Server Port:            80

Document Path:          /
Document Length:        45864 bytes

Concurrency Level:      1
Time taken for tests:   55.933 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      460590 bytes
HTML transferred:       458640 bytes
Requests per second:    0.18 [#/sec] (mean)
Time per request:       5593.260 [ms] (mean)
Time per request:       5593.260 [ms] (mean, across all concurrent requests)
Transfer rate:          8.04 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:  5565 5593  19.1   5594    5626
Waiting:      546  573  17.5    573     604
Total:       5565 5593  19.1   5595    5627

Percentage of the requests served within a certain time (ms)
  50%   5595
  66%   5595
  75%   5601
  80%   5619
  90%   5627
  95%   5627
  98%   5627
  99%   5627
 100%   5627 (longest request)

result: median: 5583(old) to 5595(new) => equal.


  • More complex site: 1839 nodes, less images
Benchmarking test.neos (be patient).....done


Server Software:        Apache
Server Hostname:        test.neos
Server Port:            80

Document Path:          /test-with-many-elements.html/
Document Length:        241912 bytes

Concurrency Level:      1
Time taken for tests:   55.794 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      2421080 bytes
HTML transferred:       2419120 bytes
Requests per second:    0.18 [#/sec] (mean)
Time per request:       5579.373 [ms] (mean)
Time per request:       5579.373 [ms] (mean, across all concurrent requests)
Transfer rate:          42.38 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:  5559 5579  15.6   5580    5604
Waiting:      538  559  15.2    562     580
Total:       5559 5579  15.6   5580    5605

Percentage of the requests served within a certain time (ms)
  50%   5580
  66%   5584
  75%   5592
  80%   5597
  90%   5605
  95%   5605
  98%   5605
  99%   5605
 100%   5605 (longest request)

# after flush cache and reload one-time in browser (otherwise much longer loading-time 90%-100%)

Benchmarking test.neos (be patient).....done


Server Software:        Apache
Server Hostname:        test.neos
Server Port:            80

Document Path:          /test-with-many-elements.html/
Document Length:        241912 bytes

Concurrency Level:      1
Time taken for tests:   57.237 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      2421080 bytes
HTML transferred:       2419120 bytes
Requests per second:    0.17 [#/sec] (mean)
Time per request:       5723.720 [ms] (mean)
Time per request:       5723.720 [ms] (mean, across all concurrent requests)
Transfer rate:          41.31 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       0
Processing:  5567 5723 444.5   5586    6988
Waiting:      548  702 440.5    567    1956
Total:       5567 5724 444.5   5586    6988

Percentage of the requests served within a certain time (ms)
  50%   5586
  66%   5589
  75%   5592
  80%   5610
  90%   6988
  95%   6988
  98%   6988
  99%   6988
 100%   6988 (longest request)

result: median: 5580(old) to 5586(new) => equal.


  • default demo-website, no change
Benchmarking demo.neos (be patient).....done


Server Software:        Apache
Server Hostname:        demo.neos
Server Port:            80

Document Path:          /
Document Length:        8761 bytes

Concurrency Level:      1
Time taken for tests:   56.050 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      89550 bytes
HTML transferred:       87610 bytes
Requests per second:    0.18 [#/sec] (mean)
Time per request:       5605.007 [ms] (mean)
Time per request:       5605.007 [ms] (mean, across all concurrent requests)
Transfer rate:          1.56 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       0
Processing:  5491 5605 314.2   5507    6499
Waiting:      474  579 293.7    487    1414
Total:       5492 5605 314.1   5508    6499

Percentage of the requests served within a certain time (ms)
  50%   5508
  66%   5509
  75%   5509
  80%   5516
  90%   6499
  95%   6499
  98%   6499
  99%   6499
 100%   6499 (longest request)

# after flush cache and reload one-time in browser (otherwise much longer loading-time 90%-100%)

Benchmarking demo.neos (be patient).....done


Server Software:        Apache
Server Hostname:        demo.neos
Server Port:            80

Document Path:          /
Document Length:        8761 bytes

Concurrency Level:      1
Time taken for tests:   55.148 seconds
Complete requests:      10
Failed requests:        0
Total transferred:      89550 bytes
HTML transferred:       87610 bytes
Requests per second:    0.18 [#/sec] (mean)
Time per request:       5514.777 [ms] (mean)
Time per request:       5514.777 [ms] (mean, across all concurrent requests)
Transfer rate:          1.59 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:  5497 5515  10.9   5515    5536
Waiting:      476  494  11.1    497     515
Total:       5498 5515  10.9   5515    5536

Percentage of the requests served within a certain time (ms)
  50%   5515
  66%   5520
  75%   5521
  80%   5522
  90%   5536
  95%   5536
  98%   5536
  99%   5536
 100%   5536 (longest request)

result: median: 5508(old) to 5515(new) => equal.


sorry for three times unpleasant results. Maybe I did something wrong.
For analysis I always use the same procedure:

  • paste and save (for old), or delete and save (for new) the content in root/Configuration/Caches.yaml
  • flush the cache
  • load the website 1 time in browser
  • than use «ab» in terminal

(Christian Müller) #10

Thanks for the numbers. I mean I am trying to figure out how it behaves so any numbers are good. i would love to see production context and a bit more concurrency though…


(Gerhard Boden) #11

Hi,

so I adapted the ```Caches.yaml file on our production system today.

The frontend loading times stayed practically the same (TTFB ~150ms on average, okay for a shared host on PHP 7 without any special caching mechanism I’d say. Neos is on 2.1.9).

But I expect a huge performance improvement for the backend. This site used to create 6000+ Cache files in less than a week for content cache alone. So after a couple of weeks the backend was so slow, that the editors could not really work on the content anymore, unless i cleared the cache.

The backend loading times just before and after the change looked like this:

File Cache (cache cleared recently)

SQLite Cache:

I wish I had a screenshot from the times the cache was “full” and the backend got really slow.

As i said before, I expect the largest difference after the site ran for a couple of days and my editors do not complain about waiting 5 seconds for changing the document :slight_smile:

Dunno if my numbers are of any help, but when this fixes my file cache issue without having to implement an ACPu cache (which I never got around to), I would gladly use this on all of our sites!

Will report back in a couple of days and report about the editor experience.


(Gerhard Boden) #12

It’s been 14 days and the backend is still fast as ever (compared the numbers above, no noticeable performance loss).

With the standard file cache configuration the loading time would be at 5-10+ seconds by now, but the sqlite cache is still holding up very well.

TYPO3_TypoScript_Content.sqlite is at 153,2 MB. I guess most of the nodes are cached by now.


(Christian Müller) #13

Great to hear!


(Gerhard Boden) #14

Better late than never:

VERY IMPORTANT INFORMATION

Be aware that the PdoBackend Cache in Flow has a default lifetime of 3600 seconds. See:
https://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/Caching.html#common-options

So you’ll need to add this option to each entry above to avoid cache expiration every hour:

    defaultLifetime: 0

Maybe @christianm can add this to his code sample and extend the backendOptions

Be aware that this has nothing to do with your maximumLifetime setting in your Fusion cache configuration!


Team Unicorn | Team Meeting | 2018-09-13