Is it possible to route to process groups based on domain name?

I want to have several process groups for different aspects of our application, to have more control over where load goes to.

E.g. I want all dashboard.example.com to go to one of the VMs with process group = ‘dashboard’ and all customer traffic (e.g. example.com) to go to the VMs with process group = ‘customer-portal’.

I was hoping something like this would be possible:

[[services]]
  processes = ['dashboard']
  domain_name = 'dashboard.example.com'

[[services]
   processes = ['customer-portal']
   domain_name = 'example.com'

I can think of some ways to solve this using Replay headers, but ideally I would solve this at the layer before our own apps.

I like that idea, altho it has ramifications around making certs for custom domains and waiting on DNS entries, etc.

What’s the primary use case here? It seems like it might be running the same code base but on different domains? Do you define separate commands on each process group?

Sure, to make it a bit more concrete. We have two actors:

  • People on admins uploading a bunch of images. These images need to be resized to multiple different sizes. This takes a decent amount of CPU.
  • On the other side there’s customers viewing webpages. These customers come in huge peaks.

For the second group we do a lot of load testing because we want to make sure we can deal with the peak loads. Not having to account for group #1 makes load testing significantly easier. E.g. we don’t have to account for an admin uploading 100 images.

It seems like it might be running the same code base but on different domains?

Yes, although I can also imagine cases where we might want to disable certain endpoints on one process group vs the other. But in the basic version we just want to split traffic. One actor group uses certain group of VMs, the other actors group uses the other group of VMs.

The simple solution here btw is to just have two different apps, which is acceptable, but I was hoping we could make this a bit simpler :slight_smile: It’s a bit annoying to deal with 2 apps, with secrets etc.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.