Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let Redis spawn processes for us #7744

Closed
wants to merge 3 commits into from

Conversation

Al2Klimov
Copy link
Member

No description provided.

@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Jan 8, 2020
@Al2Klimov Al2Klimov self-assigned this Jan 8, 2020
@Al2Klimov
Copy link
Member Author

@lippserd Increases concurrency by 1.5-2 with one instance of https://github.com/Al2Klimov/icinga2-procmgr/tree/60276d4c40ae8e5563da85fd6aec7f84d9ce7501.

@Al2Klimov Al2Klimov removed this from the 2.13.0 milestone Jan 14, 2020
@Al2Klimov
Copy link
Member Author

... not.

@Al2Klimov
Copy link
Member Author

OK, with the given setup (1, 2) including 8 instances of https://github.com/Al2Klimov/icinga2-procmgr/tree/6b861c283c8ea18daa86492cab42d9767561759f I get this result (3), TL;DR 2x.

1

resource "digitalocean_droplet" "aklimov-628417a" {
	name = "aklimov-628417a"
	size = "s-24vcpu-128gb"
	image = "fedora-31-x64"
	region = "fra1"
	ssh_keys = [ 26010475 ]
}

resource "digitalocean_droplet" "aklimov-628417b" {
	name = "aklimov-628417b"
	size = "s-24vcpu-128gb"
	image = "fedora-31-x64"
	region = "fra1"
	ssh_keys = [ 26010475 ]
}

2

---
- hosts: all
  tasks:
  - loop:
    - iptables-services
    - tmux
    - vim
    yum:
      name: '{{ item }}'
  - copy:
      dest: /etc/sysconfig/iptables
      content: |
        *filter
        :INPUT DROP [0:0]
        :FORWARD DROP [0:0]
        :OUTPUT ACCEPT [0:0]
        -A INPUT -d 127.0.0.0/8 ! -i lo -j DROP
        -A INPUT -i lo -j ACCEPT
        -A INPUT -s 81.95.15.174/32 -j ACCEPT
        -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
        -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
        COMMIT
    register: fwr
  - service:
      name: iptables
      state: started
      enabled: yes
  - when: fwr.changed
    service:
      name: iptables
      state: reloaded

  - loop:
    - python3-influxdb
    yum:
      name: '{{ item }}'
  - get_url:
      dest: /influxdb.rpm
      url: 'https://dl.influxdata.com/influxdb/releases/influxdb-1.7.9.x86_64.rpm'
    register: influxrpm
  - when: influxrpm.changed
    shell: yum install -y /influxdb.rpm
  - service:
      name: influxdb
      state: started
      enabled: yes
  - influxdb_database:
      database_name: icinga2

- hosts: aklimov-628417b
  tasks:
  - loop:
    - redis
    yum:
      name: '{{ item }}'

- hosts: all
  tasks:
  - loop:
    - bison
    - boost-devel
    - cmake
    - flex
    - gcc
    - gcc-c++
    - git
    - lsof
    - make
    - mailx
    - mariadb-devel
    - openssl-devel
    - patch
    - postgresql-devel
    - psmisc
    yum:
      name: '{{ item }}'
  - file:
      path: /root/icinga2
      state: directory
  - shell: git init
    args:
      chdir: /root/icinga2
      creates: /root/icinga2/.git
  - blockinfile:
      path: /root/icinga2/.git/config
      block: |
        [receive]
        denyCurrentBranch = warn
  - copy:
      dest: /root/icinga2/build.sh
      mode: '0755'
      src: build.sh
  - name: /root/icinga2/prefix/etc/icinga2/features-available/checker.conf
    copy:
      dest: /root/icinga2/prefix/etc/icinga2/features-available/checker.conf
      owner: root
      group: root
      mode: '0644'
      content: |
        object CheckerComponent "checker" {
          concurrent_checks = 40000
        }
  - name: /root/icinga2/prefix/etc/icinga2/features-available/influxdb.conf
    copy:
      dest: /root/icinga2/prefix/etc/icinga2/features-available/influxdb.conf
      owner: root
      group: root
      mode: '0644'
      content: |
        object InfluxdbWriter "influxdb" {
          host = "127.0.0.1"
          port = 8086
          database = "icinga2"
          flush_threshold = 1024
          flush_interval = 10s
          host_template = {
            measurement = "$host.check_command$"
            tags = {
              hostname = "$host.name$"
            }
          }
          service_template = {
            measurement = "$service.check_command$"
            tags = {
              hostname = "$host.name$"
              service = "$service.name$"
            }
          }
        }
  - name: /root/icinga2/prefix/etc/icinga2/features-enabled/influxdb.conf
    file:
      path: /root/icinga2/prefix/etc/icinga2/features-enabled/influxdb.conf
      state: link
      src: /root/icinga2/prefix/etc/icinga2/features-available/influxdb.conf
  - name: /root/icinga2/prefix/etc/icinga2/conf.d/628417.conf
    copy:
      dest: /root/icinga2/prefix/etc/icinga2/conf.d/628417.conf
      owner: root
      group: root
      mode: '0644'
      content: |
        const MaxConcurrentChecks = 40000
        object CheckCommand "mysleep" {
          command = [ "bash", "-c", "cat <<<' |lolcat=1\n'; exec sleep 30" ]
          timeout = 20s
        }
        for (var i in range(30000)) {
          object Host string(i) {
            check_command = "mysleep"
            check_interval = 1s // * Math.random()
          }
        }

- hosts: aklimov-628417b
  tasks:
  - name: /root/icinga2/prefix/etc/icinga2/conf.d/628417a.conf
    copy:
      dest: /root/icinga2/prefix/etc/icinga2/conf.d/628417a.conf
      owner: root
      group: root
      mode: '0644'
      content: |
        const ProcessSpawnRedisPort = 6379

  - name: /root/icinga2-procmgr
    copy:
      dest: /root/icinga2-procmgr
      owner: root
      group: root
      mode: '0755'
      src: icinga2-procmgr
  - name: /root/icinga2-procmgr.ini
    copy:
      dest: /root/icinga2-procmgr.ini
      owner: root
      group: root
      mode: '0644'
      content: |
        [log]
        level=debug
        [redis]
        address=127.0.0.1:6379
        [concurrency]
        processes=40000
        goroutines=80000

3

Bildschirmfoto 2020-01-16 um 13 08 04

@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Jan 16, 2020
@Al2Klimov Al2Klimov added this to Blocked in v2.13.0 merge window Mar 12, 2020
@Al2Klimov Al2Klimov moved this from Blocked to WIP in v2.13.0 merge window Mar 12, 2020
@Al2Klimov
Copy link
Member Author

@N-o-X Do you agree with the concept including the fact that you have to start multiple instances of the spawner?

@Al2Klimov Al2Klimov added the needs feedback We'll only proceed once we hear from you again label Mar 26, 2020
@Al2Klimov Al2Klimov assigned N-o-X and unassigned Al2Klimov Mar 26, 2020
@julianbrost julianbrost removed this from the 2.13.0 milestone May 31, 2021
@Al2Klimov
Copy link
Member Author

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Aug 4, 2021
@Al2Klimov Al2Klimov added this to unsorted in 42 quadrillions PRs Aug 10, 2021
@Al2Klimov Al2Klimov moved this from unsorted to awaits action from OP in 42 quadrillions PRs Aug 10, 2021
@Al2Klimov Al2Klimov moved this from awaits action from OP to awaits being closed by a PR in 42 quadrillions PRs Aug 10, 2021
@julianbrost
Copy link
Contributor

I don't see this happening, especially given that I think it's not feasible to require a Redis instance on every single node in the cluster.

42 quadrillions PRs automation moved this from awaits being closed by a PR to done Sep 16, 2021
@icinga-probot icinga-probot bot deleted the feature/redis-process-manager branch September 16, 2021 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed needs feedback We'll only proceed once we hear from you again
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants