cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Zhuang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-14497) Add Role login cache
Date Tue, 05 Jun 2018 05:05:00 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-14497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jay Zhuang updated CASSANDRA-14497:
-----------------------------------
    Description: 
The [{{ClientState.login()}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/ClientState.java#L313]
function is used for all auth message: [{{AuthResponse.java:82}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/transport/messages/AuthResponse.java#L82].
But the [{{role.canLogin}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L521]
information is not cached. So it hits database everytime: [{{CassandraRoleManager.java:407}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L407].
For a cluster with lots of new connections, it's causing performance issue. The mitigation
for us is to increase the {{system_auth}} replication factor to match the number of nodes,
so [{{local_one}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L488]
would be very cheap. The P99 dropped immediately, but I don't think it is not a good solution.

I would purpose to add {{Role.canLogin}} to the RolesCache to improve the auth performance.

  was:
The [{{ClientState.login()}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/ClientState.java#L313]
function is used for all auth message: [{{AuthResponse.java:82}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/transport/messages/AuthResponse.java#L82].
But the [{{role.canLogin}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L521]
information is not cached. So it hits database everytime: [{{CassandraRoleManager.java:407}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L407].
For a cluster with lots of new connections, it's causing performance issue. The mitigation
for us is to increase the {{system_auth}} replication factor to match the number of nodes,
so [{{local_one}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L488]
would be very cheap. The P99 dropped immeidcately Which is not a good solution.

I would purpose to add {{Role.canLogin}} to the RolesCache to improve the auth performance.


> Add Role login cache
> --------------------
>
>                 Key: CASSANDRA-14497
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14497
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Auth
>            Reporter: Jay Zhuang
>            Priority: Major
>
> The [{{ClientState.login()}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/ClientState.java#L313]
function is used for all auth message: [{{AuthResponse.java:82}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/transport/messages/AuthResponse.java#L82].
But the [{{role.canLogin}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L521]
information is not cached. So it hits database everytime: [{{CassandraRoleManager.java:407}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L407].
For a cluster with lots of new connections, it's causing performance issue. The mitigation
for us is to increase the {{system_auth}} replication factor to match the number of nodes,
so [{{local_one}}|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/auth/CassandraRoleManager.java#L488]
would be very cheap. The P99 dropped immediately, but I don't think it is not a good solution.
> I would purpose to add {{Role.canLogin}} to the RolesCache to improve the auth performance.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message