[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13590938#comment-13590938
 ] 

Gunnar Wagenknecht commented on ZOOKEEPER-1657:
-----------------------------------------------

The patch does not seem to work:

{noformat}
22:03:12.589 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: 0,4  replyHeader:: 
0,0,0  request:: '/gyrex/nodes/all/98e14413-6157-440a-aa49-9c61c70099d9,F  
response::  until SASL authentication completes.
22:03:17.899 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: 0,4  replyHeader:: 
0,0,0  request:: '/gyrex/nodes/all/98e14413-6157-440a-aa49-9c61c70099d9,F  
response::  until SASL authentication completes.
22:03:17.901 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: 0,4  replyHeader:: 
0,0,0  request:: '/gyrex/nodes/all/98e14413-6157-440a-aa49-9c61c70099d9,F  
response::  until SASL authentication completes.
22:03:17.902 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: -2,11  replyHeader:: 
null request:: null response:: nulluntil SASL authentication completes.
22:03:27.902 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: 0,4  replyHeader:: 
0,0,0  request:: '/gyrex/nodes/all/98e14413-6157-440a-aa49-9c61c70099d9,F  
response::  until SASL authentication completes.
22:03:27.904 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: -2,11  replyHeader:: 
null request:: null response:: nulluntil SASL authentication completes.
22:03:27.905 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: 0,4  replyHeader:: 
0,0,0  request:: '/gyrex/nodes/all/98e14413-6157-440a-aa49-9c61c70099d9,F  
response::  until SASL authentication completes.
22:03:27.907 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: -2,11  replyHeader:: 
null request:: null response:: nulluntil SASL authentication completes.
22:03:27.908 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: -2,11  replyHeader:: 
null request:: null response:: nulluntil SASL authentication completes.
22:03:28.059 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: 0,4  replyHeader:: 
0,0,0  request:: '/gyrex/nodes/all/98e14413-6157-440a-aa49-9c61c70099d9,F  
response::  until SASL authentication completes.
22:03:28.060 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: -2,11  replyHeader:: 
null request:: null response:: nulluntil SASL authentication completes.
22:03:28.061 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] DEBUG 
o.a.zookeeper.ClientCnxnSocketNIO - deferring non-priming packet: 
clientPath:null serverPath:null finished:false header:: -2,11  replyHeader:: 
null request:: null response:: nulluntil SASL authentication completes.
22:03:28.062 [ZooKeeper Gate Connect Thread-SendThread(127.0.0.1:2181)] INFO  
org.apache.zookeeper.ClientCnxn - Client session timed out, have not heard from 
server in 20005ms for sessionid 0x13d27c3d5620000, closing socket connection 
and attempting reconnect
22:03:28.077 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] WARN  
o.a.zookeeper.server.NIOServerCnxn - caught end of stream exception
org.apache.zookeeper.server.ServerCnxn$EndOfStreamException: Unable to read 
additional data from client sessionid 0x13d27c3d5620000, likely client has 
closed socket
        at 
org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
        at 
org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
 
        at java.lang.Thread.run(Thread.java:662) [na:1.6.0_26]
22:03:28.079 [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181] INFO  
o.a.zookeeper.server.NIOServerCnxn - Closed socket connection for client 
/127.0.0.1:51730 which had sessionid 0x13d27c3d5620000
{noformat}
                
> Increased CPU usage by unnecessary SASL checks
> ----------------------------------------------
>
>                 Key: ZOOKEEPER-1657
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1657
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: java client
>    Affects Versions: 3.4.5
>            Reporter: Gunnar Wagenknecht
>              Labels: performance
>         Attachments: ZOOKEEPER-1657.patch, zookeeper-hotspot.png
>
>
> I did some profiling in one of our Java environments and found an interesting 
> footprint in ZooKeeper. The SASL support seems to trigger a lot times on the 
> client although it's not even in use.
> Is there a switch to disable SASL completely?
> The attached screenshot shows a 10-minute profiling session on one of our 
> production Jetty servers. The Jetty server handles ~1k web requests per 
> minute. The average response time per web request is a few milli seconds. The 
> profiling was performed on a machine running for >24h. 
> We noticed a significant CPU increase on our servers when deploying an update 
> from ZooKeeper 3.3.2 to ZooKeeper 3.4.5. Thus, we started investigating. The 
> screenshot shows that only 32% CPU time are spent in Jetty. In contrast, 65% 
> are spend in ZooKeeper. 
> A few notes/thoughts:
> * {{ClientCnxn$SendThread.clientTunneledAuthenticationInProgress}} seems to 
> be the culprit
> * {{javax.security.auth.login.Configuration.getConfiguration}} seems to be 
> called very often?
> * There is quite a bit reflection involved in 
> {{java.security.AccessController.doPrivileged}}
> * No security manager is active in the JVM: I tend to place an if-check in 
> the code before calling {{AccessController.doPrivileged}}. When no SM is 
> installed, the runnable can be called directly which safes cycles.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to