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

eZDBFileHandlerMysqliBackend create too many connections

    XMLWordPrintable

Details

    Description

      Let's say we have a limit of mysql connections set to 1000 and want to store 1001 files with eZClusterFileHandler::instance

      for($i = 0; $i <= 1001; $i++) {
          eZClusterFileHandler::instance('var/file_' . $i . '.cache')->storeContents($i);
      }
      

      Suggested solutions:
      1) Add mysqli_close into __destruct (safe and easy option)
      2) Use static for eZDBFileHandlerMysqliBackend::db property. Looks like eZ Kernel not using eZDBFileHandlerMysqliBackend->_connect(true) and we don't need to create separate connection per instance.

      Attachments

        Activity

          People

            Unassigned Unassigned
            9617ee47-cb27-4291-b8b8-676aa93a5338@accounts.ibexa.co Ivan Ternovtsiy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: