We are trying to build a fault tolerant architecture. The objective is to switchover to solution on another zone in case of failure. The following is the situation
Our solution is build over Google AppEngine using Java. We use datastore as db.
Currently it is deployed on a X zone of AppEngine.
We have now replicated the same environment on a different region.
When a failover occurrs we would like to forward the request to the replicated zone.
How to achieve it? It seems their is options for Compute Engine but our solution is using AppEngine where instance are managed by the Google Cloud.
If you have a custom domain you can deploy your failover to www2.example.com and just forward the request with a DNS server if your main app is completely down, or let the main app redirect to the failover if the main app itself finds it is failing.
Related
I have a golang gorilla websocket server hosted on Google App Engine (GAE) that randomly disconnects connected clients after about an hour of being connected (without any activity).
I checked GAE logs and compared timestamps of close events (code 1006) and noticed that the time differences between opening and closing connections are all nearly the same (~60.1 minutes).
Is there a proper way to fix this issue (example: update associated nginx config) for Google App Engine?
I'm fairly certain that this an issue with GAE as I'm unable to reproduce this issue locally/in-development.
I couldn't find any other good ways of hosting an autoscaled/managed server that supports the websocket protocol.
My alternative hosting choice may be kubernetes, but the costs are much higher than GAE AFAIK and K8s is slightly more difficult to manage.
I found a few related stackoverflow links with no proper solutions (mostly migrations to other services or hacks)
example: GAE App Engine Websocket clients are disconnected after 1 hour
It's well documented on GCP docs :
WebSockets are always available to your application without any additional setup. Once a WebSockets connection is established, it will time out after one hour.
I wouldn't suggest creating a Websocket server on a serverless platform because these products tend to scale down over time when there's no requests on it so you cannot guarantee that it will continue holding the connection (also along with the hard limit mentioned).
You can host your Websocket server on Compute Engine. In fact, GAE Flex uses Compute Engine autoscaler. Here's a link if you're interested to see how it works.
I am using Google cloud to run some services. speifically, I have code running in firebase, as well as Cloud Run and Cloud SQL.
For some reason, however, I am seeing constant traffic to a compute engine API, which I have no idea why? I don't have any VM's setup (outside of what Cloud SQL is running), but I'm assuming that's a separate service.
Why would I be seeing this traffic against this API? I could "disable" it, but the warning says any resources created with it could soon be deleted and I don't want to bring down my Cloud SQL or Cloud Run instances. There's nothing I can taht would generate 418,000+ requests this month....unless this is just internal Google stuff to support my cloud SQL and Cloud run instances?
Any ideas what this could be? Should it be safe to disable this?
You will see traffic on the Compute Engine API because you are actually using the service.
CE API is not just related for GCE instances, it handles much more of that, for example: Disk, Firewall, Snapshots etc.
You can find more information about the CE API here
So I recommend not disable the CE API because it can cause errors and other problems.
Question:
Is there a way to Specify Zone for Google Cloud App Engine Flexible Environment to reside in? If not, what are the alternatives?
Context:
I'm having a setup where I use App Engine to write and reads to Bigtable. However I noticed a performance decrease, and during the debugging, I found a documentation from Google stating:
There are issues with the network connection. Network issues can reduce throughput and cause reads and writes to take longer than usual. In particular, you'll see issues if your clients are not running in the same zone as your Cloud Bigtable cluster.
In my case, my client is in a different region, by moving it to the same region had a huge increase in performance. However the performance issue still exist, and the recommendation from the documentation is to put client in the same zone as Bigtable.
I also considered using Container engine or Compute Engine where it is easier to specify the zone, but I want stay with App Engine for its autoscale functionality and managed services.
App Engine is a regional service:
App Engine is regional, which means the infrastructure that runs your
apps is located in a specific region and is managed by Google to be
redundantly available across all the zones within that region.
Taken from here.
You could indeed use GKE or GCE, while you're correct that these are not managed services like App Engine is, they do both support autoscaling.
I'm need to use XG (Cross group) transactions across some of my entity groups in Google App Engine. Unfortunately when I run any of these operations on my local Jetty (Eclipse) server, the App Engine development wrapper throws a "java.lang.IllegalArgumentException: transactions on multiple entity groups only allowed in High Replication applications".
This is extremely frustrating, as the exact same XG transactions run absolutely fine once my application is deployed on the live GAE servers. Does this mean I'll have to deploy my application any time I want to test my application now that I have XG transactions incorporated? Any help is greatly appreciated.
P.S. I'm using the low-level data store API because the original JDO layer I employed did not give me the loading detail granularity I needed, in case that makes a difference.
It is a bug in the 1.5.5 SDK. Description and workaround are here: https://groups.google.com/forum/#!topic/google-appengine-java/iKLgAzFIU_s
I'm wondering if anyone knows any script in Python or Java to setup Google App Engine as Load Balancer server?
I choose GAE, because of 100% uptime and free, so it would be the best to setup as Load balancer.
So what I want to do is set up a GAE app (a load balancer application) in "www.domain.com" - using Google Apps, it will share the load to all my servers (with round-robin, or any technique), but when all servers are down, show maintenance page which is host in GAE.
Is this possible?
You could do it, but you'd
incur extra latency by requiring an extra hop from google app engine to your servers
have all your servers public to the web, since otherwise google app engine won't be able to redirect to them Edit: apparently this is incorrect. See Nick Johnson's comment below!
have to implement something in google app engine to keep track of what servers you have up and how and when to route to them
Seems like it might not be worth it, but it'd be cool if you did it and posted some numbers about how it works!