Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-17148

Template cache not generated can lead to database overload with ezdb cluster file handler

    XMLWordPrintable

Details

    Description

      Use case: a template operator that calls ezexecution::cleanexit in its modify() method is put in a node template. viewcache is on.

      Arguably bad practice, but still not disallowed by eZP apis.

      What happens is that the ezdb file handler creates a .generating file in the db, and never removes it, since it stops execution halfway through.

      When a 2nd request arrives for that same page, it will wait 60 seconds to steal the .generating file, then alter its mtime col and "suicide", leaving the .generating file still in the db.

      If there are say 10 almost-concurrent requests for that page, they will all queue up, sending 1 request per second to the db. If there are more, load on db can increment quickly.

      The proposed fix:
      1. when initializing db file handler, set up a new cleanup handler
      2. when creating a new .generating file, store it in a static var: name+timestamp
      3. when aborting cache gen / completing cache gen, remove .generating file from static var
      4. shutdown handler checks if there are any leftover files in its static var and removes them

      Attachments

        Activity

          People

            bd bd
            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: