-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
add axios cached dns resolve to monitor #1598
add axios cached dns resolve to monitor #1598
Conversation
@gregdev Wow! I wonder if this is what's causing our Uptime-Kuma instance performance to be so abismal. We have over 300 monitors and recently switched from Host IP's to Hostnames with DNS. After making that change 👍🏻 to get this merge |
package.json
Outdated
@@ -78,6 +79,7 @@ | |||
"command-exists": "~1.2.9", | |||
"compare-versions": "~3.6.0", | |||
"dayjs": "~1.10.8", | |||
"esm": "^3.2.25", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? This package hasn't been updated since 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to recent comments, that project was abandoned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes unfortunately this is required by the axios-cached-dns-resolve lib. It's required by knex so is already installed with Uptime Kuma.
I didn't do any testing around frontend performance, but anecdotally my instance seems to load much quicker now. |
@louislam Thoughts on this? |
Since esm was abandoned before Node.js 14 came out, I have no confidence in this package. May need to know more how it works. My guess is the library converts a ES module into a CommonJS module in runtime.
Also I think we should run axios-cached-dns-resolve's unit test with |
I tested a fork which reverts their own commit and turn it back to a node compatible ESM, and it seems to work okay. But I'm not sure if it's worth the trouble since it also works now and we are already using the esm package. |
It looks like modules management in Node.js is a lot more complex then I thought... I didn't know import() function can import some kind of ES6 modules. |
ESM-Wallaby seems like the way to go. I asked in the library repo about non-esm support, more info here: tcollinsworth/axios-cached-dns-resolve#25 (comment) |
After added their test code into our project. I am not sure why the auto-tests keep failing randomly. But I also can't see such problem in my local environment. For my experience, GitHub Actions performance is very bad sometimes, it kept failing while it was doing e2e testing for unknown reason. However, the test that I copied from axios-cached-dns-resolve doesn't seem to be that complex. So I don't know which part of it is gone wrong. |
…d-dns-resolve # Conflicts: # package-lock.json # package.json
…e' into feature/axios-cached-dns-resolve # Conflicts: # package-lock.json # package.json
I think it is due to the GitHub Actions performance issue, so let's merge it and test in beta. Thanks for the pr. |
New solution: #1853 |
Description
Added in axios-cached-dns-resolve for monitor requests so that DNS lookups are cached.
Fixes #628
Type of change
Please delete any options that are not relevant.
Checklist
(including JSDoc for methods)
Screenshots
This is one of my monitors over 24 hours, on an Uptime Kuma instance with 170 monitors running on an AWS EC2 t3a-micro instance. I switched to this patch at around 22:00: