Skip to content

Performance issue in big systems #11

Description

@michael-e

In a "big system" (a bigger-than-usual Symphony web app) I experienced a surprising issue. Although I am pretty sure that there is no simple solution to this, I am posting it here for reference.

It's a performance issue! Well, not in the frontend (which is about twice as fast with most of the DSs cached), but upon saving entries. The extension will attempt to delete a lot of cache files (in the flushCache function), using PHP's glob() to find all of them. I have more than 50.000 cache files, and even on my fast dedicated server each glob() will take a bit more than 40 ms. Counting 19 datasources for one section and 5 "associated" sections, the extension will perform 95 globs. So it takes more than 4 seconds to delete the cache files.

I played with this issue for a whole day, and I haven't found any workaround. Reducing everything to a single glob call, for example, by adding all the datasource handles to an array first, then doing s.th. like

$cache = glob($cacheDir.'{'.implode(',', $flushHandles).'}_*.xml', GLOB_BRACE);

doesn't help at all—it just doesn't work any faster.

In my eyes the only solution would be an asynchronous/background process, which would mean a major rewrite of the extension. If somebody has a different idea, please post it here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions