<@U0A71G31CDV> what is the latency impact of using...
# questions-and-troubleshooting
n
@Rocky what is the latency impact of using Apache ranger with starrocks? how much latency in ms it’s added to every query?
r
Integrating Apache Ranger with StarRocks typically has a minimal latency impact, generally adding only a few milliseconds (often < 10ms) to each query. This is because StarRocks uses the Ranger Agent Plugin architecture, which avoids making a network call to the Ranger Admin server for every query. How it works (Why latency is low) * Local Policy Cache: The StarRocks Frontend (FE) runs an embedded Ranger plugin that periodically pulls policies from the Ranger Admin server (controlled by
ranger.plugin.starrocks.policy.pollIntervalMs
) and stores them in local cache files. * Local Evaluation: When you submit a query, the authorization check happens locally within the FE process using this cache. There is no remote RPC blocking the query execution path. * Asynchronous Auditing: Audit logs can be sent to Ranger's audit store (like Solr or HDFS) asynchronously, minimizing the performance impact on the client-facing query. Factors that influence latency While the base overhead is negligible, the following can increase the millisecond count: 1. Policy Complexity: If you have hundreds of highly complex policies, row-level filters, or dynamic data masking rules, the local CPU time required to evaluate those rules increases. 2. Row-level Filters & Masking: Unlike simple "Allow/Deny" checks, row-level security and masking require the FE to rewrite the SQL plan (e.g., adding a
WHERE
clause or a function wrapper). This planning overhead is usually very small but scales with query complexity. 3. Network for Auditing: If the audit logging is configured to be synchronous or if the local buffer fills up, it could theoretically cause minor delays, though this is rare in optimized production setups. Performance Summary Phase | Typical Latency Impact Simple Authorization | ~1–3 ms Complex Policy Evaluation | ~5–15 ms Row-level Filtering/Masking | Varies (mostly planning overhead) Recommendation: For most production workloads, the security benefits of centralized management far outweigh the sub-10ms overhead. If you are extremely sensitive to latency (e.g., < 20ms total query time), you should benchmark your specific policy set by toggling
access_control=ranger
in your
fe.conf
. References • administration/user_privs/authorization/ranger_plugin.md • best_practices/authentication_authorization.md