5 rrdcached-size.pl - estimate the IO and memory requirements for rrdcached
10 [B<-rrds>E<nbsp>I<file_count>]
11 [B<-step>E<nbsp>I<seconds>]
12 [B<-update>E<nbsp>I<length>]
13 [B<-file>E<nbsp>I<length>]
14 [B<-io>E<nbsp>I<files/sec>]
15 [B<-w>E<nbsp>I<seconds>]
16 [B<-f>E<nbsp>I<seconds>]
17 [B<-pagesize>E<nbsp>I<bytes>]
23 =item B<-rrds> I<file_count>
25 Specify the number of RRDs in the working set.
27 =item B<-step> I<seconds>
29 Specify the RRD step value for each file.
31 =item B<-update> I<length>
33 Average update string length. For this calculation, the time value must
34 be specified as a C<time_t>, not C<N>. For example, this update string
35 would lead to B<-update>E<nbsp>I<43> :
37 1226936851:0:0:101113914:0:0:0:25814373:0:0
39 =item B<-file> I<length>
41 Specify the average file name length. For this calculation, use the full
44 =item B<-io> I<files/sec>
46 Specify the number of RRD files that your system can write per second.
50 Specifies the B<-w> timer used with rrdcached. For more information, see
51 the B<rrdcached> documentation.
55 Specifies the B<-f> timer used with rrdcached. For more information, see
56 the B<rrdcached> documentation.
58 =item B<-pagesize> I<bytes>
60 Manually specify the system page size, in case it is not detected
70 my $filename_len = 60;
74 my $rrd_per_sec = 200;
76 my $rrdc_flush = 3600;
77 my $pagesize = `pagesize` || 4096;
79 #################################################################
82 GetOptions('rrds=i' => \$rrds,
84 'update=i' => \$update_len,
85 'file=i' => \$filename_len,
86 'io=i' => \$rrd_per_sec,
87 'w=i' => \$rrdc_write,
88 'f=i' => \$rrdc_flush,
89 'pagesize=i' => \$pagesize,
92 or die "Options failure";
94 @ARGV and die "Extra args: @ARGV\n";
96 #################################################################
100 my $write_time = int($rrds / $rrd_per_sec);
101 my $write_busy = int(100 * $write_time / $rrdc_write);
102 my $buffered_pdp = $rrdc_write / $step;
107 + ( $rrdc_write / $step ) * $update_len)
112 * (length("update") + $filename_len + $update_len + 3)
113 * ($rrdc_flush/$step)
117 my $journal_rate = (($journal_size*$MEG/2))/$rrdc_flush;
118 my $journal_page_rate = $journal_rate / $pagesize;
120 $_ = sprintf("%.1f", $_)
131 RRD files : $rrds files
132 RRD step : $step seconds
133 Update length : $update_len bytes
134 IO writes/sec : $rrd_per_sec rrd/sec
135 write timer : $rrdc_write seconds
136 flush timer : $rrdc_flush seconds
137 -----------------------------------------------------------------
139 Time to write all RRDs: $write_time sec ($write_busy\% busy)
141 $buffered_pdp PDPs will be buffered per file
143 RAM usage: $max_ram MB
145 Journal size: $journal_size MB (total size for two journals)
147 Journal write rate: $journal_page_rate page/sec ($journal_rate byte/sec)
151 system("perldoc $0");