You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by 刘维 <le...@qq.com.INVALID> on 2022/11/21 03:53:38 UTC
回复:Change the default HTTP router from radixtree_uri to radixtree_host_uri
I totally agree with this.
------------------ 原始邮件 ------------------
发件人: "dev" <tokers@apache.org>;
发送时间: 2022年11月15日(星期二) 中午1:48
收件人: "dev"<dev@apisix.apache.org>;
主题: Change the default HTTP router from radixtree_uri to radixtree_host_uri
Hi, community,
I'd like to talk with you guys about changing the default HTTP router
from radixtree_uri to radixtree_host_uri.
Let me just explain the differences between them. The radixtree_uri
router matches API requests with the existing route tree by URI path,
While the radixtree_host_uri matches the HTTP host and then matches
the URI path.
So when Apache APISIX uses radixtree_uri as the default HTTP router,
there is a confusing scenario (even we can say it's a bug): Let's say
we have two routes, the first one requires the host matches
*.example.com, and the URI path is /anything, And the second one needs
the host matches foo.example.com exactly, and the URI path is also
/anything. In such a case, if we send an API request, we may hit the
first route, which is counterintuitive.
We also have a lot of voices from the community that users have been
in trouble since they think Apache APISIX will consider the HTTP host
match by default. However, it's not the case. So I'm here to propose
changing the default HTTP router to radixtree_host_uri.
I know this is a broken change, so we may have to do this in 3.x
releases and may not back it port to the 2.15 LTS version.
By the way, the radixtree_uri may have better performance than
radixtree_host_uri, so if we really change the default HTTP router, we
also need to give users a hint that: if they want better performance
or you are making a stress test, you may change the HTTP router back
to the radixtree_uri.
What's your idea?
Best regards
Chao Zhang
https://github.com/tokers
Re: Change the default HTTP router from radixtree_uri to radixtree_host_uri
Posted by Chao Zhang <to...@apache.org>.
Hi community,
Thanks for your discussion. I already created an issue
https://github.com/apache/apisix/issues/8354 to track this. Let's see
if someone is interested in this.
Best regards
Chao Zhang
https://github.com/tokers
On Mon, Nov 21, 2022 at 11:53 AM 刘维 <le...@qq.com.invalid> wrote:
>
> I totally agree with this.
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "dev" <tokers@apache.org>;
> 发送时间: 2022年11月15日(星期二) 中午1:48
> 收件人: "dev"<dev@apisix.apache.org>;
>
> 主题: Change the default HTTP router from radixtree_uri to radixtree_host_uri
>
>
>
> Hi, community,
>
> I'd like to talk with you guys about changing the default HTTP router
> from radixtree_uri to radixtree_host_uri.
>
> Let me just explain the differences between them. The radixtree_uri
> router matches API requests with the existing route tree by URI path,
> While the radixtree_host_uri matches the HTTP host and then matches
> the URI path.
>
> So when Apache APISIX uses radixtree_uri as the default HTTP router,
> there is a confusing scenario (even we can say it's a bug): Let's say
> we have two routes, the first one requires the host matches
> *.example.com, and the URI path is /anything, And the second one needs
> the host matches foo.example.com exactly, and the URI path is also
> /anything. In such a case, if we send an API request, we may hit the
> first route, which is counterintuitive.
>
> We also have a lot of voices from the community that users have been
> in trouble since they think Apache APISIX will consider the HTTP host
> match by default. However, it's not the case. So I'm here to propose
> changing the default HTTP router to radixtree_host_uri.
>
> I know this is a broken change, so we may have to do this in 3.x
> releases and may not back it port to the 2.15 LTS version.
>
> By the way, the radixtree_uri may have better performance than
> radixtree_host_uri, so if we really change the default HTTP router, we
> also need to give users a hint that: if they want better performance
> or you are making a stress test, you may change the HTTP router back
> to the radixtree_uri.
>
> What's your idea?
>
> Best regards
> Chao Zhang
>
> https://github.com/tokers