私の環境はローカル マシンです: ubuntu 12.04 ArangoDB 2.2.4 または 2.2.3 perl ドライバー (ArangoDB) CPU: 3 コア 6 スレッド mem: 3GB
保存方法を使用しました。保存メソッドは、HTTP_GET および HTTP_POST と同じです。実行結果は次のとおりです。
- 1 つの perl プロセスで、30000 のドキュメントを挿入します。平均 700 リクエスト/秒。350 HTTP_GET および 350 HTTP_POST。
- 10 perl プロセス、30000 ドキュメントを挿入します。平均 1000 リクエスト/秒。500 HTTP_GET および 500 HTTP_POST。
30 秒実行すると、HTTP 500 エラーが報告されます。再試行のために perl ドライバー (ArangeDB) のコードを変更しました。だから私はこのテストを終えることができます。
HTTP 500 エラーが報告されたときの arangodb のログは次のとおりです。
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
私のプログラムが平均 3000 ~ 5000 リクエスト/秒を実行し、HTTP 500 エラーを減らすことができることを願っていました。私が使用できる改善点は何ですか。ありがとう!
2014 年 7 月 10 日までに更新、私の挿入サンプル スクリプトは次のとおりです。また、save メソッドを AQL に置き換えました。1 つの perl プロセス、10000 ドキュメントの挿入、平均 900 リクエスト/秒、1000 HTTP_POST/秒。(HTTP 500 なし) 1 つの perl プロセス、30000 ドキュメントの挿入、平均 700 リクエスト/秒、700 HTTP_POST/秒。(HTTP 500 が発行されます。再試行する必要があります)
#!/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,
});
}
}
また、Connection.pm にスムーズに挿入できるように Arangodb-0.08 を修正しました。http_post メソッド:
$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);
}