[PDB-2256] Regression/Performance Issue introduced by PDB-135 Created: 2015/12/13 Updated: 2016/01/11 Resolved: 2015/12/21
|Affects Version/s:||PDB 3.2.0, PDB 3.2.1, PDB 3.2.2|
|Fix Version/s:||PDB 3.2.3|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
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 :
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 :
On my computer, performance of this function is :
With range 10 : 0s
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
|Comment by Ryan Senior [ 2015/12/14 ]|
This is some great investigation Olivier Hanesse. We have a new iteration that starts on Wednesday, this will be included then (if not sooner). Thanks for all of the detail!
Chris Price - did you see anything like this with JRuby working on file sync?
|Comment by Chris Price [ 2015/12/14 ]|
Ryan Senior no, but I do think it would probably be worthwhile to write a simple reproducer, all in ruby, that can be run from the CLI to compare MRI/JRuby. We have seen some cases where e.g. the Puppet code lexer was slower in JRuby, and that's the easiest way to tease out where the issue might be.
|Comment by Alexey Lapitsky [ 2015/12/17 ]|
Here's a PR with a fix and a benchmark: https://github.com/puppetlabs/puppetdb/pull/1789