I have to create about 6800 contacts in a public folder periodically. I've written a POC Perl program that does the job, see here for the relevant lines:
Code: Select all
[...]
syslog('info', '*** writing all contatcts to Scalix');
my $cnt = 0;
my $ok = 0;
my $failed = 0;
my $ua = LWP::UserAgent->new();
my $headers = new HTTP::Headers;
$headers->authorization_basic($SX_USER, $SX_PASS);
$headers->content_type('application/scalix-properties');
my $path = "http://$SX_HOST/api/$SX_EMAIL/$SX_FOLDER";
for my $xml (@xmls) {
if ((++$cnt % 100) eq 1) {
syslog('info', "Sending POST Request No. %d", $cnt);
}
my $request = new HTTP::Request('POST', $path, $headers, $xml);
my $response = $ua->request($request);
if ($response->is_success) {
$ok++;
}
else {
$failed++;
syslog('warning', "FAIL: response from Scalix: %s\nXML:\n%s", $response->content, $xml);
}
}
[...]
(the array @xmls holds the XML data structures for the contacts).
Well, the code works, but its awfully slow. (it takes more than 3 hours to create the 6800 contacts).
Is there any potential to speed up this a bit? I've increased the memory for the tomcat JRE from 512M to 1G, but no perferformance increase.
(Scalix version: 11.4.4, Server Hardware isn't to bad: 4-Core Xeon 2.6Ghz, 4GB RAM, Mailstore on a RAID10 with 4 fast SAS HDs, about 100 Users, about 40 active users).