简体   繁体   中英

too slow TTFB(latency) with go language in appengine

检查这个ttfb

I'm testing go lang in appengine. But it's too slow response. I've checked with chrome and found that the problem is 'Waiting(TTFB)'

The source code is very simple and official example( https://github.com/GoogleCloudPlatform/appengine-try-go ).

What's wrong? Is this normal?

Local test performance has nothing to do with production performance. There is nothing wrong with what you see.

Usually first requests are slower than subsequent ones as the AppEngine SDK performs file system scans, compiling and first-time loading and execution of package init() functions of your application's code.

What you see is a 1-second Waiting (TTFB) time, it stands for Time To First Byte ( source ):

Time spent waiting for the initial response, also known as the Time To First Byte. This time captures the latency of a round trip to the server in addition to the time spent waiting for the server to deliver the response.

This 1 second TTFB most likely includes all the tasks I listed above the SDK has to perform, which isn't so bad if you think about that.

Don't worry, production environment runs "pre-compiled" native binary code, none of these have to be performed and you will see most likely a response time (TTFB) around 20-30 ms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM