0

I have multiple small to medium sized projects all hosted under my current Rackspace server at apps.foo.com. I would like to move these to an Google App Engine Instance & though I have managed to move a few over, I tend to keep hitting the 10,000 file limit.

Hence I've decided to go with 2 separate App Engine instances though I would like the same domain name to point to them with a setup like apps.foo.com/m1 and apps.foo.com/m2, How can I do this?

I've already migrated the domain name to one instance though I can't figure out how to add another. Please help!

echorashmi
  • 81
  • 1
  • 5
  • 1
    how many static files do you have btw? if it's significant part of 10k, you can move them to Cloud Storage, it's not necessary to host static files with main gae app – Igor Artamonov Oct 25 '15 at 07:56

2 Answers2

1

You can't map the same domain to 2 different GAE apps - GAE wouldn't know to which one of the 2 apps hypothetically mapped to the same domain to route an incoming request for the domain.

The request path following the domain is not part of the domain, it is only parsed (following the destination app's parsing rules) after GAE has already selected the destination app based on the request domain.

You might be interested in my recent reply to this Q&A related to reaching deployment quota: Getting error on GAE: Max number of files and blobs is 10000

Community
  • 1
  • 1
Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • Thanks Dan, we are considering purchasing the paid support options. As of now, all my projects are hosted as one module each eg: apps.foo.com/module1 is one project, and apps.foo.com/module2 is another project. It appears that 10,000 file limit is overall and not per version per module only. Furthermore, when I do a count of files my directory on local shows me 6000 something files, I'm not sure why this would hit the 10,000 limit even. Does Google Cloud DNS offer this option of splitting a Domain name across 2 Apps? or across 1 App Engine & 1 Compute Engine? – echorashmi Oct 25 '15 at 05:33
  • You can convert them to separate modules of a single app, which you can then map to a single domain. See https://cloud.google.com/appengine/docs/python/modules/ (similar docs are available for the other languages as well) – Dan Cornilescu Oct 25 '15 at 05:41
  • Nope: same problem - how to decide which app or compute engine to send the request to if both have the same domain? It'd be like 2 different servers having the same IP address. – Dan Cornilescu Oct 25 '15 at 05:45
  • Using something like this: (Content Based Load Balancing?) https://cloud.google.com/compute/docs/load-balancing/http/content-based-example – echorashmi Oct 25 '15 at 05:54
  • And yes, each project is its own module already, still seem to hit limits of 10k files. – echorashmi Oct 25 '15 at 05:54
  • That load balancer is for Compute Engine, I'm not aware of such solution for App Engine. – Dan Cornilescu Oct 25 '15 at 06:05
  • 1
    also i believe its again the TOS to use multiple apengines like that (otherwise you could have unlimited free quotas) – Zig Mandel Oct 25 '15 at 21:36
0

You can use dispatch to reroute requests to the relevant service.

  1. Deploy your API & WebApp to the same project but as separate services (using the service attribute in the app.yaml file).

  2. Deploy the dispatch

dispatch.yaml

  - url: "project-name.appspot.com/api/*"
    service: api-service

  - url: "project-name.appspot.com/*"
    service: web-client-service
  1. For my WebApp's index.html I added also:

<base href="https://project-name.appspot.com/">

Hallel
  • 300
  • 2
  • 7