You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/12/16 11:18:11 UTC

[GitHub] [trafficserver] martinezgarciadavid opened a new issue #8557: Dynamic origin server selection with API REST in ATS

martinezgarciadavid opened a new issue #8557:
URL: https://github.com/apache/trafficserver/issues/8557


   Dear all,
   
   First of all, excuse me if this is not the most appropriate place to ask about a feature, since what I would like to ask is not an issue related with the implementation of this software.
   
   We have a validation scenery consisting of a single origin server and an instance of Apache Traffic Server that listens for HTTP requests from a client and redirects those requests to the origin server. ATS works here as a reverse proxy without content caching, so every request from the client is sent to ATS, which always redirects it to the origin server. We've been using a single remap rule in the configuration of this scenery without any trouble so far. The infrastructure behind ATS is transparent for the client, and it is only aware of the existence of the proxy. 
   
   We are now extending this initial scenery with two additional origin servers, so that we have three origin servers and the ATS instance. The objective now is, for every client request, to randomly select an origin server and redirect these requests to it. For this purpose, it is a requirement that the origin server selection is done in an application developed by us. This application is aware of the presence of all origin servers and has their IP addresses. It exposes a REST API with a resource which, when called, randomly selects the origin server and returns the decision in a JSON object.
   We want ATS to contact this REST API when a client request is received and, based on the result, redirect the request to the selected origin server.
   
   We have been looking at the documentation related with plugin development and remap plugins, which apparently could give us the required tools to implement the desired functionality. However, I would like to ask you, please, if there is some functionality already built-in in ATS that we could use for this. If not, could we achieve to implement this functionality by coding a custom plugin?
   
   Thanks a lot.
   
   Kind regards.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] martinezgarciadavid edited a comment on issue #8557: Dynamic origin server selection with REST API in ATS

Posted by GitBox <gi...@apache.org>.
martinezgarciadavid edited a comment on issue #8557:
URL: https://github.com/apache/trafficserver/issues/8557#issuecomment-996706312


   Thanks for your help and tips. We are looking into building a plugin with Lua. If we are not successful, we will try using C.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] martinezgarciadavid commented on issue #8557: Dynamic origin server selection with REST API in ATS

Posted by GitBox <gi...@apache.org>.
martinezgarciadavid commented on issue #8557:
URL: https://github.com/apache/trafficserver/issues/8557#issuecomment-996706312


   Thanks for your help and tips. We are looking into building a plugin with Lua. If not, we will try using C.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] martinezgarciadavid closed issue #8557: Dynamic origin server selection with REST API in ATS

Posted by GitBox <gi...@apache.org>.
martinezgarciadavid closed issue #8557:
URL: https://github.com/apache/trafficserver/issues/8557


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficserver] mlibbey commented on issue #8557: Dynamic origin server selection with REST API in ATS

Posted by GitBox <gi...@apache.org>.
mlibbey commented on issue #8557:
URL: https://github.com/apache/trafficserver/issues/8557#issuecomment-996030060


   I don't think there is an opt of the box feature that does exactly this.
   
   - it might be possible to do a lua plugin script. Like fetch the api (ts.fetch?), parse the json, and then set the IP (like ts.server_request.server_addr.set_addr?)
   - I believe the concept would fit into a parent selection strategy plugin. https://docs.trafficserver.apache.org/admin-guide/files/strategies.yaml.en.html is for strategies, but, I'm struggling to find docs around that.
   - different track... either strategy.yaml/parent.config can do various selection strategies -- round robin; consistent hash; etc. Could imagine requirement tweaks to have the app periodically update one of those files as appropriate. (but, couldn't do that on a per-request basis)
   - or https://docs.trafficserver.apache.org/admin-guide/files/records.config.en.html#proxy-config-srv-enabled ... makes ATS us SRV records instead of A/AAAA, which then allows for weighted round robin across the records.
   - or have the app act as a small DNS server (instead of json). Have it set the record's ttl to 0 sec, and ATS's resolv.conf to use it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org