Reduce overhead incurred by enabling debug output.#7674
Reduce overhead incurred by enabling debug output.#7674ywkaras wants to merge 1 commit intoapache:masterfrom
Conversation
|
Replaces #7452 . |
|
Performance Testing Test server: Intel Xeon CPU ES-2683 v4 @ 2.10GHz, 64 logical CPU cores. Baseline build, master commit a5a8523 records.config: remap.config: Command to start TS: I ran this script to create the object /fake in the cache: Traffic generation command (for all tests): Changed debug.enabled to 1: Switched to build with the changes in this PR, https://github.com/ywkaras/trafficserver/tree/FasterDiags2_20210409, set debug.enaabled to 0: Changed debug.enabled to 1: Changed debug.enabled to 3: It seems impossible that performance is better with debug.enabled set to 3 versus 0. |
| } | ||
| ink_assert(!r || !r->round_robin || !r->reverse_dns); | ||
| ink_assert(failed || !r->round_robin || r->app.rr.offset); | ||
| ink_assert(failed || ((r != nullptr) && (!r->round_robin || r->app.rr.offset))); |
There was a problem hiding this comment.
Needed this change to fix a Clang Analyzer error.
| tsapi char *_TSstrdup(const char *str, int length, const char *path); | ||
| tsapi void *_TSmalloc(size_t size, const char *path); | ||
| tsapi void *_TSrealloc(void *ptr, size_t size, const char *path); | ||
| tsapi char *_TSstrdup(const char *str, int64_t length, const char *path); |
There was a problem hiding this comment.
The inclusion of ts.h in DiagsTypes.h required this change.
cc1d6a2 to
97d23dd
Compare
4475207 to
8772915
Compare
2475a06 to
9677574
Compare
|
@calavera after I rebase this could you review it or ask someone else at Linkedin to look at it? |
2feebbb to
e2a0133
Compare
3c88860 to
15a22a4
Compare
|
@ywkaras is going to fix the conflict and we are going to merge. We need another PR to clean up the APIs both internally and externally. |
|
Hmmm, so I don't quite understand this. Is the point here that I can do "traffic_server -T http" and it has no cost vs not turning on -T ? Or is the point that having an obscure debug tag enabled, which rarely (if ever) triggers, has no cost? And why do we need a new TSDbg() if the changes are sufficient for the existing TSDebug() ? |
zwoop
left a comment
There was a problem hiding this comment.
I'm overall ok with this, it's a good approach. I don't mind those global registered control variables (static), and I'm pleased to see a consistent naming on them.
I'm ok with this approach, with two conditions:
- We mark TSDebug() (the public API) as deprecated for 10.0.0, and we delete TSDebug() in 11.0.
- We (and with we, I mean @ywkaras ) promise to finish the core refactoring, eliminating all Debug() calls in the core. This doesn't have to happen for 10.0.0, but I will be disappointed if it's not complete before 11.0.0.
In addition, this may be a good starting point for also documenting and normalizing the tag naming conventions for a future 10.0.0 and/or 11.0.0 release.
| */ | ||
| tsapi void TSDebugSpecific(int debug_flag, const char *tag, const char *format_str, ...) TS_PRINTFLIKE(3, 4); | ||
| extern int diags_on_for_plugins; | ||
| extern int diags_on_for_plugins; /* Do not use directly. */ |
There was a problem hiding this comment.
I feel reasonably strongly that for 10.0.0, we should:
- Mark TSDebug() deprecated here (such that it gives compiler warnings)
- Change all plugins in the core to use TSDbg() (to avoid warnings from # 1.
| #endif | ||
|
|
||
| extern inkcoreapi Diags *diags; | ||
| class DiagsPtr |
There was a problem hiding this comment.
I think for core use of Dbg(), we should assert, or at least warn when there is a duplication of a control (i.e. two or more versions of a debug label).
|
So @zwoop what's the short list of changes to get this merged? While we're young. Or alive. |
6e882fc to
201a1be
Compare
Setting proxy.config.diags.debug.enabled to 3 enables most core debug output (whose tag matches the debug regex), and plugin debug output from the new API macro TSDbg(). Setting it to 1 enables all (matching) debug output, but with the previous high overhead. Note that enabling a large qualtity of debug output will still have a big impact on performance.
|
OK @zwoop it's soup. |
|
@zwoop did you want to request changes, can you write up the specifics? Would you rather someone else reviewed it? I stopped pushing new commits to fix merge conflicts, as I don't want to put more effort into it if it's pocket vetoed. That's why it's currently marked as draft. |
|
[approve ci] |
1 similar comment
|
[approve ci] |
|
@bryancall No point in resolving CI issues with this for now, the problem is getting it reviewed properly. |
Setting proxy.config.diags.debug.enabled to 3 enables most core debug output (whose tag matches the debug
regex), and plugin debug output from the new API macro TSDbg(). Setting it to 1 enables all (matching) debug
output, but with the previous high overhead.
Note that enabling a large qualtity of debug output will still have a big impact on performance.