Initial Graminized Server Response Latency Discrepency

10 views
Skip to first unread message

Sudip Maitra

unread,
Apr 20, 2023, 6:26:30 PM4/20/23
to us...@gramineproject.io
Hi,

I have deployed a server inside GSC and noticed a peculiarity. When the GSC image is first deployed the response time for a request is tens of milliseconds. However, the subsequent requests take much less time (tens of microseconds). I am assuming this might be due to caching but I don't know what is being cached so that the subsequent requests are served so quickly. Any idea why this might be happening? Thank you.

Best regards,
Sudip 

Michał Kowalczyk

unread,
Apr 20, 2023, 7:08:27 PM4/20/23
to Sudip Maitra, us...@gramineproject.io
Hi,

Probably enclave memory. We have an option to shift this cost to the enclave startup which may help you, see https://gramine.readthedocs.io/en/latest/manifest-syntax.html#pre-heating-enclave.

Best,
Michał
OpenPGP_signature

Sudip Maitra

unread,
Apr 24, 2023, 2:07:01 PM4/24/23
to Michał Kowalczyk, us...@gramineproject.io
Hello,

It is a simple pistache server (https://github.com/pistacheio/pistache.git). A curl request takes around 0.029 seconds for the first time and the subsequent tries only takes around 0.007 seconds (close to vanilla server response time). And the GSC image was built using the preheat option enabled. My guess is that the network driver and the necessary dependencies are loaded when the first request is received. Once those are in the cache, the subsequent requests are more readily served. Could this be the reason?

Best regards,
Sudip

Dmitrii Kuvaiskii

unread,
Apr 25, 2023, 2:22:33 AM4/25/23
to Sudip Maitra, Michał Kowalczyk, us...@gramineproject.io
> My guess is that the network driver and the necessary dependencies are loaded when the first request is received. Once those are in the cache, the subsequent requests are more readily served. Could this be the reason?

Most probably yes, this is the reason.
> --
> You received this message because you are subscribed to the Google Groups "Gramine Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to gramine-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/gramine-users/CAOcR%2Bfbjzv6K0t1XUW9eOt3%2Bgba05O%2BJ5dH1Ad48HgghY%3D%2Bz7A%40mail.gmail.com.



--
Yours sincerely,
Dmitrii Kuvaiskii
Reply all
Reply to author
Forward
0 new messages