Cloud SQL socket open failed with error: No such file or directory

…衆ロ難τιáo~ 提交于 2019-12-12 13:18:26

问题


I have a Django app on App Engine that connects to a Cloud Sql server.

Recently, some of the requests started to raise the following error from MySQLdb:

OperationalError: (2062, 'Cloud SQL socket open failed with error: No such file or directory')

The error is raised sporadically so it's hard to debug.


回答1:


Found the answer here.

Stating from GAE 1.9.5, the number of concurrent db request per instance is limited to 12. The solution was to limit the number of concurrent requests per instance to 12, by changing app.yaml:

automatic_scaling:
  max_concurrent_requests: 12

For those who don't use GAE Modules or Automatic Scaling, the solution may be to disable concurrent requests completely by setting threadsafe: false. Note that this might dramatically increase the number of instances.

Another solution is to use some kind of a DB connection pool with a limited number of simultaneous connections. I haven't tried it myself.



来源:https://stackoverflow.com/questions/26155818/cloud-sql-socket-open-failed-with-error-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!