My environment is local machine: ubuntu 12.04 ArangoDB 2.2.4 or 2.2.3 perl driver(ArangoDB) CPU: 3 core 6 threads mem: 3GB
I used save method. Save method is equal to HTTP_GET and HTTP_POST. Execute result is following:
- one perl process, insert 30000 documents. Avg 700 requests/s. 350 HTTP_GET and 350 HTTP_POST.
- 10 perl process, insert 30000 documents. Avg 1000 requests/s. 500 HTTP_GET and 500 HTTP_POST.
After running 30 seconds, It'll report HTTP 500 error. I modified perl driver(ArangeDB) code for retrying it. So I can finish this test.
arangodb's log is following when it reported HTTP 500 error.
2014-10-04T14:46:47Z [26642] DEBUG [./lib/GeneralServer/GeneralServerDispatcher.h:403] shutdownHandler called, but no handler is known for task
2014-10-04T14:46:47Z [26642] DEBUG [./lib/GeneralServer/GeneralServerDispatcher.h:403] shutdownHandler called, but no handler is known for task
I hoped my program can execute avg 3000-5000 requests/s and reduce HTTP 500 error. What's improvements I can use. Thanks!
UPDATE BY 7/10/2014, My insert sample script is following. And I replaced save method by AQL. One perl process, insert 10000 documents, Avg 900 requests/s, 1000 HTTP_POST/s. (no HTTP 500) One perl process, insert 30000 documents, Avg 700 requests/s, 700 HTTP_POST/s. (There will issued HTTP 500, need retry it)
#!/usr/bin/perl
use warnings;
use strict;
use ArangoDB;
my $itdb = ArangoDB->new(
{
host => '10.211.55.2',
port => 8529,
keep_alive => 1,
}
);
# Find or create collection
$itdb->create('Node_temp',{isVolatile => JSON::true});
ImpNodes();
sub ImpNodes{
for(1..30000){
my $sth = $itdb->query('INSERT {
"id": "Jony",
"value": "File",
"popup": "public",
"version": "101",
"machine": "10.20.18.193",
"text": {
"Address": ["center","bold","250","100"]
},
"menuitem":[
{
"value": "New",
"onclick": "CreateNewDoc",
"action": "CreateNewDoc"
}
,
{
"value": "Open",
"onclick": "OpenNewDoc",
"action": "OpenNewDoc"
},
{
"value": "Close",
"onclick": "CloseDoc",
"action": "CloseDoc"
},
{
"value": "Save",
"onclick": "SaveDoc",
"action": "SaveDoc"
}]
} in Node_temp');
my $cursor = $sth->execute({
do_count => 1,
batch_size => 10,
});
}
}
And I have modified Arangodb-0.08 for inserting smoothly in Connection.pm. http_post method:
$retries = 100 #for testing
for(1..$retries){
( undef, $code, $msg, undef, $body ) = $self->{_http_agent}->request(
%{ $self->{_req_args} },
method => 'POST',
path_query => $path,
headers => $headers,
content => $data,
);
last if ( $code < 500 || $code >= 600 );
print "The return code is 5xx,retry http_post!\n";
print $code, " : " , $msg , " : " , $body;
select(undef, undef, undef, 3);
}