Critical Performance issue with 2.1.1


#1

Hi,

We have profiled our Tomcat server because we were facing performance issues when querying a ViewQuery which emits a JsonArray with a long inside. It happened that when emitting a long value (timestamp) as part of an array key, the couchbase java client spends a lot of time throwing JsonParseException when trying to read an int, catching them and reading a long value instead.

The profiler has shown that this consumes 70% of our cpu time in JacksonTransformers$AbstractJsonValueDeserializer.decodeObject(), line 65:

case VALUE_NUMBER_INT:
try {
  target.put(field, parser.getValueAsInt());
} catch (final JsonParseException e) {
  target.put(field, parser.getValueAsLong());
}

You can reproduce by emitting any JsonArray with a long as part of a view key.


#2

Hi @vanadium,

thanks much for reporting that. I’ve created a JIRA task to track it: https://issues.couchbase.com/browse/JCBC-729.

Maybe jackson provides us better facilities to handle that case. I’ll try to tackle it soon so we can get it into the next bugfix release. Are you good with following the JCBC ticket?


#3

Thanks, it’s perfectly fine for me to follow the issue on your tracker. :slight_smile:

As a work around, we are going to switch to relative timestamp which should not overflow integer value at the moment. As soon as the fix is available, we will upgrade the Java client.


#4

We’re collecting some JMH perf numbers to be sure, but it’s looking good for a 2.1.2: http://review.couchbase.org/#/c/48165/


#5

Great, 3x faster! Well done. Can’t wait to get the 2.1.2 running on our servers.


#6

2.1.2 is planned for 7th April (we do releases every first tuesday of the month) until something critical comes up, so you can plan ahead.


#7

Hi,

we’ve published a developer preview of 2.1.2 to get quicker feedback if the bug is properly fixed and your issues are addressed. You can get it from our couchbase repository like all pre-releases, the 2.1.2 GA release will be published to maven central as usual.

You can get it like this:

<dependencies>
    <dependency>
        <groupId>com.couchbase.client</groupId>
        <artifactId>java-client</artifactId>
        <version>2.1.2-dp</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>couchbase</id>
        <name>couchbase repo</name>
        <url>http://files.couchbase.com/maven2</url>
        <snapshots><enabled>false</enabled></snapshots>
    </repository>
</repositories>

Keep in mind that this is not an officially tested release since it has not gone trough extensive QE testing yet. Please let us know if it works and upgrade to 2.1.2 as soon as it is released.

Thanks!


#8

Thanks!

I’m quite busy at the moment with others tasks, i may not have chance to give you a feedback on this issue until the public 2.1.2 release. Anyway, thanks for being so “reactive”!


#9

No problem at all, the developer preview has been released since some other issues were also reported and we can get quick feedback from the reporters.