[英]django.db.utils.OperationalError: FATAL: sorry, too many clients already
I am running a Django app on Django's development server with PostgreSQL as the backend database.我在 Django 的开发服务器上运行 Django 应用程序,PostgreSQL 作为后端数据库。 I got this error:
我收到了这个错误:
django.db.utils.OperationalError: FATAL: sorry, too many clients already
when I was doing a load testing using Locust.当我使用 Locust 进行负载测试时。 My Locust script runs the test with 100 concurrent clients:
我的 Locust 脚本使用 100 个并发客户端运行测试:
env.runner.start(100, spawn_rate=100, wait=True)
I have seen several answers on SO, such as:我在 SO 上看到了几个答案,例如:
From those threads, I think I understand the cause of the error, but I am still very confused.从这些线程中,我想我理解了错误的原因,但我仍然很困惑。 How does it scale in real life if PostgreSQL cannot handle even 100 concurrent clients?
如果 PostgreSQL 甚至无法处理 100 个并发客户端,它在现实生活中如何扩展? Does it have anything to do with the fact that I am using a development server?
这与我使用开发服务器有关吗? Will it help if I use Gunicorn?
如果我使用 Gunicorn 会有帮助吗? If some connection clean-up is needed, is it something that I should implement in the Locust script?
如果需要一些连接清理,我应该在 Locust 脚本中实现吗? I am quite new in this area, so I apologize if the answers to those questions are obvious.
我在这个领域很新,所以如果这些问题的答案很明显,我很抱歉。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.