Skip to content

Commit

Permalink
Update code style, And update function add_peer(),remove_peer() and n…
Browse files Browse the repository at this point in the history
…ow support load balance algorithm: ip_hash/round_robin/least_conn.
  • Loading branch information
王发康 committed Aug 12, 2015
1 parent d9197a1 commit 9802ec4
Show file tree
Hide file tree
Showing 5 changed files with 585 additions and 560 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,13 @@ add_peer
`syntax: ok,err = upstream.add_peer(upstream,ip:port)`

Add a server to back-end peers. if back-end peers is exist will return err and notes the peer is exist.
it's suitable for ip_hash or round_robin.
it's suitable for ip_hash or round_robin and least_conn.
Warning:
`if you are using a least_conn and you should update something to below`

```nginx
Modified macro variable 'NGX_HTTP_UPSTREAM_LEAST_CONN' 1 ,it's default 0 at 'lua-upstream-nginx-module/src/ngx_http_lua_upstream_module.h' file.
```

[Back to TOC](#table-of-contents)

Expand All @@ -244,8 +249,13 @@ remove_peer
`syntax: ok,err = upstream.remove_peer(upstream,ip:port)`

Remove a server to back-end peers. if back-end peers not exist will return err and notes the peer is not found.
it's suitable for ip_hash or round_robin.
it's suitable for ip_hash or round_robin and least_conn.
Warning:
`if you are using a least_conn and you should update something to below`

```nginx
Modified macro variable 'NGX_HTTP_UPSTREAM_LEAST_CONN' 1 ,it's default 0 at 'lua-upstream-nginx-module/src/ngx_http_lua_upstream_module.h' file.
```

[Back to TOC](#table-of-contents)

Expand Down
Loading

0 comments on commit 9802ec4

Please sign in to comment.