简体   繁体   English

Heroku postgres负载很慢

[英]Heroku postgres is very slow under load

I'm deploying an app to the Heroku that uses php and heroku-postgres. 我正在使用php和heroku-postgres将应用程序部署到Heroku。 App performs about 70-80 queries to the small postgres database (about 10Mb). App对小型postgres数据库执行大约70-80次查询(大约10Mb)。

I did some load testing using apache bench with 50 concurrent requests. 我使用带有50个并发请求的apache bench进行了一些负载测试。 And I found that queries execution time is about 5-8 times slower than without any load. 我发现查询执行时间比没有任何负载慢大约5-8倍。 Of course, I checked that tables have correct indexes and queries use them. 当然,我检查了表有正确的索引,查询使用它们。

I also tried different heroku-postgres plans, but the problem still exists. 我也尝试了不同的heroku-postgres计划,但问题仍然存在。

I also tried different heroku-postgres plans, but the problem still exists. 我也尝试了不同的heroku-postgres计划,但问题仍然存在。

Make sure the heroku-postgres plan uses the same region as the Heroku app! 确保heroku-postgres计划使用与Heroku应用程序相同的区域! I spent a week trying to figure out why my app in the EU needed 80ms instead of 0.2ms to query my DB in the US. 我花了一个星期试图找出为什么我在欧盟的应用程序需要80毫秒而不是0.2毫秒来查询我在美国的数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM