Significant performance degrade when updating aws lambda runtime from java 11 to java 17

0

Hi

I'm trying to update a java11 based lambda function to run java17, but I experience a doubled execution time for simple function that just reads a large object from S3.

I posted a lot more details on stackoverflow but have not yet gotten any responses, hence this crosspost.

Is anyone else experiencing similar performance degrades on java-17?

Best regards Jens

profile picture
jtm
asked a year ago754 views
2 Answers
0
Accepted Answer

The JVM configuration for tiered compilation was changed in the Java 17 managed runtime.

You could change it back to the previous configuration with a environment variable.

JAVA_TOOL_OPTIONS set to "-XX:-TieredCompilation"

You can read about the changes on the Java 17 AWS blog

profile pictureAWS
answered a year ago
  • JAVA_TOOL_OPTIONS should be set to -XX:-TieredCompilation for same tiered compilation setting as in java11

0

Hi, I would personally start by tracing garbage collection and compare between v17 and v11. There has been lots of changes in this area between the 2 versions. In my experience, some GC changes good for most use cases are (very) bad for some. You may be in this situation.

I am saying this because I have been in projects when some code had to be rewritten to fight adversarial GC activity (blocking) due to too much memory allocation / release in the Java classes for class and method variables. We had to minimize this activity to get back to correct performance. Form your Stackoverflow post, you seem to read / write several GBs of data. So lots of chances for similar big memory activity and GC.

So, to trace GC: https://aws.amazon.com/blogs/architecture/field-notes-monitoring-the-java-virtual-machine-garbage-collection-on-aws-lambda/

About the evolutions: https://blogs.oracle.com/javamagazine/post/java-garbage-collectors-evolution

Best,

Didier

profile pictureAWS
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions