morph1904 / Tyger2

A Reverse Proxy Application
GNU General Public License v2.0
50 stars 11 forks source link

Round-robin? #33

Open Strider3000 opened 3 years ago

Strider3000 commented 3 years ago

I'd like two backend applications to share the same front-end address, with Tyger2 providing load balancing (or weighted round-robin, with application1 getting 30% of requests and application2 getting 70% of requests).

Is this type of scenario possible in the current version of Tyger2?

morph1904 commented 3 years ago

Caddy, the underlying server supports load balancing (including round robin), but the UI and the backend code to generate this config in the Caddyfile is not implemented in Tyger2. You may add the required config into the Caddyfile, however this is likely to be overwritten whenever you make any amendments in the Tyger2 UI. For example, changing which app an existing address proxies to, would trigger a re-write of the entire Caddyfile removing your custom config.

Strider3000 commented 3 years ago

Gotcha - I'll make this an enhancement request. Looking forward to the next version. BTW I keep trying other solutions and I keep coming back to Tyger2 - it's the only one that easily does subdomains (e.g. "host1.godaddypurchase.tld". Other solutions are insanely complex - nice job keeping it simple.

morph1904 commented 3 years ago

Thanks. Simple was the aim. I want to add more and more featureswhilst keeping things simple. The latest version will support DNS verification which has been troublesome in the past. It will also have an import export feature from Tyger2 or itself. I am trying to make logging much better too.

morph1904 commented 3 years ago

@Strider3000

I have been looking into this for the latest version of TygerCaddy, and I believe that I can implement a version of this. As the only persion who has expressed an interest in Load Balancing so far, can you advise if Round Robin is the only logical option for load balancing here?

Looking at the options available, I was thinking of offering the following:

first - choose first available upstream least_conn - choose upstream with fewest number of current requests random - randomly choose an upstream round_robin - iterate each upstream in turn

Can you offer your thoughts on this please?

Lee

Strider3000 commented 3 years ago

Hey @morph1904 , the four options you give there look fine. I will probably end up using least_conn. Very cool!

morph1904 commented 3 years ago

Awesome, thanks for the feedback @Strider3000. I will start work on this today, so hopefully will be ready for the new release.