Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hits Count Issue #203

Closed
C3n7ral051nt4g3ncy opened this issue Dec 2, 2022 · 24 comments
Closed

Hits Count Issue #203

C3n7ral051nt4g3ncy opened this issue Dec 2, 2022 · 24 comments

Comments

@C3n7ral051nt4g3ncy
Copy link

Hey,

Thanks for the great work you did on hits.

My hits counter is not working since the last 48 hours.
Server issues?

Repo: https://github.com/C3n7ral051nt4g3ncy/Masto

@nelsonic
Copy link
Member

nelsonic commented Dec 3, 2022

@C3n7ral051nt4g3ncy thank you for reporting the disruption of service. 💔
We are investigating it now. 🧑‍💻 🔍

CC: @LuchoTurtle & @SimonLab time to add Monitoring+Alerts for QoS? 💭

@nelsonic nelsonic self-assigned this Dec 3, 2022
@nelsonic nelsonic moved this to 🏗 In progress in dwyl app kanban Dec 4, 2022
@SimonLab
Copy link
Member

SimonLab commented Dec 5, 2022

Database error:

** (exit) an exception was raised:
    ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 922ms.
    This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
  1. Ensuring your database is available and that you can connect to it
  2. Tracking down slow queries and making sure they are running fast enough
  3. Increasing the pool_size (although this increases resource consumption)
  4. Allowing requests to wait longer by increasing :queue_target and :queue_interval
See DBConnection.start_link/2 for more information

@SimonLab
Copy link
Member

SimonLab commented Dec 5, 2022

Looking directly at the log for the database on fly, it seems the postgres database is not available:

cmd/keeper.go:1526 failed to start postgres {"error": "postgres exited unexpectedly"}

@nelsonic
Copy link
Member

nelsonic commented Dec 5, 2022

@SimonLab Thanks for investigating. curious what sort of volume triggered this crash. 💭 🤷‍♂️
What do we need to do to get Postgres back online? 💭

@SimonLab
Copy link
Member

SimonLab commented Dec 5, 2022

Currently updating the postgres image with fly image update -a hits-db
Hopefully this will fix the issue.

Failed:
image

@nelsonic
Copy link
Member

nelsonic commented Dec 5, 2022

Ok. cool. thanks for documenting. 👍

@SimonLab
Copy link
Member

SimonLab commented Dec 5, 2022

This might be a possible reason for the issue:
image

https://fly.io/docs/elixir/getting-started/#important-ipv6-settings

I don't know if there is a way to rebuild the Dockfile with fly. I've added the line manually to the file

@SimonLab
Copy link
Member

SimonLab commented Dec 5, 2022

@SimonLab
Copy link
Member

SimonLab commented Dec 5, 2022

I think the free tier has reached its limit for the database and has switch to read only. similar to https://community.fly.io/t/why-cant-i-restart-db-for-some-reason-it-does-not-work-although-the-status-says-running/9121

@nelsonic I think we might need to scale up the database for it work properly again (I think that's the issue)

fly checks list -a hits-db

@nelsonic
Copy link
Member

nelsonic commented Dec 6, 2022

Looks like we need to spend a bit of money and upgrade the Postgres DB. 💸
Could you just check how much disk space it's using? 💭
Cause I don't think it's the RAM that's the issue ... 🤷‍♂️

@SimonLab
Copy link
Member

SimonLab commented Dec 6, 2022

I've added a comment on Fly: https://community.fly.io/t/postgres-failed-to-connect-to-proxy-context-deadline-exceeded/8141/17

@nelsonic
Copy link
Member

nelsonic commented Dec 6, 2022

Ok, what do we need to do next. Can we re-size the volume used to by the hits-db instance so that PostgreSQL has more space? 💭

@nelsonic nelsonic assigned SimonLab and unassigned nelsonic Dec 6, 2022
@SimonLab
Copy link
Member

SimonLab commented Dec 6, 2022

At the end I don't think it's a "scale" issue.
This post as the same error: https://community.fly.io/t/failure-postgres-stopped-working-failed-to-connect-to-proxy-context-deadline-exceeded/5432 and it looks like the issue is linked to proxy on Fly.

If I haven't have any answer from #203 (comment) soon I might write a newer post and hopefully get a reply

@nelsonic
Copy link
Member

nelsonic commented Dec 6, 2022

Hmmmm ... that's not great. Do you think that having the DB replicated across 2 (or more) Fly.io regions would mitigate the issue in future?

@SimonLab
Copy link
Member

SimonLab commented Dec 6, 2022

I'm not sure what is the recommended way for manging postgres app to make sure the data are always available, I need to research the documenatation (https://fly.io/docs/reference/postgres-on-nomad/#about-fly-postgres) and the community (https://community.fly.io/) to have a better understanding

@nelsonic
Copy link
Member

nelsonic commented Dec 6, 2022

@SimonLab looking forward to your conclusion. Happy to adopt any protocol you determine. 👌

@SimonLab
Copy link
Member

SimonLab commented Dec 7, 2022

Created a new topic: https://community.fly.io/t/postgres-unavailable-context-deadline-exceeded/9227

@C3n7ral051nt4g3ncy
Copy link
Author

@SimonLab @nelsonic: Everything seems to be working now. 🥇 👍 🚀

@nelsonic
Copy link
Member

nelsonic commented Dec 9, 2022

Confirmed working: HitCount

@SimonLab should we still check disk usage on the hits-db instance? 🔍

@nelsonic nelsonic moved this from 🏗 In progress to ⏳Awaiting Review in dwyl app kanban Dec 9, 2022
@SimonLab
Copy link
Member

SimonLab commented Dec 9, 2022

running fly checks list -a hits-db
checkDisk: 8.03 GB (82.1%) free space on /data/ (50.07µs)[✓]

@nelsonic

This comment was marked as resolved.

@SimonLab
Copy link
Member

SimonLab commented Dec 9, 2022

(82.1%) free space

I understand from these that there is a lot of available space still, no?

@nelsonic
Copy link
Member

nelsonic commented Dec 9, 2022

Yeah seems like the server has 50GB. 👌
That should be more than "enough" for the foreseeable future. ⏳
Closing. ✅

Thanks again @SimonLab ❤️

@nelsonic nelsonic closed this as completed Dec 9, 2022
Repository owner moved this from ⏳Awaiting Review to ✅ Done in dwyl app kanban Dec 9, 2022
@C3n7ral051nt4g3ncy
Copy link
Author

Thanks to all!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants