Tuesday, March 07, 2023

Re: Folks are there any tips to improve page load times on smokeping running on OpenBSD

On 3/7/23 00:36, Stuart Henderson wrote:
> On 2023/03/07 07:10, Tom Smyth wrote:
>> I m running smokeping fcgi and rrdcached ontop of OpenbSD, to smokeping
>> about 150 devces
>> the page load times can take 30 seconds to 1 minute,
>> is there any way to speed this up.
>>
>> im running 7.2 OpenBSD on amd64 vm on top of an SSD array
>>
>> any tips tricks welccome ...
>
> One quick thing to try is updating to -current, I made some changes to
> the rrdtool port which may possibly help a little.
>
> Check that smokeping is actually using rrdcached (watch top while
> opening a page) - the pkg-readme only gives instructions for passing the
> required fastcgi variable through for nginx, I don't know how to do that
> for httpd (or whether it's actually possible).

FWIW I have been running smokeping and mrtg with about 200 targets using httpd for quite some time.

Smokeping with 1 master and 2 slaves. fping probes, config w default concurrentprobes (i.e., commented out in config).
Rest of config down to ***Targets*** looks like Tom's.

not running rddcached

We're a small wireless (5GHz backbone, 2GHz APs) co-op on private 10.42.0.0 net; ping to most distance site is ~30msec, but can climb substantially with lousy weather and client contention.

I found using IPs for "host" entries helped by eliminating DNS lookups but don't recall how much difference it made.

It takes <15sec to generate new page (/var/db/smokeping/* and /var/www/htdocs/smokeping/cache/*), top indicates smokeping using 1 core.

Hardware is pcEngines apu2 (4 core amd64, 4Gb mem) with 16Gb mSATA; OpenBSD 7.2 release

To get this running cp'd perl (/usr/bin/perl) and relevant perl libs (/usr/lib/[libs.so|libm.so|libperl.so] /usr/libexec/ld.so) to /var/www/usr/[bin|lib|libexec]

httpd.conf:

ext_ip="[redacted]" # Change this value to your vultr IP

server "default" {
listen on $ext_ip port 80
}
types {
include "/usr/share/misc/mime.types"
}
server "[redacted]" {
listen on $ext_ip port 80
location "/smokeping/smokeping.fcgi*" {
fastcgi socket "/run/smokeping.sock"
root "/"
}
}

start smokeping and smokeping.fcgi with rcctl, (same for mrtg)

Cheers, Glen


>
> Other than that, rrdtool/rrdcached is just slow on OpenBSD. If it's
> anything like mine you'll see high cpu spin % in top while it's busy.
> You can try changing the number of cores in the VM - if you've given it
> lots of cores try *reducing* it a bit. To pick a number out of the air
> I'd suggest probably 4-6. (mine is bare metal and I can't drop the
> number short of kernel hacks to set more cores offline).
>
> You can hide the slowness at the loss of dynamic functionality in the
> web interface by pre rendering the html/graphs from a cron job rather
> than using the fastcgi (see the pkg-readme). But other than the above
> I'm out of ideas to actually make it run faster.
>
> (If anyone interested in poking at kernel locks would like flamegraphs
> from my monitoring box - librenms/smokeping/icinga2/mariadb with lots
> of rrdtool/rrdcached - let me know. Spin is pretty brutal.)
>

No comments:

Post a Comment