Reputation: 79
Is it possible to group certain requests togeather based on their url ensuring that similar requests go to the same instance?
E.g. There are multiple instances for my app engine
myurl.com?foo=abc // Multiple people putting in this url will all go to the same instance
myurl.com // I don't care which one this goes
Upvotes: 0
Views: 59
Reputation: 11360
I don't think you can control which instance
handles a url pattern.
If you want to send certain urls to a certain service
, what you want is a dispatch.yaml
, which does exactly that. You can use regex to tailor how you want. With some strategy, you could match urls with (groups of) instances, though they would be in separate services. If your site doesn't get a lot of traffic, you could essentially have one instance per service, and accomplish what you want.
dispatch:
# don't forget: gcloud app deploy dispatch.yaml after changes !!!
- url: "*/some/high/memory/urls/*"
service: my_high_memory_service
- url: "*/some/fast/cpu/url"
service: my_fast_cpu_service
- url: "*/.*"
service: default
More at: https://cloud.google.com/appengine/docs/standard/python/reference/dispatch-yaml
Upvotes: 1