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

Instance is getting slow upon failed geoip db update #6381

Closed
kontrollanten opened this issue May 7, 2024 · 2 comments · Fixed by #6402
Closed

Instance is getting slow upon failed geoip db update #6381

kontrollanten opened this issue May 7, 2024 · 2 comments · Fixed by #6402
Labels
Status: Waiting for answer Waiting issue author answer Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor Type: Performance

Comments

@kontrollanten
Copy link
Contributor

kontrollanten commented May 7, 2024

Describe the current behavior

Our instances fails to download the geoip db, which seems to slow down the whole server. Upon start the response time is OK, but then it seems to add on response time and then gets unresponsive. When disabling geoip in the config the server works well.

Steps to reproduce

  1. Fail to download geoip city db.
  2. Have a lot of concurrent watchers.
  3. Watch the response time get longer and longer.

Describe the expected behavior

Peertube should handle failed geoip db downloads gently and continue to work just as when the geoip config is disabled.

Additional information

  • PeerTube instance:

    • URL:
    • Version: 6.1.0
    • NodeJS version:
    • Ffmpeg version:
  • Browser name, version and platforms on which you could reproduce the bug:

  • Link to browser console log if relevant:

  • Link to server log if relevant (journalctl or /var/www/peertube/storage/logs/):

@kontrollanten kontrollanten changed the title Instance Instance is getting slow upon failed geoip db update May 7, 2024
@Chocobozzz
Copy link
Owner

Fail to download geoip city db.

Can you paste the error log so see what type of failure it is?

@Chocobozzz Chocobozzz added the Status: Waiting for answer Waiting issue author answer label May 16, 2024
@kontrollanten
Copy link
Contributor Author

Sorry, here it comes:

{
  "err":{
    "stack":"Error: Invalid Extended Type at offset 0 val 7\n    at Decoder.decode (/var/www/peertube/versions/peertube-v6.1.0-c1/node_modules/mmdb-lib/lib/decoder.js:52:23)\n    at parseMetadata (/var/www/peertube/versions/peertube-v6.1.0-c1/node_modules/mmdb-lib/lib/metadata.js:14:30)\n    at Reader.load (/var/www/peertube/versions/peertube-v6.1.0-c1/node_modules/mmdb-lib/lib/index.js:36:54)\n    at new Reader (/var/www/peertube/versions/peertube-v6.1.0-c1/node_modules/mmdb-lib/lib/index.js:29:14)\n    at Object.open (/var/www/peertube/versions/peertube-v6.1.0-c1/node_modules/maxmind/lib/index.js:37:20)\n    at async GeoIP.initReadersIfNeeded (file:///var/www/peertube/versions/peertube-v6.1.0-c1/dist/core/helpers/geo-ip.js:97:35)\n    at async GeoIP.safeIPISOLookup (file:///var/www/peertube/versions/peertube-v6.1.0-c1/dist/core/helpers/geo-ip.js:21:13)\n    at async VideoViewerStats.addLocalViewer (file:///var/www/peertube/versions/peertube-v6.1.0-c1/dist/core/lib/views/shared/video-viewer-stats.js:32:50)\n    at async VideoViewsManager.processLocalView (file:///var/www/peertube/versions/peertube-v6.1.0-c1/dist/core/lib/views/video-views-manager.js:21:9)\n    at async viewVideo (file:///var/www/peertube/versions/peertube-v6.1.0-c1/dist/core/controllers/api/videos/view.js:14:29)",
    "message":"Invalid Extended Type at offset 0 val 7"},
    "level":"error",
    "message":"Cannot get country/city information from IP.",
    "timestamp":"2024-05-14T20:52:09.322Z"
  }

We had 1 563 occurrences in 17 minutes. It should be possible to throttle it to run once each ten minutes or so.

@Chocobozzz Chocobozzz added Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor Type: Performance labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting for answer Waiting issue author answer Type: Bug 🐛 Confirmed bug, at least replicated once by another contributor Type: Performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants