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

Set Server.offline_since correctly #19

Merged
merged 1 commit into from
Nov 21, 2018
Merged

Set Server.offline_since correctly #19

merged 1 commit into from
Nov 21, 2018

Conversation

garncarz
Copy link
Owner

I can see there's more than 500 servers stored in the production DB. Old ones are not getting removed and are contacted again and again during periodic tasks. That's probably the reason why Datadog metrics regarding DB refreshement are at so low levels (even 0) and the whole system gets overworked.

@garncarz garncarz self-assigned this Nov 21, 2018
@garncarz
Copy link
Owner Author

✔️ Haha, this helped:

>>> from nogamespy import models
>>> models.remove_offline_entities()
[2018-11-21 15:48:17,920][DEBUG] nogamespy.models models.py:remove_offline_entities:168 | 3 offline players deleted.
[2018-11-21 15:48:17,923][DEBUG] nogamespy.models models.py:remove_offline_entities:171 | 518 servers went offline.
>>> models.remove_offline_entities()
>>> from nogamespy import settings
>>> settings.KEEP_OFFLINE_SERVERS_FOR_MINUTES = 0
>>> models.remove_offline_entities()
[2018-11-21 15:49:08,667][INFO] nogamespy.models models.py:remove_offline_entities:174 | 518 offline servers deleted.

@garncarz
Copy link
Owner Author

I needed to run the following, because there was a lot of periodic tasks waiting in the queue to be run. 😄 foreign_master_pulled metric jumped up to 39 and servers_refreshed even up to 97 (for a 20 minutes window).

$ docker-compose run redis redis-cli -h redis
redis:6379> flushdb
OK

@garncarz garncarz merged commit 98b2d3d into master Nov 21, 2018
@sonicpp
Copy link

sonicpp commented Nov 21, 2018

Will be vietcong1.eu db refreshed more often, or is it another issue? Sometimes there are players who left 30 minutes ago...

@garncarz
Copy link
Owner Author

@sonicpp Yes, it should be. Because refreshing information for 500+ servers (with majority of them unaccessible, connection probably waiting for time-out... it's UDP) took some time. 🙂

@garncarz garncarz deleted the offline_servers branch November 21, 2018 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants