Thank you for your reply.
Then, how can I run traversals in different threads?
I used the neo4j RESTful API with php client, which is written on
this neo4j web page:
http://docs.neo4j.org/chunked/milestone/tutorials-rest.html
My php code is as follows:
function search($user) {
$client = new Everyman\Neo4j\Client('dnode6', 7474);
$usnIndex = new Everyman\Neo4j\Index\NodeIndex($client,
'usn');
$traversal = new Everyman\Neo4j\Traversal($client);
$traversal->addRelationship('FRIEND', Everyman\Neo4j
\Relationship::DirectionOut)
->setPruneEvaluator(Everyman\Neo4j
\Traversal::PruneNone)
->setReturnFilter(Everyman\Neo4j\Traversal::ReturnAll)
->setMaxDepth(1);
$startNode = $usnIndex->findOne('usn', $user);
$nodes = $traversal->getResults($startNode, Everyman\Neo4j
\Traversal::ReturnTypeNode);
$result = array();
foreach ($nodes as $node) {
$friends = $traversal->getResults($node, Everyman\Neo4j
\Traversal::ReturnTypeNode);
foreach ($friends as $friend) {
$usn = $friend->getProperty('usn');
try {
$count = $result[$usn];
} catch(Exception $e) {
$count = 0;
}
$result[$usn] = $count+1;
}
}
arsort($result);
$count = 1;
foreach (array_keys($result) as $key) {
if ($key != $user)
print $count++ . " : " . $key . " --> " .
$result[$key]. "\n";
}
}
With the above 'search function', the response time is getting slower
as the concurrent users increase.
I think if neo4j is multithreaded, the response time is not to slow.