[google-appengine] Re: Slow Cloud SQL access from GAE when compared to Cloud Run

2020-11-03 Thread 'Elliott (Cloud Platform Support)' via Google App Engine
Thank you for your response. Please let us know what happens.

On Friday, October 30, 2020 at 10:21:03 AM UTC-4 jonmiddl...@gmail.com 
wrote:

> Thanks for reply - likewise couldn't find any explanation. I'm going to 
> try Public IP today but from the docs it suggests Private IP should be 
> faster faster, but at least that would rule out any VPC issues that Cloud 
> Run doesn't suffer from.
> I'm really not keen to run that configuration in any production capacity 
> but it will be interesting to see the results.
>
> Nothing from logs of value - I logged the queries to ensure both APIs on 
> both endpoints returning the exact same query, and only have a single Cloud 
> SQL DB so they're both getting same row counts. I added OpenTelemetry to 
> the app and the pg plugin is showing slower times. I realized in my first 
> tests as I'm using an ORM the "query" time was pg time + rehydration so 
> wanted to eliminate the rehydration and any CPU bottlenecks being the 
> culprit. There may be a bit of that still at play and Cloud Run scaling 
> better but the times reported by *opentelemetry-plugin-pg* are double on 
> GAE compared to CloudRun.
> Nothing in the logs around dropping, and Cloud SQL load as I'm only in 
> testing is low (2% CPU, no spikes)
>
> On Friday, October 30, 2020 at 5:56:24 AM UTC+11 amit...@google.com wrote:
>
>> Hello,
>>
>> By going through the details you provided and relevant documentation for 
>> the settings [1,2], I believe the configuration for both are same. During 
>> my research, I am yet to find any reason to believe that App Engine takes 
>> more time for the connection. Just wondering, are you able to test it using 
>> the public IP? Did you find any connection drop from App Engine in the 
>> logs?
>>
>> [1] 
>> https://cloud.google.com/sql/docs/postgres/connect-app-engine-standard#configuring
>> [2] https://cloud.google.com/sql/docs/postgres/connect-run#configuring
>>
>> On Thursday, October 29, 2020 at 10:20:22 AM UTC-4 jonmiddl...@gmail.com 
>> wrote:
>>
>>> Is it expected that AppEngine Standard performs significantly slower 
>>> than Cloud Run when a connection to Cloud SQL (Postgres) is involved?
>>>
>>> Testing whether to move away from AWS and which GCP solution to move to 
>>> and have fired up instances of Cloud Run and AppEngine to test a NestJS API.
>>> Having added logging to isolate just the time taken to query the DB as 
>>> part of an API call, the same GET request that takes 400ms query time on 
>>> average in Cloud Run takes 2100ms in AppEngine.
>>> To clarify this is the same source, same build deployed to both and 
>>> these are the times once warm so I'm excluding the first few requests.
>>>
>>> For any code not talking to my Cloud SQL instance, i.e. a dummy 
>>> javascript method to chew up some CPU time, the performance is more or less 
>>> identical
>>>
>>> Cloud SQL, AppEngine and Cloud Run are all set up in the same region 
>>> (australia-southeast1), and connection from GAE and Cloud Run to Cloud SQL 
>>> is for both via Private IP and Serverless VPC.
>>>
>>> Since I'm in free tier whilst trialing my options, I tried chat support 
>>> and basically got down to (verbatim) "cloud run is design to handle data 
>>> from apis with cloud sql" while "app engine is recommended for webhosting".
>>>
>>> I'm assuming this is wrong and and a 3-5x slower query performance to 
>>> Cloud SQL from GAE isn't an expectation? Any pointers in terms of where 
>>> this may be failing?
>>> I haven't yet tried via Public IP and wasn't keen to but I will likely 
>>> repeat my tests on both to see if that makes any difference and post my 
>>> updates here.
>>>
>>>

-- 
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/fedb4411-c3c4-42c8-8f14-c8fa65a8fb32n%40googlegroups.com.


[google-appengine] Re: Question on Flex restriction

2020-11-03 Thread 'methkal' via Google App Engine





*Hi Jerry,No, App Engine Flex doesn't support the use of App Engine 
standard libraries. so you need to change a few places in your code to 
adapt your app for App Engine Flex. Please, refer to this full guide of 
migration[1][1]https://cloud.google.com/appengine/docs/flexible/java/migrating*
On Tuesday, November 3, 2020 at 1:17:28 AM UTC+1 jlin...@gmail.com wrote:

> Hi Support team
>
> I have a Springboot GAE application that currently is running in GAE 
> Standard environment. We plan to move it to GAE Flex enviornemt ( the 
> reason is not important for this question).
> This SpringBoot GAE application has dependency on appengine-api-1.0-sdk. 
> Could I ask you whether it is possible to move this app. to GAE Flex 
> without removing appengine-api-1.0-sdk from this application.
>
>
> thank you
>
>
> Jerry
>

-- 
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/e22bca79-16ea-43f0-935b-ee3d7fa5bffdn%40googlegroups.com.


[google-appengine] AppEngine max concurrent requests

2020-11-03 Thread Samu Lahti
How to change AppEngine standard max concurrent request for manual scaling?

Current appengine-web.xml:

**
*http://appengine.google.com/ns/1.0;>*
*...*
*java8*
*true*
**
*  1*
**
*B2*

*true*
*false*
*false*
**

What we have noticed is that manual scaling instances handle max 10 
concurrent requests and queues the rest of the concurrent requests if over 
10.

For appengine logs it is seen as the request comes in but when it enters to 
application code whenever there is an available request handler. 

For the request which is not queued, timestampd between the request 
entering the system and the first application code point is very near each 
other. 
*2020-11-03 09:34:36.247 EET GET 204 69 B 3.1 s Chrome 86 /valueflow/ping*
*2020-11-03 09:34:36.356 EET 
com.koivusolutions.shared.commons.logging.JavaLogger log: First filter:72 
(JavaLogger.java:17)*

For the request which is queued because of too much concurrency, timestamps 
between request entering the system and first application code point are 
far away from each other. 
*2020-11-03 09:34:36.247 EET GET 204 69 B 6 s Chrome 86 /valueflow/ping*
*2020-11-03 09:34:39.277 EET 
com.koivusolutions.shared.commons.logging.JavaLogger log: First filter:75 
(JavaLogger.java:17)   *


There is max-concurrent-requests setting but it is only for 
automatic-scaling. How to do the same for manual-scaling?

We tried to "emulate" manual-scaling by using with using automatic-scaling 
and settings min and max instances both as one like this:


80
.95
1
1

F2

It allows more concurrency but still, sometimes there is a very long 
queuing time even level of concurrency is not near max

*2020-11-03 09:54:58.553 EET GET 204 69 B 17.2 s Chrome 86 
/valueflow/ping?sleep=3*
*2020-11-03 09:55:12.742 EET 
com.koivusolutions.shared.commons.logging.JavaLogger log: First filter:83 
(JavaLogger.java:17) *


-- 
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/344e2714-2af3-497c-a017-d5d1e664e590n%40googlegroups.com.