Actions
Bug #17335
closedcf-agent writes a lot of times to performance db
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
Description
This impacts a lots on io of the machine (almost half a typical run)
It should be done only when configured to, but it is forced for all file promises.
Here is the line to analyse a trace:
strace -t -e trace=%desc -o /tmp/trace -f rudder agent run -ui grep -E "open|write" trace4 | ./script.pl
And the script
#!/usr/bin/perl
while(<>) {
if (/openat\(.*?, *"(.*?)".*= *-1 ENOENT/) {
} elsif (/openat\(.*?, *"(.*?)".*= *(\d+)$/) {
$fd{$2} = $1;
} elsif (/openat\(.*?, *"(.*?)".*unfinished/) {
$lastfile = $1;
} elsif (/openat resumed.*= *-1 ENOENT/) {
} elsif (/openat resumed.*= *(\d+)$/) {
$fd{$1} = $lastfile;
} elsif (/writev?\((\d+),.*= *(\d+)$/) {
$sum{$fd{$1}} += $2;
} elsif (/pwrite64\((\d+),.*= *(\d+)$/) {
$sum{$fd{$1}} += $2;
} elsif (/write\((\d+),.*unfinished/) {
$lastfd = $1;
} elsif (/write resumed.*= *(\d+)$/) {
$sum{$fd{$lastfd}} += $1;
} elsif (/read\(/) {
} elsif (/read resumed/) {
} else {
print("unhandled line $_");
}
}
foreach $k (keys %sum) {
$kb = int($sum{$k}/1024);
print "$kb $k\n";
}
Actions