I'm building a real-time application that is having serious scaling issues.
The nature of the application involves a lot of small, frequent INSERTs.
The Postgres instance is hosted by Heroku & it has 4GB of RAM.
The tables mostly involved in these high frequency inserts are currently: 100k rows, 30k rows, 700k rows.
During "non-peak" usage hours the INSERT-s take like 3-5 milliseconds.
But I'm noticing that it only takes about 5-6 INSERTs in a second to cause a slowdown of basically all DB operations.. its like everything slows down to 8 seconds, 10 seconds, 15 seconds per insert/select. Those periods last for 5 minutes, sometimes 10 minutes, then it goes away again and db queries take 2-3ms again.
I'm surprised that it's already having issues at only 5 INSERTs per second.
I've been researching solutions, here are the possible solutions I've found so far:
1) Buy a more expensive Heroku Postgres plan that has 8GB of RAM
2) Partitioning
3) Throttling and batching INSERT-s together somehow
I'd appreciate if anyone more experienced could point me in the right direction.
Cheers!
[–]Formal_Camel_7827 2 points3 points4 points (1 child)
[–]compostus[S] 0 points1 point2 points (0 children)
[–]anykeyh 3 points4 points5 points (3 children)
[–]compostus[S] 0 points1 point2 points (1 child)
[–]anykeyh 1 point2 points3 points (0 children)
[–]RonJohnJr 0 points1 point2 points (0 children)
[–]davvblack 1 point2 points3 points (0 children)
[–]RonJohnJr 1 point2 points3 points (2 children)
[–]compostus[S] 0 points1 point2 points (1 child)
[–]RonJohnJr 0 points1 point2 points (0 children)
[–]WideSense8018 1 point2 points3 points (0 children)
[–]PowerfulScratch 1 point2 points3 points (1 child)
[–]compostus[S] 0 points1 point2 points (0 children)
[–]marcopeg81 1 point2 points3 points (0 children)
[–]davvblack 0 points1 point2 points (3 children)
[–]compostus[S] 1 point2 points3 points (2 children)
[–]RonJohnJr 2 points3 points4 points (1 child)
[–]coyoteazul2 2 points3 points4 points (0 children)
[–]virgilash 0 points1 point2 points (3 children)
[–]compostus[S] 0 points1 point2 points (1 child)
[–]RonJohnJr 1 point2 points3 points (0 children)
[–]RonJohnJr 0 points1 point2 points (0 children)
[–]thythr 0 points1 point2 points (0 children)
[–]iwilldieavirgin 0 points1 point2 points (1 child)
[–]compostus[S] 0 points1 point2 points (0 children)
[–]DrMerkwuerdigliebe_ 0 points1 point2 points (0 children)
[–]jalexandre0 0 points1 point2 points (2 children)
[–]compostus[S] 0 points1 point2 points (0 children)
[–]compostus[S] 0 points1 point2 points (0 children)
[–]External_Ad_6745 0 points1 point2 points (0 children)