Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-2256

Regression/Performance Issue introduced by PDB-135

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PDB 3.2.0, PDB 3.2.1, PDB 3.2.2
    • Fix Version/s: PDB 3.2.3
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      3
    • Sprint:
      PuppetDB 2015-12-30

      Description

      Hello,

      I got a regression/performance issue using puppetdb-termini, version > 3.2

      PR #1640 has introduced a warning message when using invalid UTF-8 sequence.

      The issue is located here :

      https://github.com/puppetlabs/puppetdb/blob/master/puppet/lib/puppet/util/puppetdb/char_encoding.rb#L38

      This function just takes forever to complete when using a "big" catalog.

      Step to reproduce :

      It's pretty easy, you just need to trigger this function (so with a catalog with some non UTF-8 caracters), and a "big" catalog. For example :

       
      node default{
       
      $loops = range("0", "500")
      each($loops) |$iteration| {
        file {"/tmp/test-$iteration":
          ensure  => file,
          owner   => 'root',
          group   => 'root',
          content => template('test/test.erb'),
        }
      }
       
      }
       
      with test.erb, including some non UTF-8 caracters like a Kerberos Keytab file : 
       
      <%data = File.open('/etc/krb5.keytab').read-%><%= data -%>
      
      

      On my computer, performance of this function is :

      With range 10 : 0s
      With range 100 : 8s
      With range 500 : 3min5s
      With range > 10000, still waiting to complete

      As you can see, this isn't linear. Catalog compilation isn't affected by this (always <1s).

      On a production environment, this bug leads to a puppetserver having all workers 'blocked' on this function, with a 100% cpu consumption.

      I think this issue, is specific to Jruby. Using Ruby interpreter, I couldn't reproduce it.

      Looking at some jruby issues, I've seen this one : https://github.com/jruby/jruby/issues/504
      This could be linked, but I amn't sure.

      Regards

      Olivier

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                Olivier Hanesse Olivier Hanesse
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: