Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign uplow get performance when use auth #3223
Comments
xiang90
added
the
performance
label
Aug 5, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
yichengq
Aug 5, 2015
Contributor
The cause is that we use bcrypt to hash the password, and it needs ~100ms to check the password could match the hash value.
Any idea to improve this? @barakmich
|
The cause is that we use bcrypt to hash the password, and it needs ~100ms to check the password could match the hash value. Any idea to improve this? @barakmich |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qmhu
Aug 7, 2015
any ideas?
my project is a web project which build by php + wordpress and I need get some config from etcd, i want to perceive config change from etcd real time. so I have to get config very frequently.
but consider 0.17s every request's latency, I have to reduce request to etcd as much as possible.
qmhu
commented
Aug 7, 2015
|
any ideas? but consider 0.17s every request's latency, I have to reduce request to etcd as much as possible. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
citywander
commented
Aug 9, 2015
|
Maybe you can cache, plaintext and hash. |
xiang90
added this to the v2.2.0-rc0 milestone
Aug 10, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
xiang90
Aug 10, 2015
Contributor
@qmhu @citywander We are going to investigate more and try to solve it soon. Stay tuned.
|
@qmhu @citywander We are going to investigate more and try to solve it soon. Stay tuned. |
xiang90
self-assigned this
Aug 10, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
xiang90
Aug 17, 2015
Contributor
@philips @barakmich Any opinion on this one? We can either cache the result or just use plain test as password (does etcd really need to protect the passwords stored in it?)
|
@philips @barakmich Any opinion on this one? We can either cache the result or just use plain test as password (does etcd really need to protect the passwords stored in it?) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
barakmich
Aug 17, 2015
Contributor
NO. We should not save passwords in plaintext. Come on, guys. Bcrypt is there for a reason. Now, that said...
Basic Auth is sending plaintext on the wire. This is why we have TLS. If you generate a bearer token (a la OAuth) after the first auth and store it etcd-side with a TTL, you can get a plaintext token, the comparison speedup that will eventually timeout gracefully. So your first request will still be ~100ms, but the subsequent ones can be considerably faster.
|
NO. We should not save passwords in plaintext. Come on, guys. Bcrypt is there for a reason. Now, that said... Basic Auth is sending plaintext on the wire. This is why we have TLS. If you generate a bearer token (a la OAuth) after the first auth and store it etcd-side with a TTL, you can get a plaintext token, the comparison speedup that will eventually timeout gracefully. So your first request will still be ~100ms, but the subsequent ones can be considerably faster. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
xiang90
Aug 17, 2015
Contributor
@barakmich If we do want the security, the bcrypt is probably the only option and the slowness is one of its feature.
To speedup, we need to go the plaintext token way. It changes both the server side and client side. If we go that way, we probably need to move this to a lower priority for 2.2 release.
|
@barakmich If we do want the security, the bcrypt is probably the only option and the slowness is one of its feature. To speedup, we need to go the plaintext token way. It changes both the server side and client side. If we go that way, we probably need to move this to a lower priority for 2.2 release. |
xiang90
added
the
Help Wanted
label
Aug 17, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
xiang90
Aug 24, 2015
Contributor
Lower priority of this issue since this is not a block, but a performance improvement. I am still not sure which is the best way to solve it.
/cc @philips @yichengq @barakmich @citywander @qmhu Any suggestion would be appreciated.
|
Lower priority of this issue since this is not a block, but a performance improvement. I am still not sure which is the best way to solve it. /cc @philips @yichengq @barakmich @citywander @qmhu Any suggestion would be appreciated. |
xiang90
removed this from the v2.2.0-rc0 milestone
Aug 24, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qmhu
Aug 31, 2015
From my side, we can't stand for 0.1s+'s latency for every request. I support using plaintext but enable cache in server side is fine to me as long as the latency can regain back to a normal level.
by the way, if etcd can support multiple get, we can reduce the get request times,and this will help to improve my site's performance.
qmhu
commented
Aug 31, 2015
|
From my side, we can't stand for 0.1s+'s latency for every request. I support using plaintext but enable cache in server side is fine to me as long as the latency can regain back to a normal level. by the way, if etcd can support multiple get, we can reduce the get request times,and this will help to improve my site's performance. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
thepwagner
Oct 6, 2015
In the HTTPS case, why not pull the "username" from the client's X509 DN?
That would sidestep the bcrypt() bottleneck, and smarter clients could KeepAlive to perform multiple requests with a fixed authentication cost.
thepwagner
commented
Oct 6, 2015
|
In the HTTPS case, why not pull the "username" from the client's X509 DN? That would sidestep the bcrypt() bottleneck, and smarter clients could KeepAlive to perform multiple requests with a fixed authentication cost. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
roboll
Nov 25, 2015
Contributor
#3916 implements authentication using common name, that should solve this.
|
#3916 implements authentication using common name, that should solve this. |
xiang90
referenced this issue
Dec 16, 2015
Closed
etcd 2.2.2 auth password CPU usage is too high #4005
xiang90
added this to the v3.1.0 milestone
Jun 30, 2016
xiang90
referenced this issue
Jul 1, 2016
Closed
Bad performance after enabling etcd authentication. #5840
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
closed by #5991 |
xiang90
closed this
Jul 21, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ZeaLoVe
Mar 22, 2017
@xiang90 Could you please tell me how this problem solved? any docs?
I tried version 3.1, performance still bad. In my case, I try to use etcd with http+auth.
ZeaLoVe
commented
Mar 22, 2017
|
@xiang90 Could you please tell me how this problem solved? any docs? |
qmhu commentedAug 5, 2015
When enable auth for etcd, request latency increase a lot. the test result is as below:
test env: Ubuntu14.04 Server virtual machine+16G
test case: php script to put a value in etcd and send 100 sequence get request and record the time cost for 100 get request then calculate average latency for every get request.
http: 0.0006s
http+auth: 0.14s
https: 0.08s
https+auth:0.17s
besides, enable https in etcd also make latency increase a lot.