[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-23 Thread stephen mallette (JIRA)


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

stephen mallette commented on TINKERPOP-2003:
-

Any additional information on this one?

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}
> Thank you sincerely for your help。
>  



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


[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-11 Thread stephen mallette (JIRA)


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

stephen mallette commented on TINKERPOP-2003:
-

> May be some complex queries take a long time to run(Even if I don't 
> think).But once one request exceed the threshold,the requests following will 
> all blocked until exceed the scriptEvaluationTimeout.

It should be fairly simple for you to demonstrate that once the threshold is 
exceeded that all future requests become blocked, I don't think that is the 
case though. I believe there are tests that prove that future requests can work 
once a timeout is exceeded.

> If so ,the Gremlin server can only process the requests one by one ?

You should not be forced to make requests one at a time with sessionless 
requests. I like Robert Dale's questions.I think that you'd need to provide 
more details about those aspects of your environment. Ultimately, if there is 
some sort of bug, we'll need to narrow it down much further than where we are 
now.

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}
> Thank you sincerely for your help。
>  



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


[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-11 Thread Robert Dale (JIRA)


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

Robert Dale commented on TINKERPOP-2003:


Can you post the actual queries that time out from your Gremlin Server's 
gremlin.log?
 It should look like this
{noformat}
[WARN] AbstractEvalOpProcessor - Script evaluation exceeded the configured 
threshold for request [RequestMessage{, requestId=..., op='eval', processor='', 
args={gremlin=g.V(), batchSize=64}}]
{noformat}
It may also be helpful to see relevant stacktraces from the server.
 I would also turn on GC logging to rule out any really long garbage collection 
pause times.

What database are you using? Have you ruled out any contention there?

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}
> Thank you sincerely for your help。
>  



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


