{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5433","repository_url":"https://api.github.com/repos/orientechnologies/orientdb","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5433/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5433/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5433/events","html_url":"https://github.com/orientechnologies/orientdb/issues/5433","id":120908156,"number":5433,"title":"thread contention java remote client","user":{"login":"dvoet","id":1521333,"avatar_url":"https://avatars.githubusercontent.com/u/1521333?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoet","html_url":"https://github.com/dvoet","followers_url":"https://api.github.com/users/dvoet/followers","following_url":"https://api.github.com/users/dvoet/following{/other_user}","gists_url":"https://api.github.com/users/dvoet/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoet/subscriptions","organizations_url":"https://api.github.com/users/dvoet/orgs","repos_url":"https://api.github.com/users/dvoet/repos","events_url":"https://api.github.com/users/dvoet/events{/privacy}","received_events_url":"https://api.github.com/users/dvoet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/invalid","name":"invalid","color":"e6e6e6"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/performance","name":"performance","color":"eb6420"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/resolved","name":"resolved","color":"bfe5bf"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/waiting%20reply","name":"waiting reply","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"tglman","id":424369,"avatar_url":"https://avatars.githubusercontent.com/u/424369?v=3","gravatar_id":"","url":"https://api.github.com/users/tglman","html_url":"https://github.com/tglman","followers_url":"https://api.github.com/users/tglman/followers","following_url":"https://api.github.com/users/tglman/following{/other_user}","gists_url":"https://api.github.com/users/tglman/gists{/gist_id}","starred_url":"https://api.github.com/users/tglman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tglman/subscriptions","organizations_url":"https://api.github.com/users/tglman/orgs","repos_url":"https://api.github.com/users/tglman/repos","events_url":"https://api.github.com/users/tglman/events{/privacy}","received_events_url":"https://api.github.com/users/tglman/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-12-08T01:22:23Z","updated_at":"2016-05-26T16:01:20Z","closed_at":null,"body":"Hi,\r\n\r\nWe are having performance problems using the java client to a remote orient database. There does not appear to be any network issues; calls through the commandline and rest clients are fast and the web console is fast. Looking at thread dumps, it appears as if our code is usually blocked trying to acquire a lock:\r\n\r\n```\r\n    at sun.misc.Unsafe.park(boolean, long)\r\n    at java.util.concurrent.locks.LockSupport.park(java.lang.Object) (line: 175)\r\n    at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt() (line: 836)\r\n    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(java.util.concurrent.locks.AbstractQueuedSynchronizer$Node, int) (line: 870)\r\n    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(int) (line: 1199)\r\n    at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock() (line: 209)\r\n    at java.util.concurrent.locks.ReentrantLock.lock() (line: 285)\r\n    at com.orientechnologies.common.concur.lock.OAdaptiveLock.lock() (line: 98)\r\n    at com.orientechnologies.orient.enterprise.channel.OChannel.acquireReadLock() (line: 120)\r\n    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(int, long, boolean) (line: 182)\r\n    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(int, boolean)\r\n    at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient) (line: 1871)\r\n    at com.orientechnologies.orient.client.remote.OStorageRemote.readRecord(com.orientechnologies.orient.core.id.ORecordId, java.lang.String, boolean, com.orientechnologies.orient.core.storage.ORecordCallback, boolean, com.orientechnologies.orient.core.storage.OStorage$LOCKING_STRATEGY) (line: 492)\r\n    at com.orientechnologies.orient.client.remote.OStorageRemoteThread.readRecord(com.orientechnologies.orient.core.id.ORecordId, java.lang.String, boolean, com.orientechnologies.orient.core.storage.ORecordCallback, boolean, com.orientechnologies.orient.core.storage.OStorage$LOCKING_STRATEGY) (line: 253)\r\n    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.executeReadRecord(com.orientechnologies.orient.core.id.ORecordId, com.orientechnologies.orient.core.record.ORecord, java.lang.String, boolean, boolean, com.orientechnologies.orient.core.storage.OStorage$LOCKING_STRATEGY) (line: 1580)\r\n    at com.orientechnologies.orient.core.tx.OTransactionOptimistic.loadRecord(com.orientechnologies.orient.core.id.ORID, com.orientechnologies.orient.core.record.ORecord, java.lang.String, boolean, boolean, com.orientechnologies.orient.core.storage.OStorage$LOCKING_STRATEGY) (line: 226)\r\n    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(com.orientechnologies.orient.core.id.ORID, java.lang.String, boolean, boolean, com.orientechnologies.orient.core.storage.OStorage$LOCKING_STRATEGY)\r\n    at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.load(com.orientechnologies.orient.core.id.ORID, java.lang.String, boolean, boolean, com.orientechnologies.orient.core.storage.OStorage$LOCKING_STRATEGY)\r\n    at com.orientechnologies.orient.core.iterator.OIdentifiableIterator.readCurrentRecord(com.orientechnologies.orient.core.record.ORecord, int) (line: 278)\r\n    at com.orientechnologies.orient.core.iterator.ORecordIteratorClusters.hasNext() (line: 147)\r\n    at com.tinkerpop.blueprints.impls.orient.OrientElementIterator.hasNext()\r\n    at com.tinkerpop.blueprints.impls.orient.OrientElementIterator.next() (line: 52)\r\n    at com.tinkerpop.blueprints.impls.orient.OrientElementIterator.next()\r\n    at com.tinkerpop.pipes.util.iterators.HistoryIterator.next() (line: 25)\r\n    at com.tinkerpop.pipes.IdentityPipe.processNextStart()\r\n    at com.tinkerpop.pipes.AbstractPipe.next()\r\n    at com.tinkerpop.pipes.filter.FilterFunctionPipe.processNextStart() (line: 23)\r\n    at com.tinkerpop.pipes.AbstractPipe.next()\r\n    at com.tinkerpop.pipes.util.Pipeline.next()\r\n    at com.tinkerpop.pipes.util.PipeHelper.counter(java.util.Iterator) (line: 107)\r\n    at com.tinkerpop.gremlin.java.GremlinPipeline.count()\r\n<snip>\r\n```\r\n\r\nI believe that the lock is held by a \"OrientDB <- Asynch Client\" thread:\r\n```\r\n  Thread \"OrientDB <- Asynch Client (orientdb.dsde-dev.broadinstitute.org/10.255.10.169:2424)\":\r\n    at java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[ ], int, int, int)\r\n    at java.net.SocketInputStream.socketRead(java.io.FileDescriptor, byte[ ], int, int, int)\r\n    at java.net.SocketInputStream.read(byte[ ], int, int, int) (line: 170)\r\n    at java.net.SocketInputStream.read(byte[ ], int, int)\r\n    at java.io.BufferedInputStream.fill() (line: 246)\r\n    at java.io.BufferedInputStream.read() (line: 265)\r\n    at java.io.DataInputStream.readByte() (line: 265)\r\n    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinary.readByte()\r\n    at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(int, long, boolean) (line: 200)\r\n    at com.orientechnologies.orient.enterprise.channel.binary.OAsynchChannelServiceThread.execute() (line: 50)\r\n    at com.orientechnologies.common.thread.OSoftThread.run() (line: 69)* Thread group \"main\":\r\n```\r\n\r\nThis is killing our performance. When we use a plocal database we have sub second response times for our code but with a remote connection it is around 2 seconds for a single request and can be up to 30 seconds under load.\r\n\r\nAny ideas what could be causing this or where to look?\r\n\r\nThanks,\r\nDoug"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/221915461","html_url":"https://github.com/orientechnologies/orientdb/issues/5433#issuecomment-221915461","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/5433","id":221915461,"user":{"login":"abyssQu","id":7504075,"avatar_url":"https://avatars.githubusercontent.com/u/7504075?v=3","gravatar_id":"","url":"https://api.github.com/users/abyssQu","html_url":"https://github.com/abyssQu","followers_url":"https://api.github.com/users/abyssQu/followers","following_url":"https://api.github.com/users/abyssQu/following{/other_user}","gists_url":"https://api.github.com/users/abyssQu/gists{/gist_id}","starred_url":"https://api.github.com/users/abyssQu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abyssQu/subscriptions","organizations_url":"https://api.github.com/users/abyssQu/orgs","repos_url":"https://api.github.com/users/abyssQu/repos","events_url":"https://api.github.com/users/abyssQu/events{/privacy}","received_events_url":"https://api.github.com/users/abyssQu/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T16:01:20Z","updated_at":"2016-05-26T16:01:20Z","body":"just slow, I have around 10 concurrent threads. the result set is very small, as I said the class A only has a few nodes. "}}
{"actor":{"display_login":"abyssQu"}}