Back

Help Center

Ask questions and help others in this forum.
TOPIC | Are dragons aged via cron jobs?
I was wondering if cron jobs were being used to handle aging.
I was wondering if cron jobs were being used to handle aging.
I know what you mean but dragons are aged every day at 00:00 server time.
I know what you mean but dragons are aged every day at 00:00 server time.
They are!
They are!
I'm curious why you went that route as opposed to using datetime fields in the database? One field for the dragon's actual creation date, one field for the dragon's age (to be modified with scrolls of maturity for example). Then if a dragon has passed its point of aging, the next viewer could trigger the image update, rather than waiting on a cron job to handle in batches.
I'm curious why you went that route as opposed to using datetime fields in the database? One field for the dragon's actual creation date, one field for the dragon's age (to be modified with scrolls of maturity for example). Then if a dragon has passed its point of aging, the next viewer could trigger the image update, rather than waiting on a cron job to handle in batches.
@Undel Bump
@Undel Bump
@Xhaztol pingbump
@Xhaztol pingbump
@rykos More than likely they have certain flags set, not just an image update, indicating whether or not it's an adult - rather than calculating this by time whenever a dragon is used, it's probably set during the aging cron.

Alternatively their methods of updating might be too intense to do it constantly throughout the day, and a cron mass growing might lessen the load on database connection by doing it all at once rather than constantly whenever a dragon was viewed or used.

Either way I doubt the devs are going to come out and talk about the technical part of their implementation in that manner. lol
@rykos More than likely they have certain flags set, not just an image update, indicating whether or not it's an adult - rather than calculating this by time whenever a dragon is used, it's probably set during the aging cron.

Alternatively their methods of updating might be too intense to do it constantly throughout the day, and a cron mass growing might lessen the load on database connection by doing it all at once rather than constantly whenever a dragon was viewed or used.

Either way I doubt the devs are going to come out and talk about the technical part of their implementation in that manner. lol
A mass cron will eventually be the undoing of the site, leading to a great deal of downtime each time the cron is run. Additionally, those same flags could be set on a per-view/per-load basis. As an example: [code] const ADULT_AGE = 5; $now = new DateTime(); $hatch_day = new DateTime($dragon->hatch_day); $age = $hatch_day->diff($now)->format('%a'); if (!$dragon->is_adult && $age >= ADULT_AGE) { // Run query to set flags // Queue process to regenerate image // etc. } [/code] Maybe they won't come out and talk about it, but it doesn't hurt to offer tips on things you've come across before... Some mistakes aren't worth repeating.
A mass cron will eventually be the undoing of the site, leading to a great deal of downtime each time the cron is run.

Additionally, those same flags could be set on a per-view/per-load basis. As an example:
Code:
const ADULT_AGE = 5; $now = new DateTime(); $hatch_day = new DateTime($dragon->hatch_day); $age = $hatch_day->diff($now)->format('%a'); if (!$dragon->is_adult && $age >= ADULT_AGE) { // Run query to set flags // Queue process to regenerate image // etc. }

Maybe they won't come out and talk about it, but it doesn't hurt to offer tips on things you've come across before... Some mistakes aren't worth repeating.
[quote]WE recently switched to a system where hatchlings age on the hour rather than on the day. The massive amount of hatchlings aging during the daily rollover was murdering our server, and the reason we've been going down for "maintenance" for 10 minutes every night during that time. :-)[/quote] From this thread: http://flightrising.com/main.php?board=help&id=90864&p=mb I don't know if the information is outdated, however, being 13 days old, and someone mentions at the end that they switched back to Midnight. Ahh!
Quote:
WE recently switched to a system where hatchlings age on the hour rather than on the day. The massive amount of hatchlings aging during the daily rollover was murdering our server, and the reason we've been going down for "maintenance" for 10 minutes every night during that time. :-)

From this thread: http://flightrising.com/main.php?board=help&id=90864&p=mb

I don't know if the information is outdated, however, being 13 days old, and someone mentions at the end that they switched back to Midnight. Ahh!
Exactly. 10 minutes with less than 100,000 dragons. 100,000 dragons in less than a month. Imagine how high that number will grow in 6 months. A year.

If the aging is still done by cron on-the-hour, the hit on the database will still be taxing to a degrading point. Especially since the number of dragons hatched per hour is not a perfectly distributed amount. You will have some chunks of hours that are heavily saturated with aging throughout the day.
Exactly. 10 minutes with less than 100,000 dragons. 100,000 dragons in less than a month. Imagine how high that number will grow in 6 months. A year.

If the aging is still done by cron on-the-hour, the hit on the database will still be taxing to a degrading point. Especially since the number of dragons hatched per hour is not a perfectly distributed amount. You will have some chunks of hours that are heavily saturated with aging throughout the day.