当前位置:网站首页>mod_ WSGI + pymssql path SQL server seat

mod_ WSGI + pymssql path SQL server seat

2022-07-06 19:50:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm the king of the whole stack .

by pymssql access SQL Server moment , directly python Implementation without problems . by mod_wsgi and Apache When deployed . All requests are found hang Then query the database .

adopt google Found the answer , thank google, Please refer to :https://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API

Briefly ,mod_wsgi For each virtual host and app mount point Create a sub interpreter.python There is a famous GIL, Through C extension Visit GIL State when , There is only the first sub interpreter To work properly , Suppose you use the possible sub interpreter May cause deadlock or crash, because pymssql It's a C extension So there will be this problem , The solution is . Add configuration items :

WSGIApplicationGroup %{GLOBAL}

Force this app Use the first one sub interpreter, bring GIL Normal work . After finishing ,mod_wsgi everything ok.

Copyright notice : This article is an original blog article , Blog , Without consent , Shall not be reproduced .

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117139.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061146428645.html