Skip to content

Memory issue on full cache flush #45

@kitzberger

Description

@kitzberger

We've noticed that running bin/typo3 cache:flush sometimes runs into memory exhaustion issues.

I'm not sure if the problem is with our TYPO3 instance or if it's an issue with this extension.

In https://github.com/b13/proxycachemanager/blob/master/Classes/Cache/Backend/ReverseProxyCacheBackend.php#L128-L136 all cached URLs are being fetched from table cache_tx_proxy:

        $conn = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->cacheTable);
        $stmt = $conn->select(['content'], $this->cacheTable);
        while ($url = $stmt->fetchOne()) {
            $urls[] = $url;
        }

Question 1: does it really make sense to fetch them one by one? That's one hella DB queries, isn't it?

This big fat array of URLs is then being handed over to $this->reverseProxyProvider->flushAllUrls($urls);.

Question 2: would it be better to implement chunking on $urls and iterating over those chunks on your extension already or rather on our custom CurlHttpProxyProvider?

Looking forward to hearing back from you guys!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions