20c/vaping

seems to use a lot of CPU

aspiers opened this issue · 10 comments

When monitoring vaping with htop, I see it spiking to between 60% and 90% of one CPU pretty much all the time. That sounds wrong for something which is just doing a bit of pinging. I upgraded to 0.5.0 but it didn't help. Any ideas how best to debug this?

vegu commented

Odd, when i run it with the example config from the documentation it's pretty much idle most of the time.

Can you paste your config?

vegu commented

Also how many users viewing the web ui?

It's just me using it, with only one web page viewing the UI.


probes:
  - name: latency
    type: std_fping
    output:
      - vodka

    <a group>:
      hosts:
        - host: <a host>
          name: <a host's name>
          color: red
        - host: <a host>
          name: <a host's name>
          color: blue
        - host: <a host>
          name: <a host's name>
          color: orange

    <a group>:
      hosts:
        - host: <a host>
          name: <a host's name>
          color: yellow

    <a group>:
      hosts:
        - host: <a host>
          name: <a host's name>
          color: red
        - host: <a host>
          name: <a host's name>
          color: orange

    <a group>:
      hosts:
        - host: <a host>
          name: <a host's name>
          color: red
#        - host: <a host>
#          name: <a host's name>
#          color: lime
        # - host: <a host>
        #   name: <a host's name>
        #   color: blue
        - host: <a host>
          name: <a host's name>
          color: green
        - host: <a host>
          name: <a host's name>
          color: orange

    <a group>:
      hosts:
        - host: <a host>
          name: <a host's name>
          color: coral
        - host: <a host>
          name: <a host's name>
          color: brown

plugins:
  - name: std_fping
    type: fping
    count: 10
    interval: 3s
    output:
      - vodka

  - name: vodka
    type: vodka
    logging:
      version: 1
      formatters:
        simple:
          format: '%(asctime)s - %(name)s - %(levelname)s: %(message)s'
      handlers:
        console:
          class: logging.StreamHandler
          level: DEBUG
          formatter: simple
          stream: ext://sys.stdout
      loggers:
        vodka:
          level: DEBUG
          handlers:
            - console

    data:
      - type: fping
        handlers:
          - type: index
            index: host
          - type: store
            container: list
            limit: 7200

    apps:
      graphsrv:
        tmpl_engine: jinja2
        enabled: true
        graphs:
          multitarget:
            id_field: host
            type: multitarget
            plot_y: avg
            format_y: ms

          smokestack:
            id_field: host
            type: smokestack
            plot_y: avg

    plugins:

      - name: http
        type: flask
        host: <a host>
        port: 7021
        debug: true
        static_url_path: /static
        server: self
        async: thread
        routes:
          /targets : graphsrv->targets
          /graph_data :
            methods:
              - POST
              - GET
            target: graphsrv->graph_data
          /graph : graphsrv->graph_view
          /overview_read_file : graphsrv->overview_read_file
          /: graphsrv->overview_view
vegu commented

Only thing i see different from your config and mine is the number of hosts so went ahead and upped those to 12 on my end and retested, and it still behaves fine.

Kind of curious what other users are seeing when they run vaping.

What distro / python version are you running ?

Could perhaps do some python profiling to see where it's spending all the time.

Yeah, it's odd. I'm on vacation right now but happy to try any profiling / debugging suggestions you have when I get back. Thanks for the reply!

grizz commented

@aspiers any chance to check things out again? We've been testing scaling and can't reproduce any issues.

Sorry, haven't been using this for a while, but I just fired it up again and will keep an eye out for issues. I'm running it with Python 2.7.14 on openSUSE Leap 15.0.

same here, 2 out of 3 seconds it's at > 90% (on modest dual core celeron).

checking fping running by itself produces less than 1% of CPU usage as one would expect...

[root@nexus ~]# uname -a
Linux nexus 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@nexus ~]# python --version
Python 2.7.5

vegu commented

noticed it using 99% of cpu when running without --debug, with --debug it's idle most of the time

are you guys running with or without --debug

@vegu I moved on and just created my own: https://github.com/nefilim/pinger