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

常驻进程注意事项 #34

Open
storyflow opened this issue Jul 18, 2018 · 2 comments
Open

常驻进程注意事项 #34

storyflow opened this issue Jul 18, 2018 · 2 comments

Comments

@storyflow
Copy link
Owner

No description provided.

@storyflow
Copy link
Owner Author

storyflow commented Jul 18, 2018

数据库连接对象 $dblink 虽然存在,但是数据库连接会断掉。

  1. 隔一短时间(小于超时时间),置空 $dblink = null
  2. 执行前检查下数据库连接是否正常:mysqli_ping
  3. 走http请求调用接口,来避免超时

@lifei6671
Copy link

最近使用Redis的长连接,底层用的是C写的PHPRedis扩展,会存在连接被服务器端主动关闭导致出现“read error on connection”错误,解决方案也是ping一下检查连接是否正常。

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

No branches or pull requests

2 participants