'omv-mkgraph' runs every 5 mins, even if no one connected

  • My log has every 5 minutes this entry

    Code
    /USR/SBIN/CRON[23886]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)


    is it really necessary to run 'omv'mkgraph' every 5 min, even if no one is connected to the WebGUI? How about checking, if a user is connected and run the script all 5 min as long he is connected. I know this is a cron job, but maybe theres another solution.


    Who needs new graphs, if no one sees it ;) -> only create new graphs, if someone is logged into the WebGUI. That may save some HDD-Lifetime for the system-disk.

  • Part of the problem is collectd, see http://forums.openmediavault.org/viewtopic.php?f=12&t=2391 and it looks like Volker made some changes to it in 0.5.x


    I changed the /etc/cron.d/openmediavault-rrdtoolgraph job to run every 15 minutes. My graphs still look OK to me. This change will go back to every 5 minutes with each OMV update. You could try other time intervals and see what happens.


    The graphs do look nice and I imagine a lot of folks like them.

  • I it not about the graphs are not nice. I like to look at them also, but IMO it is not necessary to update the graphs all 5 min. IMO the graphs could be updated if someone logs into the WebGUI, then the user has the actual graphs.

  • But you need to run them every 5 minutes - you had not much to view if they would only run when you logged in via the GUI.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • How about creating the graphs if someone logs in? Like a "Refresh"?
    AFAIR collecting the data (rrdtool) is independent to creating the graphs based on the collected data (omv-mkgraph). So you can create the graphs when you need it. rrdtool collects the data in the background.
    Please correct me, if I'm wrong.

  • No, I don't understand why you worry about this when you use the auto shutdown script. I run my server 24/7 and would like my graphs populated. I would like it if you brought back up the total disk usage issue and get that into the main code of omv.

  • I don't worry much about it, but IMHO it can be optimized ;)


    Are you talking about the graphs for the total-disk-usage: http://forums.openmediavault.org/viewtopic.php?f=13&t=1627
    From my side, Volker can use it, but don't know, if he wants to. If not, maybe ryeco can make a plugin out of this.

    • Offizieller Beitrag
    Zitat von "Solo0815"

    If not, maybe ryeco can make a plugin out of this.


    I'll look at it.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • OK, I've played a bit. Apparently collectd gets it's data every 5 seconds and saves it. Then the rrdtoolgraph app reads the collectd data and creates the graphs whenever the app is asked to.


    So as I said I set my /etc/cron.d/openmediavault-rrdtoolgraph to create the graphs every 15 minutes. The graphs look fine. So I # commented out the cron job. And sure enough it did not create the graphs, no entries in the syslog. But... the graphs were displayed from the last time the graph app ran, I hit the refresh button, and new graphs were generated and they looked good, like they always do. So I've kept it this way.


    This suggests that by commenting out the cron job or reducing how often it runs it will save read/writes to SSD's. If this is true it might be nice to allow a setting on the graph page to select how often graphs are created, though not lower than 5 minutes to save system resources. It could be there beside the refresh button saying 'Graphs updated every x minutes'. I would think 10 minute intervals for SSD's might be a good starting point as it would cut this use by 50%.

  • Since I've stopped the cron job from creating the graphs every 15 minutes as I had it, now every 20 minutes I'm getting;

    Code
    Sat 21 Sep 2013 12:32:42PM CDT	omvserver	rsyslogd: --MARK--

    in the syslog and messages log files. Oh joy! How to solve that?


    Edit the /etc/rsyslog.conf file in one of two ways,


    Edit near the top of the file in the *** MODULES *** section and add the second line of the code below;

    Code
    $ModLoad immark   # provides --MARK-- message capability
    $MarkMessagePeriod 3600 # sets  --MARK-- message time in seconds


    this will only put the --MARK-- once every hour in the logs as needed. The --MARK-- is there only to let you know rsyslog is functioning.


    Or - you could just # comment the first line of the above code and the --MARK-- module will not load and run.


    I added the second line in the code box.


    Don't forget to restart the rsyslog service so it will read the changes, use;

    Code
    sudo service rsyslog restart


    This too will reduce read/writes to SSD's.

  • collectd saves the data every 5 secs? Then how about creating a tmpfs for /var/lib/collectd/rrd and a cron-job, that saves the rrd-data every 15 minutes AND on shutdown to HDD? A script could copy it back from the HDD to tmpfs at the systemstart.
    On a powerloss, only max 15 min of collectd-data are lost.


    Edit: Volker chanded the interval to 15 min in 0.5.11:

    Zitat

    Fixed in openmediavault 0.5.11, see http://sourceforge.net/p/openmediavault/code/695. [^]
    By default it is set to 15min and can be modified via environment variable OMV_COLLECTD_RRDTOOL_MKGRAPH_INTERVAL.


    Checking if someone is connected is not possible:

    Zitat

    A check if someone is connected should be done in the cron-job itself because otherwise we have to execute the job some other way, but cron is the easiest. The problem is that there is no way to check if someone is connected because the engined does not know it (session handling is done by the PHP fronend part). Checking for session files in /var/lib/php5/sess_xxx does not work because a session file still exists if the used simply closes the browser.


    :arrow: Thx :!:

  • No, Volker just canged the cron job to create the images from 5 min to 15 min.


    The RAM-stuff was only a thought, how to decrease the data is written to the HDD.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!