Hello folks

Stuart  mentioned that the package readme only contains info on
rrdcached and smokeping  running with nginx ( i have been running it
with httpd for a year or so)

here is my configs to get smokeping running with rrdcached on
openbsd's httpd (base)...
comments welcome...
the only gotcha is that when adding in sub menus,
you need to set the permissions on the directory structure created in
/var/db/smokeping

smoke1# pwd
/var/db/smokeping
smoke1# ls -al
total 160
drwxr-xr-x  40 _smokeping  _rrdcached  1024 Mar  8 05:49 .
drwxr-xr-x  12 root        wheel        512 Mar  7 12:50 ..
drwxrwxr-x   5 _smokeping  _rrdcached   512 Mar  7 06:40 CORE

/var/db/smokeping/top_level_menu/sub_level_menu/
chmod 775 /var/db/smokeping/top_level_menu
chmod 775 /var/db/smokeping/top_level_menu/sub_level_menu


#####rc.conf.local############
pkg_scripts=rrdcached smokeping smokeping_fcgi
rrdcached_flags=-b /var/db/smokeping -B -m 770 -l
unix:/var/www/run/rrd/rrdcached.sock -j /var/db/smokeping/journal -p
/var/www/run/rrd/rrdcached.pid

#############################

#############httpd.conf#######################
server "default" {
        listen on * port 80
        location "/smokeping/smokeping.fcgi*" {
        fastcgi {
                socket "/run/smokeping.sock"
                param RRDCACHED_ADDRESS "unix:/var/www/run/rrd/rrdcached.sock"
                }
        root "/"
        }
###################################################

###etc-smokeping-config###############
smoke1$ cat /etc/smokeping/config
*** General ***

owner    = Wireless Connect Managed Networks
contact  = [Redacted] @wirelessconnect.eu
mailhost = [redacted]
#sendmail = /usr/sbin/sendmail
# NOTE: do not put the Image Cache below cgi-bin
# since all files under cgi-bin will be executed ... this is not
# good for images.
imgcache = /var/www/htdocs/smokeping/cache
imgurl   = cache
datadir  = /var/db/smokeping
piddir  = /var/run/smokeping
cgiurl   = http://[redacted]/smokeping/smokeping.fcgi
smokemail = /etc/smokeping/smokemail
tmail = /etc/smokeping/tmail
# specify this to get syslog logging
syslogfacility = local0
syslogpriority = debug
# each probe is now run in its own process
# disable this to revert to the old behaviour
concurrentprobes = yes

*** Alerts ***
to = [redacted] @ wirelessconnect.eu
from = [reacted] @wirelessconnect.eu
#mailtemplate = /var/somewhere/mailtemplate

+Sustained_5%_loss
type = loss
# in percent
edgetrigger = yes
pattern = >=5%,>=5%,>=5%
comment = Sustained Packet Loss more than 5%

+Sudden_10%_Loss
type = loss
 # in percent
edgetrigger = yes
 pattern = ==0%,==0%,>10%
 comment = Single Incident Packet Loss more than 10% Detected!

+Sudden_20%_Loss
type= loss
# in percent
edgetrigger = yes
 pattern = ==0%,==0%,>20%
 comment = Single Incident Packet Loss more than 20% Detected!


+Sporadic_Loss
 type = loss
 # in percent
 pattern = ==0%,==0%,*8*,*8*,>20%,*8*,>20%,>20%,*8*,>0%
 comment = High Packet loss  occured at least 4 times over the last two hours


 #+anydelay
#    type = rtt
 #   # in milliseconds
  #  pattern = >1
   # comment = Just for testing

+Latency_Over_50ms
 type = rtt
 # in milliseconds
edgetrigger = yes
pattern = <45,<45,<45,<45,<45,<45,>50
 comment = Sudden High Latency greater than 50ms!

+Latency_Over_200ms
 type = rtt
 # in milliseconds
edgetrigger = yes
 pattern = <100,<100,>200
 comment = Sudden High Latency greater than 200ms!

+Latency_Constantly_Over_100ms
 type = rtt
 # in milliseconds
edgetrigger = yes
 pattern = >100,>100,>100,>100,>100
 comment = Constant High Latency greater than 100 ms for over 5 samples in a row

+Offline_at_startup
 type = rtt
 # in milliseconds
edgetrigger = yes
pattern = ==S,==U
comment = System offline at startup!

*** Database ***

step     = 90
pings    = 60

# consfn mrhb steps total

AVERAGE  0.5   1  1008
AVERAGE  0.5  12  4320
    MIN  0.5  12  4320
    MAX  0.5  12  4320
AVERAGE  0.5 144   720
    MAX  0.5 144   720
    MIN  0.5 144   720

*** Presentation ***

template = /etc/smokeping/basepage.html

htmltitle = yes
graphborders = no

+ charts

menu = Charts
title = The most interesting destinations

++ stddev
sorter = StdDev(entries=>10)
title = Top Standard Deviation
menu = Std Deviation
format = Standard Deviation %f

++ max
sorter = Max(entries=>10)
title = Top Max Roundtrip Time
menu = by Max
format = Max Roundtrip Time %f seconds

++ loss
sorter = Loss(entries=>10)
title = Top Packet Loss
menu = Loss
format = Packets Lost %f
++ median
sorter = Median(entries=>10)
title = Top Median Roundtrip Time
menu = by Median
format = Median RTT %f seconds

+ overview

width = 800
height = 100
range = 36h

+ detail

width = 1024
height = 256
unison_tolerance = 2

"Last 8  Hours Performance"    8h
"Last 12 Hours Performance"    12h
"Last 36 Hours Performance"    36h
"Last 7 Days Performance"    7d
"Last 14 Days Performance"    14d
"Last 28 Days Performance"    28d
"Last 100 Days Performance"   100d


#+ hierarchies
#++ owner
#title = Host Owner
#++ location
#title = Location

*** Probes ***
#+basefork
#forks = 8
#offset = 50%
#step = 90
#timeout = 1



+ FPing
blazemode = true
binary = /usr/local/sbin/fping
packetsize = 64
hostinterval = 0.001
timeout = 0.125
offset = random
+ DNS

binary = /usr/bin/dig # mandatory
forks = 5
offset = 50%
step = 30
timeout = 15

# The following variables can be overridden in each target section
lookup = bbc.co.uk
pings = 30
server = [redacted]


+ TCPPing

binary = /usr/local/sbin/hping

forks = 5
offset = 50%
step = 300
timeout =10

#*** Slaves ***
#secrets=/etc/smokeping/smokeping_secrets
#+boomer
#display_name=boomer
#color=0000ff

#+slave2
#display_name=another
#color=00ff00

*** Targets ***

probe = FPing

menu = Top
title = Wireless Connect Network Latency Grapher
remark = SmokePing of Wireless Connect Ltd. \
         This Tool Shows the latency of the \
         Wireless Connectnetwork.
alerts = 
Sustained_5%_loss,Sudden_10%_Loss,Sporadic_Loss,Latency_Over_50ms,Offline_at_startup

#########################################config-sniped#############

smoke1# rcctl ls started
cron
dhcpleased
httpd
ntpd
pflogd
resolvd
rrdcached
smokeping
smokeping_fcgi
smtpd
sshd
syslogd


On Tue, 7 Mar 2023 at 14:38, Tom Smyth <tom.sm...@wirelessconnect.eu> wrote:
>
> Hi Stuart,...
> Im running 2 cores as Im a miser with my VMS in terms of CPU allocation
> ... ( I dont like spending time on the bare metal spliting cherries ) (more 
> context switches than work being done) ...
>
> Got my system upgraded...  thanks ... and fixed my old /usr/sbin/dig  
> (old..nolonger working) to /usr/bin/dig
> the initial load seems to be quicker ...  and opening a page seems to put 
> more  load on rrdcached... process alright
> the config below seems to get rrdcached working with httpd  in OpenBSD. ...
>
> the loading of the smokeping detailed graphs still takes a while ...  but I 
> will do further dianostics...
>
>
>
> This is my setup
>
> #############httpd.conf#######################
> server "default" {
>         listen on * port 80
>         location "/smokeping/smokeping.fcgi*" {
>         fastcgi {
>                 socket "/run/smokeping.sock"
>                 param RRDCACHED_ADDRESS "unix:/var/www/run/rrd/rrdcached.sock"
>                 }
>         root "/"
>         }
> ###################################################
>
> top output below when loading a web page
>
>
> load averages:  2.09,  1.82,  1.07                     smoke1              
> 14:36:27
> 42 processes: 40 idle, 2 on processor                               up 0 days 
> 00:11:09
> CPU0 states: 53.2% user,  0.0% nice,  6.8% sys,  0.2% spin,  2.2% intr, 37.6% 
> idle
> CPU1 states: 33.1% user,  0.0% nice, 10.6% sys,  1.4% spin,  0.0% intr, 54.9% 
> idle
> Memory: Real: 208M/1758M act/tot Free: 6160M Cache: 882M Swap: 0K/0K
>
>   PID USERNAME PRI NICE  SIZE   RES STATE     WAIT      TIME    CPU COMMAND
> 57245 _rrdcach   2    0   41M   36M onproc/0  kqread    3:13 30.62% rrdcached
> 99560 _smokepi   2    0   74M   88M sleep/1   netio     1:01 10.55% perl
> 73953 _smokepi   2    0 2632K 2660K sleep/0   kqread    0:00  0.20% fping
> 77717 _smokepi  10    0   42M   20M sleep/0   nanoslp   0:02  0.00% perl
>     1 root      10    0  644K  628K idle      wait      0:01  0.00% init
> 67291 _smokepi  -6    0   42M   20M idle      piperd    0:01  0.00% perl
> 72553 root       3    0  948K  924K idle      ttyin     0:00  0.00% ksh
> 84133 _pflogd    4    0  776K 1620K sleep/0   bpf       0:00  0.00% pflogd
> 74456 _smtpq     2    0 1656K 3484K idle      kqread    0:00  0.00% smtpd
> 58541 _ntp       2  -20 1408K 3320K sleep/1   kqread    0:00  0.00% ntpd
> 22630 root       2    0 1204K 4160K idle      kqread    0:00  0.00% sshd
> 20724 www        2    0 1908K 3944K sleep/1   kqread    0:00  0.00% httpd
> 27618 www        2    0 2256K 4276K idle      kqread    0:00  0.00% httpd
> 81375 _syslogd   2    0 1228K 1524K idle      kqread    0:00  0.00% syslogd
> 77400 _smokepi  18    0   42M   10M idle      sigsusp   0:00  0.00% perl
> 39827 root      28    0 1224K 2512K onproc/1  -         0:00  0.00% top
> 79586 _smtpd     2    0 1936K 4828K idle      kqread    0:00  0.00% smtpd
> 18799 fireman    2    0 1396K 3340K sleep/0   kqread    0:00  0.00% sshd
> 20179 www        2    0 1320K 3324K idle      kqread    0:00  0.00% httpd
> 45288 root      18    0  944K  916K idle      sigsusp   0:00  0.00% ksh
> 51902 root       2    0  760K 2548K idle      netio     0:00  0.00% syslogd
> 37356 www        2    0 1332K 3180K idle      kqread    0:00  0.00% httpd
> 82428 root       2    0 1472K 2284K idle      kqread    0:00  0.00% httpd
> 62829 _ntp       2    0  908K 2772K idle      kqread    0:00  0.00% ntpd
> 89278 root       2    0  872K 1524K idle      kqread    0:00  0.00% cron
> 16265 _smtpd     2    0 1652K 3472K idle      kqread    0:00  0.00% smtpd
> 46732 _smtpd     2    0 1456K 3304K idle      kqread    0:00  0.00% smtpd
>  3405 root       2  -20 1264K 1956K idle      kqread    0:00  0.00% ntpd
> 30532 root       2    0 1716K 2164K idle      kqread    0:00  0.00% smtpd
>
>
>
> On Tue, 7 Mar 2023 at 08:36, Stuart Henderson <s...@spacehopper.org> 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).
>>
>> 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.)
>>
>
>
> --
> Kindest regards,
> Tom Smyth.



-- 
Kindest regards,
Tom Smyth.

Reply via email to