简体   繁体   中英

Heroku postgres is very slow under load

I'm deploying an app to the Heroku that uses php and heroku-postgres. App performs about 70-80 queries to the small postgres database (about 10Mb).

I did some load testing using apache bench with 50 concurrent requests. And I found that queries execution time is about 5-8 times slower than without any load. 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.

I also tried different heroku-postgres plans, but the problem still exists.

Make sure the heroku-postgres plan uses the same region as the Heroku app! 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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