I followed the tutorial in the Google Cloud Platform console for creating a new App Engine with .NET as the "language", and by the last steps published the Hello World program at the public endpoint at
https://myproject.appspot.com
However when testing this in my browser, I consistently get response times of upwards of 400 ms.
Testing a simple .NET app on a Linode yields about 100 ms latency.
Do I need to manually configure the app to be able to have a more normal response time? It doesn't seem to be the highly performant, scalable solution it says it is, if just a simple Hello World has about 0,5 seconds of latency...
It could be that you and your GAE app are in different locations. There is a 600ms difference between two requests to my app: one from San Francisco, the other from Amsterdam.
Related
I have been working with Google Cloud Platform & Flask for the first time - my client wanted me to deliver a solution on it in 2 weeks.
I have been successful so far in creating a Flask application and wanted to productionize it through Google App Engine. However, the runtime of my function is a little over 2.5 minutes and I get a "504 Gateway Timeout" error. In the code piece, I am accessing bigQuery, google spreadsheets and GCS buckets. Should I switch to a new GCP service or can some tweaks in my code/yaml file suffice? My yaml config is -
runtime: python37
liveness_check:
check_interval_sec: 300
timeout_sec: 299
failure_threshold: 10
success_threshold: 10
initial_delay_sec: 500
readiness_check:
app_start_timeout_sec: 1800
I would be very, very grateful to anyone who can help me resolve this issue.
Thank you!
Edit: Just to give a brief about the application - this is a forecasting application that reads data from bigquery, GCS buckets, and Google Spreadsheets, processes it and runs ML models on it. The results are written back to Google Spreadsheets within the application itself (i.e. no response needed from the application per see). I'm triggering the application using google AppsScript.
The best option is to restructure how your website works. You can then stick with GAE standard. Even if you switch to GAE flexible, it will work better this way.
Here is the sequence of operations:
A user submits a request from web page.
Your website returns immediately with a page that indicates that you are working on it.
The page you return includes Javascript that will poll your website to ask if the task is complete.
When the task is complete, the Javascript will update the page and present the results to the user.
On the server side, you can use cloud tasks for doing the processing which I believe has a time limit of 10 minutes.
This way, the user is always viewing a web page and isn't sitting there waiting and looking at a blank screen while waiting for the server to return something.
I'm new to Google Cloud. I followed this tutorial to create a simple API with Google Cloud Endpoints and App Engine, using Cloud Endpoints Frameworks for Java 8:
https://cloud.google.com/endpoints/docs/frameworks/java/get-started-frameworks-java
The tutorial was easy enough to follow, but I'm not happy with the performance of my API. The latency for a simple request is consistently between 1 and 2 seconds, which seems unacceptable for production use. I'm not taking into consideration the first request, as that takes over 10 seconds when my App Engine instance is not loaded.
The URL I'm testing is "_ah/api/echo/v1/echo", which code wise is super simple.
Am I missing something? Is this expected behavior latency wise?
Edit: That behaviour was with a Sao Paulo instance. I now changed to a us-central and a us-east1 instance, and Endpoints is still under performing. I've been doing some other tests though.
When I deploy my API directly to App Engine, without using Endpoints, I get consistent 300ms times from Argentina. When I deploy it with Endpoints, I get times that fluctuate between 500ms to 1.5 seconds. It's not stable at all, and it's bad all around. However, when I test the same thing from within the US, I get times around 50ms for either case. Endpoints don't seem to be a problem there.
Any ideas why I could be having these issues with Endpoints from Argentina?
I followed this guide: Quickstart for Python. After launching the "hello, world" app to app engine (flex) I went to [project].appspot.com and noticed that it is very slow. I tried testing it in different devices and network conditions and I still have the same issue. I went to Cloud Trace and can't build a report due to a lack of traces. It is also slow in both http and https. I deployed to us-central and I am in Texas.
I have attached some logs from Logging and a snippet from Google Chrome's Dev Tools to show the slowness.
Logs from Logging:
Chrome Dev Tools:
The images don’t show anything especially unexpected. Response time will vary depending on the location of the client and its distance to the region of the App Engine Flex instance. Responses that take an especially long time are likely due to a cold boot.
You probably use a free instance of app engine. Because it's free the lifespan is very short, therefor it shuts down after a short amount of time without requests. When you send a new request after some time, the instance has to set up and then process the request, which takes time. You can keep pinging the app to keep the instance alive. Similiar question is anwered here.
I am running the phpMyAdmin app on my Google App Engine project.
My SQL properties:
Here is the Google App Engine instance summary:
This might be of relevance?
I am at a complete loss, why it takes 5 seconds to get the page loaded on average. Is GAE even a feasible option for someone trying to run a website. I know I'm using the shared CPU but I am the only one currently (trying to) using it.
This question is cross-posted on bitcoin.stackexchange, stackoverflow and bitcointalks.
I'm planning to build an application on Google App Engine that will heavily make use of Bitcoin trading. I've been Googling along a little but I couldn't find whether it is possible to run Bitcoin itself on App Engine (with Java). I have some experience with App Engine, but limited to a pure web-app centered usage.
I've read about a few people that have made applications using Bitcoin with App Engine as well that are hosting Bitcoin separately on an Amazon EC2 instance.
So, does anyone here either has experience with running Bitcoin in App Engine for Java or would anyone have an idea how this could possibly be done?
I know there are a lot of Bitcoin applications out there, I'd like to know how these manage their Bitcoin traffic.
I'm trying to avoid needing a separate Amazon service running all the time next to App Engine.
In fact, receiving Bitcoin can easily be done by using passive APIs like blockexplorer or blockchain, so I'm considering to find a reliable API to handle my outgoing payments. But this approach causes extreme dependency on this API service, which I actually want to avoid as much as possible.
I think you summed up the possiblities already.
depend on an external service providing notifications for
transactions and sending them i would advise against this.
have a second server running permanently and connect to it using json-rpc
running any type of p2p node on app engine will fail, because of the threading limitations on GAE.
a third possibility would be to use a stratum/electrum supernode, that way you are dependant on a 3rd party service, but at least it is well documented and you can set up one yourself easily. AFAIK, stratum is based on http.
source: i programmed a GAE app dealing with bitcoins about 6 monts ago. (using the second server approach)