Cloud SQL套接字打开失败,出现错误:没有这样的文件或目录 [英] Cloud SQL socket open failed with error: No such file or directory

查看:102
本文介绍了Cloud SQL套接字打开失败,出现错误:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在App Engine上安装了一个连接到Cloud Sql服务器的Django应用程序。

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

最近,有些请求开始从 MySQLdb

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.

推荐答案

找到答案这里

从GAE 1.9.5说明,每个实例的并发数据库请求数 / strong>是限于12 。解决方案是通过更改 app.yaml 将每个实例的并发请求数限制为12:

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

不能使用GAE模块或自动缩放,解决方案可能是通过设置 threadsafe:false 完全禁用并发请求。请注意,这可能会大大增加实例数量。

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.

这篇关于Cloud SQL套接字打开失败,出现错误:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