-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
fix(core): Reduce logging overhead for levels that do not output #7479
Conversation
all current logging calls execute `callsites()` to figure out what code tried to log. This happens even for logging methods that aren't supposed to create any output. Under moderate load, this can take up quite a lot of resources. This PR changes the logger to make all ignorable logging methods a No-Op.
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Make sure to check off this list before asking for review. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #7479 +/- ##
==========================================
- Coverage 33.55% 33.55% -0.01%
==========================================
Files 3398 3398
Lines 207577 207582 +5
Branches 22421 22419 -2
==========================================
+ Hits 69649 69650 +1
- Misses 136806 136810 +4
Partials 1122 1122
☔ View full report in Codecov by Sentry. |
1 flaky test on run #2532 ↗︎
Details:
cypress/e2e/18-user-management.cy.ts • 1 flaky test
Review all test suite changes for PR #7479 ↗︎ |
✅ All Cypress E2E specs passed |
✅ All Cypress E2E specs passed |
all current logging calls execute `callsites()` to figure out what code tried to log. This happens even for logging methods that aren't supposed to create any output. Under moderate load, this can take up quite a lot of resources. This PR changes the logger to make all ignorable logging methods a No-Op. In a small benchmark with a simple webhook, with log-level set to `warn`, and using `ab -c 50 -n 500 http://localhost:5678/webhook/testing`, these were the response times: ### Before ![Before](https://github.com/n8n-io/n8n/assets/196144/01680fd9-3d2a-4f7f-bb1c-5b03bd7d5bc3) ### After ![After](https://github.com/n8n-io/n8n/assets/196144/ccacb20a-48ca-455a-a8cb-098c9c0e352e)
## [1.11.2](https://github.com/n8n-io/n8n/compare/n8n@1.11.1...n8n@1.11.2) (2023-10-23) ### Bug Fixes * **core:** Handle gzip and deflate compressed request payloads ([#7461](#7461)) ([f43ff71](f43ff71)) * **core:** Prevent false stalled jobs in queue mode from displaying as errored ([#7435](#7435)) ([465a952](465a952)) * **core:** Reduce logging overhead for levels that do not output ([#7479](#7479)) ([010aa57](010aa57)) * **editor:** Allow importing the same workflow multiple times ([#7458](#7458)) ([33e3df8](33e3df8)), closes [#7457](#7457) * **editor:** Fix canvas selection breaking after interacting with node actions ([#7466](#7466)) ([90ce8de](90ce8de)) * **editor:** Fix connections disappearing after reactivating canvas and renaming a node ([#7483](#7483)) ([b0bd0d8](b0bd0d8)) * **editor:** Open only one tab with plans page ([#7377](#7377)) ([d14e9cb](d14e9cb)) * **Ldap Node:** Fix issue with connections not closing correctly ([#7432](#7432)) ([60ca02e](60ca02e)) * **MySQL Node:** Resolve expressions in v1 ([#7464](#7464)) ([2b18909](2b18909)) * **TheHive 5 Node:** Observable encoding in alert > create fix ([#7450](#7450)) ([b9547ad](b9547ad)) Co-authored-by: netroy <netroy@users.noreply.github.com>
Got released with |
all current logging calls execute `callsites()` to figure out what code tried to log. This happens even for logging methods that aren't supposed to create any output. Under moderate load, this can take up quite a lot of resources. This PR changes the logger to make all ignorable logging methods a No-Op. In a small benchmark with a simple webhook, with log-level set to `warn`, and using `ab -c 50 -n 500 http://localhost:5678/webhook/testing`, these were the response times: ### Before ![Before](https://github.com/n8n-io/n8n/assets/196144/01680fd9-3d2a-4f7f-bb1c-5b03bd7d5bc3) ### After ![After](https://github.com/n8n-io/n8n/assets/196144/ccacb20a-48ca-455a-a8cb-098c9c0e352e)
## [1.12.1](https://github.com/n8n-io/n8n/compare/n8n@1.12.0...n8n@1.12.1) (2023-10-23) ### Bug Fixes * **core:** Do not return `inviteAcceptUrl` in response if email was sent ([#7465](#7465)) ([4a1f4da](4a1f4da)) * **core:** Handle gzip and deflate compressed request payloads ([#7461](#7461)) ([75981fb](75981fb)) * **core:** Reduce logging overhead for levels that do not output ([#7479](#7479)) ([4a1641d](4a1641d)) * **Customer.io Node:** Fix api endpoint when using EU region ([#7485](#7485)) ([ea1b503](ea1b503)), closes [#7484](#7484) * **editor:** Allow importing the same workflow multiple times ([#7458](#7458)) ([15e1737](15e1737)), closes [#7457](#7457) * **editor:** Fix canvas selection breaking after interacting with node actions ([#7466](#7466)) ([d84c367](d84c367)) * **editor:** Fix connections disappearing after reactivating canvas and renaming a node ([#7483](#7483)) ([368e3ee](368e3ee)) * **Google Sheets Node:** Append or update runs forever when without column headers ([#7463](#7463)) ([0d52490](0d52490)) * **MySQL Node:** Resolve expressions in v1 ([#7464](#7464)) ([70a10a9](70a10a9)) Co-authored-by: netroy <netroy@users.noreply.github.com>
# [1.13.0](https://github.com/n8n-io/n8n/compare/n8n@1.12.0...n8n@1.13.0) (2023-10-25) ### Bug Fixes * **core:** Do not return `inviteAcceptUrl` in response if email was sent ([#7465](#7465)) ([55c6a1b](55c6a1b)) * **core:** Ensure nodes post-processors run in the correct order ([#7500](#7500)) ([6f45298](6f45298)) * **core:** Fix `frontend.settings` external hook execution ([#7496](#7496)) ([774fe20](774fe20)) * **core:** Handle gzip and deflate compressed request payloads ([#7461](#7461)) ([83762e0](83762e0)) * **core:** Reduce logging overhead for levels that do not output ([#7479](#7479)) ([76c0481](76c0481)) * **Customer.io Node:** Fix api endpoint when using EU region ([#7485](#7485)) ([519680c](519680c)) * **editor:** Allow importing the same workflow multiple times ([#7458](#7458)) ([3c0a166](3c0a166)) * **editor:** Fix canvas selection breaking after interacting with node actions ([#7466](#7466)) ([bc47365](bc47365)) * **editor:** Fix connections disappearing after reactivating canvas and renaming a node ([#7483](#7483)) ([450e0cc](450e0cc)) * **Google Sheets Node:** Append or update runs forever when without column headers ([#7463](#7463)) ([ab6a9bb](ab6a9bb)) * **Microsoft SQL Node:** Prevent SQL injection ([#7467](#7467)) ([a739245](a739245)) * **MQTT Trigger Node:** Fix node causing a start up hang when active ([#7498](#7498)) ([baecb93](baecb93)) * **MySQL Node:** Resolve expressions in v1 ([#7464](#7464)) ([5c46bb0](5c46bb0)) * **Redis Node:** Fix adding sets data types ([#7444](#7444)) ([4e66023](4e66023)) * **Spreadsheet File Node:** Fix include empty cells not working with v2 ([#7505](#7505)) ([05e6f2a](05e6f2a)) ### Features * **core:** Add support for oauth based service accounts with UM SMTP ([#7311](#7311)) ([647372b](647372b)) * **editor:** Add PH tracking to event ([#7511](#7511)) ([c47d27d](c47d27d)) * **Facebook Lead Ads Trigger Node:** Add Facebook Lead Ads Trigger Node ([#7113](#7113)) ([ac814a9](ac814a9)) * **Ghost Node:** Add support for lexical format ([#7488](#7488)) ([7b1973c](7b1973c)) * **RSS Feed Trigger Node:** Add RSS feed trigger node ([#7386](#7386)) ([689360e](689360e)) Co-authored-by: netroy <netroy@users.noreply.github.com>
Setting methods to no-op exists for performance reasons: #7479
all current logging calls execute
callsites()
to figure out what code tried to log. This happens even for logging methods that aren't supposed to create any output. Under moderate load, this can take up quite a lot of resources. This PR changes the logger to make all ignorable logging methods a No-Op.In a small benchmark with a simple webhook, with log-level set to
warn
, and usingab -c 50 -n 500 http://localhost:5678/webhook/testing
, these were the response times:Before
After