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

如何实现多个worker之间的资源共享?比如文件描述符和socket连接或者文件? #57

Closed
joostshao opened this issue Mar 9, 2016 · 2 comments
Labels

Comments

@joostshao
Copy link

如何实现多个worker之间的资源共享?比如文件描述符和socket连接或者文件?

@walkor
Copy link
Owner

walkor commented Mar 9, 2016

在主进程中创建的资源子进程默认继承共享。另外通过unix socket配合socket_sendmsg也能实现进程间resource描述符传递共享。
但是有些资源共享会有问题,比如数据库连接,mysql服务端返回数据理论上其它共享的进程上也有能读到,导致mysql连接异常。
尽量不要资源共享,最好是每个worker进程自己创建独享。

@joostshao
Copy link
Author

多谢,资源隔离,自己管理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants