Skip to content

Commit 9802ec4

Browse files
author
王发康
committed
Update code style, And update function add_peer(),remove_peer() and now support load balance algorithm: ip_hash/round_robin/least_conn.
1 parent d9197a1 commit 9802ec4

File tree

5 files changed

+585
-560
lines changed

5 files changed

+585
-560
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,13 @@ add_peer
223223
`syntax: ok,err = upstream.add_peer(upstream,ip:port)`
224224

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

230+
```nginx
231+
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.
232+
```
228233

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

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

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

256+
```nginx
257+
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.
258+
```
249259

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

0 commit comments

Comments
 (0)