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

Reduce the amount of file_exists calls in eZINI

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Won't Fix
    • Affects Version/s: 4.1.3
    • Fix Version/s: Customer request
    • Component/s: Misc
    • Labels:
      None

      Description

      For each request, eZINI generates around 250 file_exists calls which generates around 250 access [1] calls as well. Considering a syscall is generally bad for performances, we need to find a way to reduce the amount of file_exists calls for eZINI.

      Here is a few statistics, I got from Dtrace :

      Summary : 
       
      syscall statistics:
       
       access                                   255
       
        /srv/www/ezp41test/lib/ezutils/classes/ezini.php  
                 value  ------------- Distribution ------------- count    
                   248 |                                         0        
                   249 |                                         1        
                   [...............................................]
                   311 |                                         0        
                   312 |@@@                                      17       
                   318 |                                         0        
                   [...............................................]
                   319 |@@@                                      17       
                   320 |                                         0        
                   321 |                                         0        
                   322 |                                         0        
                   323 |                                         0        
                   324 |                                         2        
                   325 |                                         0        
                   326 |                                         0        
                   327 |                                         2        
                   [...............................................]
                   343 |                                         0        
                   344 |@@@@@@@@                                 54       
                   345 |                                         0        
                   346 |                                         0        
                   347 |                                         0        
                   348 |                                         0        
                   349 |@@@@@@@@                                 54       
                   350 |                                         0        
                   351 |                                         0        
                   352 |                                         0        
                   353 |                                         0        
                   354 |@@@@@@@@                                 54       
                   355 |                                         0        
                   356 |                                         0        
                   357 |                                         0        
                   358 |                                         0        
                   359 |@@@@@@@@                                 54       
                   [...............................................]
                   439 |@@@                                      17 
      

      This test has been run on ezp 4.1.1 but I am sure it is more or less the same on trunk.

      1. http://docs.sun.com/app/docs/doc/816-5167/access-2?l=fr&a=view&q=access

        Issue Links

          Activity

          Hide
          Jérôme Renard added a comment -

          I see one good candidate for a modification :

          • eZINI::findInputFiles [1]

          By changing the algorithm we might be able to reduce the amount of file_exists calls.

          1. http://pubsvn.ez.no/doxygen/trunk/html/ezini_8php-source.html#l00305

          Show
          Jérôme Renard added a comment - I see one good candidate for a modification : eZINI::findInputFiles [1] By changing the algorithm we might be able to reduce the amount of file_exists calls. 1. http://pubsvn.ez.no/doxygen/trunk/html/ezini_8php-source.html#l00305
          Hide
          Jérôme Renard added a comment -

          Or we could simply remove test for .php and .append files.

          Which means the new valid ini extensions would be :

          • .ini
          • .append.php

          are .php and .append that used and that useful ?

          Show
          Jérôme Renard added a comment - Or we could simply remove test for .php and .append files. Which means the new valid ini extensions would be : .ini .append.php are .php and .append that used and that useful ?
          Hide
          Jérôme Renard added a comment -

          Actually using,

          define( 'EZP_INI_FILEMTIME_CHECK', false );
          

          in config.php reduced the number of syscall a lot so that's ok.

          Show
          Jérôme Renard added a comment - Actually using, define( 'EZP_INI_FILEMTIME_CHECK', false ); in config.php reduced the number of syscall a lot so that's ok.
          Hide
          Gaetano Giunta added a comment -

          In reply to comment #048783
          maybe this can be voted upon and introduced in 4.2?

          Show
          Gaetano Giunta added a comment - In reply to comment #048783 maybe this can be voted upon and introduced in 4.2?
          Hide
          Gaetano Giunta added a comment -

          In reply to comment #048785
          by popular demand, iff we do it, we should provide a script to detect offenders and rename them...

          http://ez.no/developer/forum/suggestions/poll_scrap_using_php_and_append_extensions_for_ini_files/

          Show
          Gaetano Giunta added a comment - In reply to comment #048785 by popular demand, iff we do it, we should provide a script to detect offenders and rename them... http://ez.no/developer/forum/suggestions/poll_scrap_using_php_and_append_extensions_for_ini_files/
          Hide
          ezrobot added a comment -

          This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

          Show
          ezrobot added a comment - This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

            People

            • Assignee:
              Unassigned
              Reporter:
              Jérôme Renard
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: