airbnb / nerve

A service registration daemon that performs health checks; companion to airbnb/synapse
MIT License
942 stars 151 forks source link

Add options for load testing #116

Closed anson627 closed 5 years ago

anson627 commented 5 years ago

For load testing purpose

  1. add option load_test_concurrency to launch multiple service reporters
  2. add option check_mocked to skip host health check and always report up

Test with local zookeeper with test config:

{
  "instance_id": "macbook-pro",
  "listen_port": 1025,
  "services": {
    "mango-test_26009_secure": {
      "port": 3000,
      "check_interval": 2,
      "check_mocked": true,
      "checks": [
          {
              "type": "tcp",
              "timeout": 1,
              "rise": 2,
              "fall": 2
          },
          {
              "type": "http",
              "uri": "/health",
              "timeout": 0.5,
              "rise": 2,
              "fall": 2,
              "host": "127.0.0.1",
              "port": 3000
          }
      ],
      "zk_hosts": [
          "127.0.0.1:2181"
      ],
      "zk_path": "/mango-test/services",
      "host": "127.0.0.1",
      "labels": {
          "region": "us-east-1",
          "az": "us-east-1a"
      },
      "load_test_concurrency": 10
    }
  }
}
I, [2019-07-08T13:55:05.672843 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_1 is now up
I, [2019-07-08T13:55:05.673134 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_6 is now up
I, [2019-07-08T13:55:05.674680 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_3 is now up
I, [2019-07-08T13:55:05.675163 #33805]  INFO -- Nerve::Reporter::Zookeeper: nerve: re-using existing zookeeper connection to 127.0.0.1:2181
I, [2019-07-08T13:55:05.674721 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_8 is now up
I, [2019-07-08T13:55:05.675571 #33805]  INFO -- Nerve::Reporter::Zookeeper: nerve: retrieved zk connection to 127.0.0.1:2181
I, [2019-07-08T13:55:05.676637 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_5 is now up
I, [2019-07-08T13:55:05.677241 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_2 is now up
I, [2019-07-08T13:55:05.677545 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_7 is now up
I, [2019-07-08T13:55:05.679579 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_0 is now up
I, [2019-07-08T13:55:05.679926 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_4 is now up
I, [2019-07-08T13:55:05.681346 #33805]  INFO -- Nerve::ServiceWatcher: nerve: service mango-test_26009_secure_9 is now up

@Jason-Jian @austin-zhu @allenlsy @Ramyak

austin-zhu commented 5 years ago

can we add more descriptions for the using scenario?

anson627 commented 5 years ago

can we add more descriptions for the using scenario?

Updated README