[google-appengine] Re: next.js app taking 15-25 seconds to load from “cold” on google app engine

2020-04-23 Thread 'Katayoon (Cloud Platform Support)' via Google App Engine
As explained in the Instance life cycle 
,
 the 
instance must first load any libraries and resources required to handle the 
request. However, we (support team) are not aware of the internal commands 
that being used to load the libraries and resources internally.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/ad8ffdf3-e817-4510-aebe-bb5d7c97fa21%40googlegroups.com.


Re: [google-appengine] Re: next.js app taking 15-25 seconds to load from “cold” on google app engine

2020-04-22 Thread Blaine Garrett
I am fairly certain that it does NOT install/build on warmup. In fact, I
skip deploying my pages and src folder via .gcloudignore






On Wed, Apr 22, 2020 at 7:12 AM 'Alex Fox' via Google App Engine <
google-appengine@googlegroups.com> wrote:

> Yes.
>
> I have implemented the warm up requests which has improved the performance
> greatly.
>
> So I understand, when a new instance is created what commands are run?
> Does it have to do a npm install and copy over resources, or is there more?
>
> Thanks!
>
>
> On Tuesday, April 21, 2020 at 7:12:24 PM UTC+1, Katayoon (Cloud Platform
> Support) wrote:
>>
>> Hello,
>>
>> I would like to add that whenever you send a start request
>> 
>> an instance is brought into existence and is initialized. So it needs some
>> time to load the required libraries and resources to handle the request.
>>
>> You may consider using warmup requests
>> 
>> to load application code into an instance ahead of time. As explained in this
>> document
>> ,
>> warmup requests reduce request and response latency during the time when
>> your app's code is being loaded to a newly created instance. You can
>> provision min_idle_instances
>> 
>> afterward so that a number of instances be kept running and ready to serve
>> traffic without lag.
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-appengine/Hd0z0nnBxLA/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> google-appengine+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/36492fc1-3a01-4db2-a199-77cda7e7e3ea%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CAH4s%3DymK7ingdS3tKzgxnoys6i3xuWQ5x3iyvoK46ewhqqzOpA%40mail.gmail.com.


[google-appengine] Re: next.js app taking 15-25 seconds to load from “cold” on google app engine

2020-04-22 Thread 'Alex Fox' via Google App Engine
Yes.

I have implemented the warm up requests which has improved the performance 
greatly. 

So I understand, when a new instance is created what commands are run? Does 
it have to do a npm install and copy over resources, or is there more?

Thanks!


On Tuesday, April 21, 2020 at 7:12:24 PM UTC+1, Katayoon (Cloud Platform 
Support) wrote:
>
> Hello,
>
> I would like to add that whenever you send a start request 
> 
>  
> an instance is brought into existence and is initialized. So it needs some 
> time to load the required libraries and resources to handle the request.
>
> You may consider using warmup requests 
> 
>  
> to load application code into an instance ahead of time. As explained in this 
> document 
> ,
>  
> warmup requests reduce request and response latency during the time when 
> your app's code is being loaded to a newly created instance. You can 
> provision min_idle_instances 
> 
>  
> afterward so that a number of instances be kept running and ready to serve 
> traffic without lag.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/36492fc1-3a01-4db2-a199-77cda7e7e3ea%40googlegroups.com.


[google-appengine] Re: next.js app taking 15-25 seconds to load from “cold” on google app engine

2020-04-21 Thread 'Katayoon (Cloud Platform Support)' via Google App Engine
Hello,

I would like to add that whenever you send a start request 

 
an instance is brought into existence and is initialized. So it needs some 
time to load the required libraries and resources to handle the request.

You may consider using warmup requests 

 
to load application code into an instance ahead of time. As explained in this 
document 
,
 
warmup requests reduce request and response latency during the time when 
your app's code is being loaded to a newly created instance. You can 
provision min_idle_instances 

 
afterward so that a number of instances be kept running and ready to serve 
traffic without lag.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/feef67d8-e5cd-4a7d-a9de-5a26e4e0cc68%40googlegroups.com.


[google-appengine] Re: next.js app taking 15-25 seconds to load from “cold” on google app engine

2020-04-21 Thread 'Alex Fox' via Google App Engine
So I managed to improved the load times by enabling "serverless" in the 
next.js settings. This is enabled by default when deploying to ziet. I also 
added the /_ah/start warmup which essentially just keeps the instance alive.

All getInitialProps are just returning some basic context and I'm using GAE 
standard with the default server size.

Still a bit baffled but it seems to be working ok now.


On Monday, April 20, 2020 at 9:38:06 PM UTC+1, Blaine Garrett wrote:
>
> That seems a bit odd.  I have a next.js app on Standard and goes from cold 
> start to content paint  in approx 5 seconds with data fetching on the 
> server.
>
>
> What instance type and size are you using?
> Does your getInitialProps make any REST calls, access a database, etc? If 
> so, are those cold starting as well?
> If you are using scaling that leverages /_ah/start handler, is it 
> accidentally doing REST Calls, etc etc?
> Do you use a custom server that might be doing something odd?
>
>
>
>
>
>
> On Monday, April 20, 2020 at 7:25:37 AM UTC-5, Alex Fox wrote:
>>
>>
>> I am deploying a next.js app to a Google App Engine (standard) but I am 
>> having trouble with cold start times.
>>
>>
>> I am building locally then deploying the .next folder to GAE. On the 
>> first boot it takes 15-25 seconds to boot up. Looking at the logs I can see 
>> a log for a very long GET 200 request but there's not really any 
>> information about what is going on. 
>>
>>
>> See image below:
>>
>>
>> [image: Screenshot 2020-04-18 at 17.13.29.png]
>>
>>
>>
>> When I run yarn start locally it boots up in < 1, which as far as I 
>> understand is running the same production build? It is almost as though GAE 
>> is doing a build before it eventually deploys..
>>
>>
>> Any pointers would be immensely appreciated!
>>
>>
>> Alex
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/88e53613-13ae-4ddd-9d84-28ef6c8096c6%40googlegroups.com.


[google-appengine] Re: next.js app taking 15-25 seconds to load from “cold” on google app engine

2020-04-20 Thread Blaine Garrett
That seems a bit odd.  I have a next.js app on Standard and goes from cold 
start to content paint  in approx 5 seconds with data fetching on the 
server.


What instance type and size are you using?
Does your getInitialProps make any REST calls, access a database, etc? If 
so, are those cold starting as well?
If you are using scaling that leverages /_ah/start handler, is it 
accidentally doing REST Calls, etc etc?
Do you use a custom server that might be doing something odd?






On Monday, April 20, 2020 at 7:25:37 AM UTC-5, Alex Fox wrote:
>
>
> I am deploying a next.js app to a Google App Engine (standard) but I am 
> having trouble with cold start times.
>
>
> I am building locally then deploying the .next folder to GAE. On the 
> first boot it takes 15-25 seconds to boot up. Looking at the logs I can see 
> a log for a very long GET 200 request but there's not really any 
> information about what is going on. 
>
>
> See image below:
>
>
> [image: Screenshot 2020-04-18 at 17.13.29.png]
>
>
>
> When I run yarn start locally it boots up in < 1, which as far as I 
> understand is running the same production build? It is almost as though GAE 
> is doing a build before it eventually deploys..
>
>
> Any pointers would be immensely appreciated!
>
>
> Alex
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/c0866479-553f-43da-9a12-3d71946fa130%40googlegroups.com.