- 论坛徽章:
- 3
|
本帖最后由 venux 于 2017-11-13 16:41 编辑
flask 写的一个项目,有150个用户,python 通过pymssql 去读取2台服务器上sql数据库的数据直接展示到flask页面中,用的for循环每个用户去执行,,,方法内部有6个sql语句,其中一台5条,另一台1条, 每次150个循环执行完毕要好久,因为前端用nginx代理,就超时报错 uwsgi错误- uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 296]
复制代码 nginx错误
- 16630#0: *10376 upstream timed out (110: Connection timed out) while reading response header from upstream,
复制代码 nginx配置和uwsgi.ini都改了,还是不行,根本问题还是在那个请求数据的方法上,请问有没有其他方式快速读取sqlserver的
下面是执行sql的几行语句,
- <blockquote>sql="select u.badgenumber,u.name,d.DeptName, c.checktime ,i.alias ,i.sn from userinfo u,departments d, checkinout c ,iclock i where u.userid=%s and u.defaultdeptid=d.DeptID and u.badgenumber=c.pin and c.sn_name=i.sn"%userid
复制代码 |
|