GAE & GCSQL extremely slow - google-app-engine

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.

Related

Getting a 504 Gateway Error on Google App Engine (long runtime of Flask App)

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.

Google Cloud: misterious constant 0.033/s compute request APIs

I open a new project on Google Cloud, and I start a default Standard Env App Engine. I don't do anything else, and I start to get mysterious non-zero traffic to my project.
I specifically keep getting a alternating 0.033/s and 0.017/s request per seconds on the project. This is not specific to this project but to ALL my google cloud projects. Also I get 100% errors rate. I trying to investigate but I didn't even know where to start.
Where can I get more information on what this APIs requests are specifically? And why this happens?

Google Compute Engine keeps spawning instances, then deploy says no CPU's available

I'm just going through the node.js tutorials with a free trial account, and i'm stuck on the second one where you add a db. I add the mongodb deployment, shows up as a VM instances, fine. And my first deploy worked, but now that i'm trying to edit stuff, my deploy's keep failing.
The error i get is that I've exceeded my CPU quota. Watching the list of VM Instances under Compute Engine, i see it keeps spawning up instances, even though the app isn't being used. Guessing it just spins up 8 instances by default?
But then i guess the build system needs its own VM's, but the CPU capacity is used up, so none available to do subsequent builds?! I feel like i'm missing something...
Also, i see i can explicitly start VM's myself, so what process is creating them form me? And can i turn it off? or set a cap on number of instances it spawns?
Can i tell my project to only use 4
Also, the deploy takes forever, is that normal? Following the tutorials, so far I've only seen this command to deploy:
gcloud preview app deploy app.yaml --set-default
Is there another command that does an incremental deploy or something?
By using gcloud preview app deploy you're actually using Managed VMs which is an App Engine runtime which in turn runs Docker containers on Google Compute Engine, which it creates on its own. In other words, you're not using Google Compute Engine directly.
To get rid of extra VMs, you need to delete old app versions: navigate to Compute > App Engine > Versions and delete the versions you don't want.
See also this answer for more details and suggestions.

Can we scale Application on Google cloud compute without Google autoscaler?

I am trying to setup application on Google cloud compute. But I want to setup scaling script that would launch VM instances on google cloud based on some criteria. So Google provides autoscaler options for this, But is it possible to do that without autoscaler through Google APIs??
Also I would like to know procedure for creating image on google cloud compute. I have created one Instance group with instance template that launched one VM instance. But when I try to create image from new image option but it doesn't list disk of that instance.
For the first question, you can write your own auto scaler. Every google compute engine machine can be accessed through a remote api: https://cloud.google.com/compute/docs/reference/latest/
You can host your own auto scaler on App Engine with a cron checking the machine health and CPU every 1 minute for example.
Please write a new SO question for the second question.

EC2 , Openstack, Google App Engine (GAE) and REST

I was handed an assignment but I don't know where to start.
The aim is to have 2 piece of code running. One will run in Open stack private cloud and perform the task of indexing two sets of text, with another running in EC2 with the task of matching the two indexed tests.
I want to access them via google app engine.
Ideally, I would like to click a button or perform an action on Google app engine, which then sends a request to Openstack to run the code and retrieve the output of a txt file.
That outputted text files will then be forwarded onto EC2 where the matching will occur and the results sent back to Google App Engine.
My question is, how can I send the files between the systems using REST requests?
FrankN --
EC2, GAE and OpenStack are disparate cloud computing platforms. To integrate them might include, say, using one platform while saving backups to another.
CloudU.Rackspace.com is a vendor-neutral education site about cloud computing (note: It'll take six or so hours to finish it all). This might help.
Disclaimer: I work for Rackspace.
Firstly, not really sure what your requirements are, why your code does or why are you trying to mix cloud providers in that way.
That said, I would suggest taking the upload from GAE and push it to AWS S3 where you can then retrieve and use as you please from EC2.
Not sure what functionality you are trying to get out of OpenStack that is not present in AWS; however, I would suggest building whatever you are building in EC2 first, then duplicate in on OpenStack services to avoid future vendor lock in.

Resources