[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-11 Thread xifenghz (JIRA)


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

xifenghz commented on TINKERPOP-2003:
-

The phenomenon is after almost 5 days(at he beginning,everything goes well),the 
execution time of simple script such as  _client.submit("g.V('x')"_  or 
_results = future.get()_ exceeds the {{scriptEvaluationTimeout}}  __  
configured.May be some complex queries take a long time to run(Even if I don't 
think).But once one request exceed the threshold,the requests following will 
all blocked until exceed the {{scriptEvaluationTimeout_._}}

I want to know some details about how the sessionless Gremlin Server receive 
and process requests,e.g. the receiver and executor threads are the same one?If 
so ,the Gremlin server can only process the requests one by one ? __ 

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}
> Thank you sincerely for your help。
>  



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


[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-11 Thread stephen mallette (JIRA)


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

stephen mallette commented on TINKERPOP-2003:
-

Ok - so it looks like your'e re-using the {{Cluster}} object already. That's 
good.

Did use of {{synchronized}} like this:

{code}
synchronized (Service.class)
{
resultSet = client.submit(gremlinScript);
}
{code}

actually fix your problem? (i sense that it didn't)

Separately, you mention that you were hitting {{scriptEvaluationTimeout}} - do 
any of your traversals normally take a long time to run? 

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}
> Thank you sincerely for your help。
>  



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


[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-11 Thread xifenghz (JIRA)


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

xifenghz commented on TINKERPOP-2003:
-

Sorry for not show the context for my code in detail.

In a restful API based on SpringPVC,I call the submit method:

List results = Service.getInstance().submit(command);

 

Below is how the class Sevice defines.

 

_public class Service{_

_private static final Logger logger = LoggerFactory.getLogger(Service.class);_
 _private static final Service INSTANCE = new Service();_
 _private Cluster cluster;_
 _private Client client;_
 _private String configPath = "remote.yaml";_
 _private Service(){_
 _try {_
 _ClassLoader configClassLoader = this.getClass().getClassLoader();_
 _URL config = null;_
 _if (configClassLoader != null) {_
 _config = configClassLoader.getResource(configPath);_
 _}_
 _if (config == null) {_
 _logger.error("cannot find config file: " + configPath);_
 _return ;_
 _}_
 _cluster = Cluster.build(FileUtils.toFile(config)).create();_
 _logger.info("create Cluster success");_
 _client = cluster.connect();_
 _logger.info("create Client success");_
 _} catch (FileNotFoundException e) {_
 _logger.error("config file is not found: ", configPath);_
 _logger.error(ExceptionUtils.getStackTrace(e));_
 _}_
 _}_

_public static Service getInstance() {_
 _return INSTANCE;_
 _}_
 
 _public List submit(final String gremlinScript) throws 
GremlinServiceException {_
 _if (!isConnected()) {_
 _throw new GremlinServiceException("ConfigFile remote.yaml not found", 
GraphErrorCode.GraphErr.GREMLIN_CONFIG_FILE_NOT_FOUND);_
 _}_
 _logger.debug("submit script to gremlin server: " + gremlinScript);_

_ResultSet resultSet = null;_
 _synchronized (Service.class)_
 _{_
 _resultSet = client.submit(gremlinScript);_
 _}_
 _CompletableFuture> future = null;_
 _List results = null;_
 _if (resultSet != null) {_
 _future = resultSet.all();_
 _}_
 _if (future != null) {_
 _try {_
 _results = future.get();_
 _} catch (InterruptedException e) {_
 _logger.error("interrupted from gremlin server error: " + gremlinScript);_
 _throw new GremlinServiceException(e.getMessage(), 
GraphErrorCode.GraphErr.GREMLIN_QUERY_EXECUTE_FAILED);_
 _} catch (ExecutionException e) {_
 _logger.error("execution from gremlin server error: " + gremlinScript);_
 _throw new GremlinServiceException(e.getMessage(), 
GraphErrorCode.GraphErr.GREMLIN_QUERY_EXECUTE_ERROR);_
 _}_
 _}_
 _return results;_
 _}_

_}_

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}

[jira] [Commented] (TINKERPOP-2003) After a long period (almost 5days)of parallel requests(almost 200 request per second),client.submit blocked

2018-07-11 Thread stephen mallette (JIRA)


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

stephen mallette commented on TINKERPOP-2003:
-

You aren't using a session so that code snippet/comments you found do not apply 
to you, To [configure a 
session|http://tinkerpop.apache.org/docs/current/reference/#sessions] you need 
to do this:

{code}
client = cluster.connect("sessionName");
{code}

but you are simply doing:

{code}
client = cluster.connect();
{code}

and thus your {{client}} is sessionless. You should not need to synchronize 
your code at all. Your code example does not show the context for how it is 
used, but if you are not re-using your {{cluster}} instance for the life of 
your application and are constructing many of them quickly only to destroy 
them, I would guess that might be part of your problem. 

> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked
> ---
>
> Key: TINKERPOP-2003
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2003
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.3.0
>Reporter: xifenghz
>Priority: Major
>
> After a long period (almost 5days)of parallel requests(almost 200 request per 
> second),client.submit blocked for scriptEvaluationTimeout configured,and 
> return timeout.At the same time,many TCP connections in Gremlin Server are in 
> CLOSE_WAIT state.
> Here is my usages:
> cluster = Cluster.build(FileUtils.toFile(config)).create();
>  client = cluster.connect();
>  ResultSet resultSet = null;
>  {color:#ff}synchronized (Service.class){color}
> { resultSet = client.submit(gremlinScript); }
> CompletableFuture> future = null;
>  List results = null;
>  future = resultSet.all();
>  results = future.get();
>  
> The code snippet above runs in a java web app based on SpringMVC.I found a PR 
> related to my question.
> [https://github.com/apache/tinkerpop/pull/367/commits/58d8bade7425c7a7865382990eaaed2b7d90659c#diff-06d5dfb02d5d2c807c2387c3e9338709]
> In this PR,the author seems to say gremlin doer not support high concurrency。
> {color:#ff}Removed recommendations for submitting parallel requests on a 
> session from docs.{color}
> {color:#33}So,I submit the gremlin script in order(use synchronized 
> keyword,just as my code snippet ).But in order to lift throughput,I do not 
> lock the code for getting result from Gremlin Server。I want to know some 
> details about how Gremlin Server receive and process requests,such as the 
> receiver and executor threads are the same one?If so ,the Gremlin server can 
> only process the requests one by one ? {color}
> {color:#33}I wonder whether or not Gremlin supports high concurrency(such 
> as 200 second per second,including simple vertex or edge queries and complex 
> combinatorial queries).If so,please help to find out why the process time for 
> a simple script such as query vertex exceed scriptEvaluationTimeout. If 
> not,is there other ways to make Gremlin Server support  high concurrency,such 
> as multi-gremlinserver。{color}
> Thank you sincerely for your help。
>  



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