ngx_http_dyups_module
ngx_http_dyups_module copied to clipboard
关于多个worker同步upstream更新信息失败的问题
看了代码,在更新upstream信息时是其中一个worker先主动更新,其他worker从共享内存处获取msg来同步更新upstream。若其中某些worker更新信息失败,造成不一致,应该怎么解决?我见代码里没有相应的解决方法。
@yzprofile @chobits 大佬们可以解答一下小弟的疑惑嘛?
this module do not work normally when has worker processes more than two. i want to know when will be updated.
这个问题在多核多worker下出现了同步的问题,请问这个怎么解决呀~~~
这个问题在多核多worker下出现了同步的问题,请问这个怎么解决呀~~~
你说的同步问题具体是什么问题?具体是怎么造成的?其实程序正常运行的情况下应该是不会出现同步的问题的吧,感觉和多核无关。
this module do not work normally when has worker processes more than two. i want to know when will be updated.
I test this module with multiple worker processes but nerver found any problems.So what is your specified problem ?
@huhaipeng
I'm using zone
in upstream context as follow.
upstream my_ups {
...
server ... ;
zone ...;
...
}
location my_loc {
...
set $dyups my_ups;
proxy_pass http://$dyups;
...
}
When updating themy_ups
upstream context, a new upstream context is created but zone
is not initialized.
One worker process that received request is updated and the others are not updated.
This is what I have checked so far.
Please let me know if I am misunderstanding. Thank for comment.
可以考虑在init_worker阶段给每个worker写个定时器,在定时器中处理upstream更新。