You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "dayongi (via GitHub)" <gi...@apache.org> on 2024/08/13 00:23:11 UTC

[I] help request: Using the radixtree.new() method in a similar way has a performance difference of ten times [apisix]

dayongi opened a new issue, #11496:
URL: https://github.com/apache/apisix/issues/11496

   ### Description
   
   
   I added a custom logic to the `_M.match` method in `radixtree_host_uri.lua` in APISIX to simulate how long it takes to build a radix tree with 1000 routes. At the same time, I used Python to call the Admin API of APISIX and added 1000 routes. When I executed `curl -X GET http://localhost:9080/foo`, I was surprised to find that with the same number of routes, when using a similar method to call `radixtree.new` to build a radixtree, the performance difference between the two was as much as ten times. Why is this?
   
   * Use python to call  the Admin API of APISIX and added routes.
   ![image](https://github.com/user-attachments/assets/4d8a926a-6a49-4a99-8108-c148a5840fda)
   
   * Added custom logic of `radixtree_host_uri.match()`
   ![image](https://github.com/user-attachments/assets/53e3cb6b-d3dc-4a08-9abc-19ed41fa4fbc)
   
   * Test
   ![企业微信截图_0c63daae-f47d-45fc-9fb0-7e3eb138bf61](https://github.com/user-attachments/assets/3da0db6e-c602-4264-b8b0-c0d082fff6fc)
   ![企业微信截图_67025e58-4cc7-4161-9b33-0438af73d216](https://github.com/user-attachments/assets/448e8e83-cbad-44cb-9bb4-550d2717f541)
   
   
   ### Environment
   
   - APISIX version (run `apisix version`):  3.9.1
   - Operating system (run `uname -a`): Linux localhost.localdomain 5.14.0-427.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Feb 23 04:45:07 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): nginx version: openresty/1.25.3.2
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): {"etcd_version":"3.4.0","boot_time":1723460812,"hostname":"","id":"ba56a241-98c4-433a-b1c9-ddcead159944","version":"3.9.1"}
   - APISIX Dashboard version, if relevant:  No
   - Plugin runner version, for issues related to plugin runners: Not used
   - LuaRocks version, for installation issues (run `luarocks --version`): /usr/bin/luarocks 3.9.2
   


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

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


Re: [I] help request: Using the radixtree.new() method in a similar way has a performance difference of ten times [apisix]

Posted by "zhoujiexiong (via GitHub)" <gi...@apache.org>.
zhoujiexiong commented on issue #11496:
URL: https://github.com/apache/apisix/issues/11496#issuecomment-2285405318

   Hi @dayongi 
   
   There is a similar closed issue that might be relevant to your problem: [radixtree.new cost nearly 120s when uri_routes num is 10w](https://github.com/apache/apisix/issues/9320). This issue discusses performance concerns related to the radixtree.new method when handling a large number of routes [[1]](https://github.com/apache/apisix/issues/9320).


-- 
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: notifications-unsubscribe@apisix.apache.org

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


Re: [I] help request: Using the radixtree.new() method in a similar way has a performance difference of ten times [apisix]

Posted by "dayongi (via GitHub)" <gi...@apache.org>.
dayongi commented on issue #11496:
URL: https://github.com/apache/apisix/issues/11496#issuecomment-2285506427

   > 你好@dayongi
   > 
   > 有一个类似的已关闭问题可能与您的问题相关:[当 uri_routes 数量为 10w 时,radixtree.new 花费近 120 秒](https://github.com/apache/apisix/issues/9320)。此问题讨论了处理大量路由时与 radixtree.new 方法相关的性能问题[[1]](https://github.com/apache/apisix/issues/9320)。
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

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


Re: [I] help request: Using the radixtree.new() method in a similar way has a performance difference of ten times [apisix]

Posted by "dayongi (via GitHub)" <gi...@apache.org>.
dayongi closed issue #11496: help request: Using the radixtree.new() method in a similar way has a performance difference of ten times
URL: https://github.com/apache/apisix/issues/11496


-- 
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: notifications-unsubscribe@apisix.apache.org

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