georgringer / news

TYPO3 Extension news
GNU General Public License v2.0
265 stars 355 forks source link

Saving a news record is not possible or super slow #950

Closed mieserfettsack closed 5 years ago

mieserfettsack commented 5 years ago

After switching to the composer based setup news is almost not usable. Server runs into "504 Gateway Timeout error" very often or saving a news takes about 5 mins.

We did not changed hardware nor packages installed on this OS. Everthing is the same except TYPO3 installation, which now is build from composer. All extension stayed in the same version.

Current Behavior When saving a new or existing news record the server ends up with a "504 Gateway Timeout error".

Expected behavior/output The news record should be saved instantly. (like before)

Environment

Possible Solution Not sure.

Additional context Since this page deals with 500k > news, a lot of categories and related news my first thought was, that I got some very slow mysql-queries. But mysql was just runing fine and did not produced any slow logs nor errors.

So I activated slow log for php-fpm to find out what is taking so long:

[0x00007f3a2641e3d0] execute() /srv/httpd/www.bild.de/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php:156
[0x00007f3a2641e2b0] execute() /srv/httpd/www.bild.de/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:903
[0x00007f3a2641e1d0] executeQuery() /srv/httpd/www.bild.de/vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php:200
[0x00007f3a2641e160] execute() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/Database/Query/QueryBuilder.php:187
[0x00007f3a2641e0c0] execute() /srv/httpd/www.bild.de/public/typo3conf/ext/staticfilecache/Classes/Domain/Repository/QueueRepository.php:53
[0x00007f3a2641e020] countOpenByIdentifier() /srv/httpd/www.bild.de/public/typo3conf/ext/staticfilecache/Classes/Service/QueueService.php:60
[0x00007f3a2641df80] addIdentifier() /srv/httpd/www.bild.de/public/typo3conf/ext/staticfilecache/Classes/Service/QueueService.php:49
[0x00007f3a2641df00] addIdentifiers() /srv/httpd/www.bild.de/public/typo3conf/ext/staticfilecache/Classes/Cache/StaticFileBackend.php:224
[0x00007f3a2641de70] flushByTag() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php:150
[0x00007f3a2641ddc0] flushByTag() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/Cache/CacheManager.php:205
[0x00007f3a2641dd10] flushCachesInGroupByTag() /srv/httpd/www.bild.de/public/typo3conf/ext/news/Classes/Hooks/DataHandler.php:43
[0x00007f3a2641dc50] clearCachePostProc() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php:3578
[0x00007f3a2641dbe0] call_user_func_array() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php:3578
[0x00007f3a2641daf0] callUserFunction() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php:8834
[0x00007f3a2641d920] prepareCacheFlush() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php:8692
[0x00007f3a2641d7d0] processClearCacheQueue() /srv/httpd/www.bild.de/public/typo3/sysext/core/Classes/DataHandling/DataHandler.php:1314
[0x00007f3a2641d4e0] process_datamap() /srv/httpd/www.bild.de/public/typo3/sysext/backend/Classes/Controller/EditDocumentController.php:691
[0x00007f3a2641d230] processData() /srv/httpd/www.bild.de/public/typo3/sysext/backend/Classes/Controller/EditDocumentController.php:531
[0x00007f3a2641d190] mainAction() /srv/httpd/www.bild.de/public/typo3/sysext/backend/Classes/Http/RouteDispatcher.php:87
[0x00007f3a2641d120] call_user_func_array() /srv/httpd/www.bild.de/public/typo3/sysext/backend/Classes/Http/RouteDispatcher.php:87

I removed the following lines that causes huge time processing: https://github.com/georgringer/news/blob/master/Classes/Hooks/DataHandler.php#L41-L44

Now everything is running normal.

Is this an configuration error or related to a huge database? Could this be a news related bug or TYPO3?

Maybe someone could help me out here. Since we are not able to rollback to the old version. I have to run the site with the patched version of DataHandler.php.

georgringer commented 5 years ago

so actually it is not only a change from non-composer to composer but also a update of the extension (and core)? what did you update from what?

mieserfettsack commented 5 years ago

No extension changed its version number. But I just found out, that TYPO3 version changed during composer upgrade from 9.5.5 to 9.5.8.

mieserfettsack commented 5 years ago

Okay, it looks like the problem here is not EXT:news. EXT:staticfilecache seems to be the problem. It trys to clear caches, which takes a lot of time. Disabling EXT:staticfilecache sovles the problem. I will try to investiagte it later.

You can close this issue.