Open sc-mickael opened 1 year ago
Two seconds is a long time, that is odd. The first request is always slower as java warms up, but two seconds may suggest some issue.
context.triggerEvent(RequestEvent.Type.RESOURCE_METHOD_START)
should not take any time, unless you have the ServerProperties.MONITORING_ENABLED
set to true.
Some profiling tools would be needed to test in your environment to see what happens. For start, JFR could help (for instance java -XX:+FlightRecorder -XX:StartFlightRecording=delay=0s,duration=3s,name=myrecording,filename=myrecording.jfr,settings=profile --enable-preview
).
This looks similar to #5281
Thanks for sharing. I will try.
@sc-mickael Could you please share your result? :-)
Java : 8 Jersey : 2.35 Spring : 5.1.5.RELEASE com.google.appengine.tools : 0.8.2
On my production server, first call of my REST API took a while. After a lot of research, it seems that something happen in Jersey at ResourceMethodInvoker class.
The ResourceMethodInvoker class in method invoke calls
context.triggerEvent(RequestEvent.Type.RESOURCE_METHOD_START);
thenthis.dispatcher.dispatch(resource, context.request());
and finally, callsAbstractJavaResourceMethodDispatcher.invoke()
which createinvokeMethodAction
For some reason, the first call in production can take 2 secondes between the
triggerEvent
andinvokeMethodAction
In logs, i seeRESOURCE_METHOD_START
, but only 2 secondes after, i really enter in my Controller.The second call is faster and took only some ms.
What happen ? Is it normal ?
Any idea ?
Thanks.