2009-06-23 Sancho Lerena <slerena@artica.es>

* lib/pandoraFMS/DataServer.pm, Config.pm: Fixes bug #2811605. This
        add a new config token to define max files queued to avoid problems
        reading incoming dir with huge number of files.

        * lib/PandoraFMS/Core.pm: Adds new feature to have optional agent
        access graph & data. Included to improve the performance in huge systems



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1766 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2009-06-24 16:53:17 +00:00
parent 08eed00131
commit 8af37fc32a
5 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2009-06-23 Sancho Lerena <slerena@artica.es>
* lib/pandoraFMS/DataServer.pm, Config.pm: Fixes bug #2811605. This
add a new config token to define max files queued to avoid problems
reading incoming dir with huge number of files.
* lib/PandoraFMS/Core.pm: Adds new feature to have optional agent
access graph & data. Included to improve the performance in huge systems
2009-06-24 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Small fixes to compound alert and event

View File

@ -207,4 +207,9 @@ max_log_size 65536
# mcast_change_port 11111
# mcast_change_group 224.1.1.1
# max_queue_files (250 by default)
# When server have more than max_queue_files in incoming directory, skips the read
# the directory to avoid filesystem overhead.
max_queue_files 250

View File

@ -185,6 +185,8 @@ sub pandora_load_config {
$pa_config->{"export_threads"} = 1; # 3.0
$pa_config->{"web_threads"} = 1; # 3.0
$pa_config->{"max_queue_files"} = 250;
# Internal MTA for alerts, each server need its own config.
$pa_config->{"mta_address"} = '127.0.0.1'; # Introduced on 2.0
$pa_config->{"mta_port"} = '25'; # Introduced on 2.0
@ -467,6 +469,10 @@ sub pandora_load_config {
elsif ($parametro =~ m/^export_threads\s([0-9]*)/i) {
$pa_config->{'export_threads'}= clean_blank($1);
}
elsif ($parametro =~ m/^max_queue_files\s([0-9]*)/i) {
$pa_config->{'max_queue_files'}= clean_blank($1);
}
} # end of loop for parameter #

View File

@ -475,6 +475,9 @@ sub pandora_access_update ($$$) {
return if ($agent_id < 0);
if ($pa_config->{"agentaccess"} == 0){
return;
}
db_insert ($dbh, "INSERT INTO tagent_access (`id_agent`, `utimestamp`) VALUES (?, ?)", $agent_id, time ());
}

View File

@ -81,7 +81,11 @@ sub data_producer ($) {
opendir (DIR, $pa_config->{'incomingdir'})
|| die "[FATAL] Cannot open Incoming data directory at " . $pa_config->{'incomingdir'} . ": $!";
my $queue_count = 0;
while (defined (my $file_name = readdir(DIR))) {
if ($queue_count > $pa_config->{"max_queue_files"}) {
last;
}
# For backward compatibility
if ($file_name =~ /^.*\.checksum$/) {
@ -89,9 +93,10 @@ sub data_producer ($) {
next;
}
# Data files have the extension .data
# Data files must have the extension .data
next if ($file_name !~ /^.*\.data$/);
$queue_count++;
push (@tasks, $file_name);
}