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

Feature/graceful shutdown #14

Merged
merged 4 commits into from
Feb 24, 2017
Merged

Feature/graceful shutdown #14

merged 4 commits into from
Feb 24, 2017

Conversation

tcnksm
Copy link
Contributor

@tcnksm tcnksm commented Feb 20, 2017

For hot-deploying, support lestrrat/go-server-starter listeners.

Graceful shutdown is done by Go1.8's graceful shutdown feature (see release note). So this PR must be merged after go1.8 release.

Test

To test hot-deploying feature, run wbt by server-starter and kill HUP to it constantly (per sec.) and send 1000 requests to check there is no lost requests.

To kick wbt,

$ start_server --port 8080 --pid-file=/tmp/test.pid -- wbt -c config/example.toml

To constantly kill HUP it,

$ while true; do kill -HUP $(cat /tmp/test.pid); sleep 1s; done

Requests are done by hey command,

$ hey -n 1000 -c 100 -D test.json -m POST 'http://localhost:8080/wbt'

The results are the followings. Sometimes requests takes long time (but very small number) but no requests are lost.

Summary:
  Total:        25.3181 secs
  Slowest:      19.4102 secs
  Fastest:      0.0004 secs
  Average:      1.6511 secs
  Requests/sec: 39.4974
  Total data:   564877 bytes
  Size/request: 564 bytes

Status code distribution:
  [200] 1000 responses

Response time histogram:
  0.000 [1]     |
  1.941 [623]   |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  3.882 [259]   |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  5.823 [86]    |∎∎∎∎∎∎
  7.764 [6]     |
  9.705 [0]     |
  11.646 [0]    |
  13.587 [0]    |
  15.528 [0]    |
  17.469 [0]    |
  19.410 [25]   |∎∎

Latency distribution:
  10% in 0.0029 secs
  25% in 0.0049 secs
  50% in 0.0309 secs
  75% in 1.9808 secs
  90% in 5.0027 secs
  95% in 5.0092 secs
  99% in 19.4014 secs

For hot-deploying, support `lestrrat/go-server-starter`.
Graceful shutdown is done by Go1.8 new feature.
@cubicdaiya
Copy link
Contributor

@tcnksm Test is still failure.

@cubicdaiya cubicdaiya merged commit 5c265fa into master Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants