Skip to content

fix(logger): increase max listeners of file transports to 20 - #5537

Merged
wemeetagain merged 1 commit into
unstablefrom
nflaig/fix-DailyRotateFile-max-listeners
May 30, 2023
Merged

fix(logger): increase max listeners of file transports to 20#5537
wemeetagain merged 1 commit into
unstablefrom
nflaig/fix-DailyRotateFile-max-listeners

Conversation

@nflaig

@nflaig nflaig commented May 24, 2023

Copy link
Copy Markdown
Member

Motivation

Closes #5529

Description

Increase max listeners of file transports to prevent MaxListenersExceededWarning warnings. Each child logger (logger.child) adds a new listener. Setting a reasonable limit to still detect potential memory leaks.

This workaround is also suggested in winstonjs/winston#2247 (comment) and seems appropriate in our case as based on winstonjs/winston#1685 (comment) it does not look like this is an issue, it should ok to increase max listeners limit to suppress the warnings.

@nflaig
nflaig requested a review from a team as a code owner May 24, 2023 17:12
@nflaig
nflaig marked this pull request as draft May 24, 2023 17:21
@github-actions

github-actions Bot commented May 24, 2023

Copy link
Copy Markdown
Contributor

Performance Report

鉁旓笍 no performance regression detected

Full benchmark results
Benchmark suite Current: 786abf4 Previous: 722ccb6 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 482.82 us/op 728.86 us/op 0.66
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 45.586 us/op 44.628 us/op 1.02
BLS verify - blst-native 1.2126 ms/op 1.2393 ms/op 0.98
BLS verifyMultipleSignatures 3 - blst-native 2.4775 ms/op 2.4856 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst-native 5.3103 ms/op 5.2215 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst-native 19.190 ms/op 18.989 ms/op 1.01
BLS aggregatePubkeys 32 - blst-native 25.682 us/op 25.306 us/op 1.01
BLS aggregatePubkeys 128 - blst-native 100.59 us/op 97.992 us/op 1.03
getAttestationsForBlock 56.404 ms/op 52.652 ms/op 1.07
isKnown best case - 1 super set check 255.00 ns/op 246.00 ns/op 1.04
isKnown normal case - 2 super set checks 251.00 ns/op 243.00 ns/op 1.03
isKnown worse case - 16 super set checks 250.00 ns/op 236.00 ns/op 1.06
CheckpointStateCache - add get delete 4.8860 us/op 4.8330 us/op 1.01
validate gossip signedAggregateAndProof - struct 2.7757 ms/op 2.7694 ms/op 1.00
validate gossip attestation - struct 1.3174 ms/op 1.2943 ms/op 1.02
pickEth1Vote - no votes 1.2328 ms/op 1.2253 ms/op 1.01
pickEth1Vote - max votes 11.003 ms/op 10.521 ms/op 1.05
pickEth1Vote - Eth1Data hashTreeRoot value x2048 8.4733 ms/op 8.7481 ms/op 0.97
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.233 ms/op 14.249 ms/op 1.07
pickEth1Vote - Eth1Data fastSerialize value x2048 654.74 us/op 624.69 us/op 1.05
pickEth1Vote - Eth1Data fastSerialize tree x2048 8.5200 ms/op 7.2239 ms/op 1.18
bytes32 toHexString 512.00 ns/op 500.00 ns/op 1.02
bytes32 Buffer.toString(hex) 362.00 ns/op 346.00 ns/op 1.05
bytes32 Buffer.toString(hex) from Uint8Array 567.00 ns/op 545.00 ns/op 1.04
bytes32 Buffer.toString(hex) + 0x 359.00 ns/op 344.00 ns/op 1.04
Object access 1 prop 0.16800 ns/op 0.16200 ns/op 1.04
Map access 1 prop 0.15600 ns/op 0.16100 ns/op 0.97
Object get x1000 6.8890 ns/op 6.4650 ns/op 1.07
Map get x1000 0.63200 ns/op 0.62500 ns/op 1.01
Object set x1000 54.392 ns/op 51.659 ns/op 1.05
Map set x1000 44.131 ns/op 43.017 ns/op 1.03
Return object 10000 times 0.23620 ns/op 0.23390 ns/op 1.01
Throw Error 10000 times 4.2110 us/op 4.1446 us/op 1.02
fastMsgIdFn sha256 / 200 bytes 3.4770 us/op 3.3970 us/op 1.02
fastMsgIdFn h32 xxhash / 200 bytes 296.00 ns/op 277.00 ns/op 1.07
fastMsgIdFn h64 xxhash / 200 bytes 409.00 ns/op 398.00 ns/op 1.03
fastMsgIdFn sha256 / 1000 bytes 11.673 us/op 11.471 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 425.00 ns/op 406.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 1000 bytes 491.00 ns/op 458.00 ns/op 1.07
fastMsgIdFn sha256 / 10000 bytes 103.00 us/op 102.70 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 1.9290 us/op 1.9060 us/op 1.01
fastMsgIdFn h64 xxhash / 10000 bytes 1.3910 us/op 1.3530 us/op 1.03
enrSubnets - fastDeserialize 64 bits 1.2800 us/op 1.2600 us/op 1.02
enrSubnets - ssz BitVector 64 bits 484.00 ns/op 489.00 ns/op 0.99
enrSubnets - fastDeserialize 4 bits 169.00 ns/op 172.00 ns/op 0.98
enrSubnets - ssz BitVector 4 bits 515.00 ns/op 493.00 ns/op 1.04
prioritizePeers score -10:0 att 32-0.1 sync 2-0 111.89 us/op 103.95 us/op 1.08
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 144.09 us/op 129.53 us/op 1.11
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 179.22 us/op 165.79 us/op 1.08
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 350.12 us/op 298.82 us/op 1.17
prioritizePeers score 0:0 att 64-1 sync 4-1 408.69 us/op 360.98 us/op 1.13
array of 16000 items push then shift 1.6405 us/op 1.6580 us/op 0.99
LinkedList of 16000 items push then shift 8.9140 ns/op 8.8210 ns/op 1.01
array of 16000 items push then pop 109.59 ns/op 82.299 ns/op 1.33
LinkedList of 16000 items push then pop 8.7840 ns/op 8.6370 ns/op 1.02
array of 24000 items push then shift 2.3768 us/op 2.3924 us/op 0.99
LinkedList of 24000 items push then shift 8.9750 ns/op 8.6950 ns/op 1.03
array of 24000 items push then pop 82.827 ns/op 83.976 ns/op 0.99
LinkedList of 24000 items push then pop 8.5540 ns/op 8.4630 ns/op 1.01
intersect bitArray bitLen 8 13.053 ns/op 13.113 ns/op 1.00
intersect array and set length 8 81.676 ns/op 73.888 ns/op 1.11
intersect bitArray bitLen 128 43.578 ns/op 43.466 ns/op 1.00
intersect array and set length 128 1.0925 us/op 1.0228 us/op 1.07
Buffer.concat 32 items 2.9660 us/op 2.5800 us/op 1.15
Uint8Array.set 32 items 2.7800 us/op 2.4500 us/op 1.13
transfer serialized Status (84 B) 2.1070 us/op 1.9770 us/op 1.07
copy serialized Status (84 B) 1.8260 us/op 1.6750 us/op 1.09
transfer serialized SignedVoluntaryExit (112 B) 2.2970 us/op 2.0540 us/op 1.12
copy serialized SignedVoluntaryExit (112 B) 1.9000 us/op 1.7110 us/op 1.11
transfer serialized ProposerSlashing (416 B) 2.5400 us/op 2.2000 us/op 1.15
copy serialized ProposerSlashing (416 B) 2.2330 us/op 2.2950 us/op 0.97
transfer serialized Attestation (485 B) 2.2490 us/op 2.5990 us/op 0.87
copy serialized Attestation (485 B) 2.1770 us/op 2.2450 us/op 0.97
transfer serialized AttesterSlashing (33232 B) 2.3320 us/op 2.6760 us/op 0.87
copy serialized AttesterSlashing (33232 B) 5.7040 us/op 5.7680 us/op 0.99
transfer serialized Small SignedBeaconBlock (128000 B) 2.7780 us/op 3.0380 us/op 0.91
copy serialized Small SignedBeaconBlock (128000 B) 15.183 us/op 15.382 us/op 0.99
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2590 us/op 3.2850 us/op 0.99
copy serialized Avg SignedBeaconBlock (200000 B) 41.288 us/op 22.363 us/op 1.85
transfer serialized BlobsSidecar (524380 B) 3.3740 us/op 3.1010 us/op 1.09
copy serialized BlobsSidecar (524380 B) 166.50 us/op 68.216 us/op 2.44
transfer serialized Big SignedBeaconBlock (1000000 B) 3.5330 us/op 3.1320 us/op 1.13
copy serialized Big SignedBeaconBlock (1000000 B) 324.36 us/op 297.08 us/op 1.09
pass gossip attestations to forkchoice per slot 2.2138 ms/op 2.2307 ms/op 0.99
computeDeltas 2.8819 ms/op 3.6547 ms/op 0.79
computeProposerBoostScoreFromBalances 1.7769 ms/op 1.7405 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei normalcase 2.1269 ms/op 2.0971 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei worstcase 3.7759 ms/op 3.2743 ms/op 1.15
altair processAttestation - setStatus - 1/6 committees join 143.18 us/op 143.99 us/op 0.99
altair processAttestation - setStatus - 1/3 committees join 283.71 us/op 274.56 us/op 1.03
altair processAttestation - setStatus - 1/2 committees join 378.77 us/op 372.71 us/op 1.02
altair processAttestation - setStatus - 2/3 committees join 470.28 us/op 477.13 us/op 0.99
altair processAttestation - setStatus - 4/5 committees join 650.25 us/op 662.58 us/op 0.98
altair processAttestation - setStatus - 100% committees join 769.32 us/op 773.64 us/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase 16.831 ms/op 16.286 ms/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase hashState 25.073 ms/op 25.223 ms/op 0.99
altair processBlock - 250000 vs - 7PWei worstcase 44.250 ms/op 49.227 ms/op 0.90
altair processBlock - 250000 vs - 7PWei worstcase hashState 63.409 ms/op 67.754 ms/op 0.94
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9768 ms/op 2.3432 ms/op 0.84
phase0 processBlock - 250000 vs - 7PWei worstcase 27.893 ms/op 31.834 ms/op 0.88
altair processEth1Data - 250000 vs - 7PWei normalcase 451.10 us/op 525.12 us/op 0.86
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.7440 us/op 8.1860 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 19.536 us/op 23.616 us/op 0.83
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.2750 us/op 11.117 us/op 0.74
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.3190 us/op 7.1780 us/op 0.88
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 74.133 us/op 115.45 us/op 0.64
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 600.56 us/op 666.30 us/op 0.90
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 901.79 us/op 912.03 us/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 853.73 us/op 883.89 us/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.1356 ms/op 2.2979 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.4517 ms/op 1.7202 ms/op 0.84
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.1758 ms/op 4.4563 ms/op 0.94
Tree 40 250000 create 276.04 ms/op 309.69 ms/op 0.89
Tree 40 250000 get(125000) 176.34 ns/op 195.49 ns/op 0.90
Tree 40 250000 set(125000) 892.38 ns/op 949.53 ns/op 0.94
Tree 40 250000 toArray() 16.823 ms/op 19.376 ms/op 0.87
Tree 40 250000 iterate all - toArray() + loop 16.868 ms/op 19.049 ms/op 0.89
Tree 40 250000 iterate all - get(i) 64.789 ms/op 71.047 ms/op 0.91
MutableVector 250000 create 8.9137 ms/op 11.487 ms/op 0.78
MutableVector 250000 get(125000) 6.2570 ns/op 6.6030 ns/op 0.95
MutableVector 250000 set(125000) 263.14 ns/op 261.81 ns/op 1.01
MutableVector 250000 toArray() 2.8631 ms/op 2.8325 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 2.7554 ms/op 3.0134 ms/op 0.91
MutableVector 250000 iterate all - get(i) 1.4547 ms/op 1.5208 ms/op 0.96
Array 250000 create 2.4451 ms/op 2.7270 ms/op 0.90
Array 250000 clone - spread 1.1096 ms/op 1.2463 ms/op 0.89
Array 250000 get(125000) 0.52100 ns/op 0.61300 ns/op 0.85
Array 250000 set(125000) 0.59300 ns/op 0.67900 ns/op 0.87
Array 250000 iterate all - loop 104.13 us/op 83.382 us/op 1.25
effectiveBalanceIncrements clone Uint8Array 300000 25.218 us/op 30.448 us/op 0.83
effectiveBalanceIncrements clone MutableVector 300000 316.00 ns/op 384.00 ns/op 0.82
effectiveBalanceIncrements rw all Uint8Array 300000 163.69 us/op 169.56 us/op 0.97
effectiveBalanceIncrements rw all MutableVector 300000 78.609 ms/op 85.856 ms/op 0.92
phase0 afterProcessEpoch - 250000 vs - 7PWei 108.15 ms/op 113.04 ms/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.362 ms/op 41.678 ms/op 0.97
altair processEpoch - mainnet_e81889 315.90 ms/op 327.58 ms/op 0.96
mainnet_e81889 - altair beforeProcessEpoch 65.609 ms/op 51.725 ms/op 1.27
mainnet_e81889 - altair processJustificationAndFinalization 17.803 us/op 18.343 us/op 0.97
mainnet_e81889 - altair processInactivityUpdates 5.0100 ms/op 5.5663 ms/op 0.90
mainnet_e81889 - altair processRewardsAndPenalties 46.304 ms/op 65.967 ms/op 0.70
mainnet_e81889 - altair processRegistryUpdates 2.4580 us/op 3.5820 us/op 0.69
mainnet_e81889 - altair processSlashings 442.00 ns/op 572.00 ns/op 0.77
mainnet_e81889 - altair processEth1DataReset 567.00 ns/op 528.00 ns/op 1.07
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2143 ms/op 1.2160 ms/op 1.00
mainnet_e81889 - altair processSlashingsReset 5.1990 us/op 5.0430 us/op 1.03
mainnet_e81889 - altair processRandaoMixesReset 4.9460 us/op 4.7260 us/op 1.05
mainnet_e81889 - altair processHistoricalRootsUpdate 709.00 ns/op 574.00 ns/op 1.24
mainnet_e81889 - altair processParticipationFlagUpdates 2.6410 us/op 2.3030 us/op 1.15
mainnet_e81889 - altair processSyncCommitteeUpdates 607.00 ns/op 504.00 ns/op 1.20
mainnet_e81889 - altair afterProcessEpoch 125.47 ms/op 117.97 ms/op 1.06
phase0 processEpoch - mainnet_e58758 329.84 ms/op 317.63 ms/op 1.04
mainnet_e58758 - phase0 beforeProcessEpoch 125.18 ms/op 124.62 ms/op 1.00
mainnet_e58758 - phase0 processJustificationAndFinalization 16.989 us/op 16.125 us/op 1.05
mainnet_e58758 - phase0 processRewardsAndPenalties 52.376 ms/op 54.714 ms/op 0.96
mainnet_e58758 - phase0 processRegistryUpdates 8.1010 us/op 7.5570 us/op 1.07
mainnet_e58758 - phase0 processSlashings 560.00 ns/op 506.00 ns/op 1.11
mainnet_e58758 - phase0 processEth1DataReset 540.00 ns/op 550.00 ns/op 0.98
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.0030 ms/op 993.96 us/op 1.01
mainnet_e58758 - phase0 processSlashingsReset 3.5690 us/op 2.8370 us/op 1.26
mainnet_e58758 - phase0 processRandaoMixesReset 4.8140 us/op 4.5690 us/op 1.05
mainnet_e58758 - phase0 processHistoricalRootsUpdate 750.00 ns/op 603.00 ns/op 1.24
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.4380 us/op 3.7570 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 98.061 ms/op 97.232 ms/op 1.01
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2271 ms/op 1.2597 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5098 ms/op 1.4353 ms/op 1.05
altair processInactivityUpdates - 250000 normalcase 20.685 ms/op 20.523 ms/op 1.01
altair processInactivityUpdates - 250000 worstcase 21.647 ms/op 22.327 ms/op 0.97
phase0 processRegistryUpdates - 250000 normalcase 6.6330 us/op 7.2200 us/op 0.92
phase0 processRegistryUpdates - 250000 badcase_full_deposits 258.74 us/op 241.23 us/op 1.07
phase0 processRegistryUpdates - 250000 worstcase 0.5 110.30 ms/op 114.28 ms/op 0.97
altair processRewardsAndPenalties - 250000 normalcase 47.000 ms/op 54.361 ms/op 0.86
altair processRewardsAndPenalties - 250000 worstcase 55.845 ms/op 60.451 ms/op 0.92
phase0 getAttestationDeltas - 250000 normalcase 6.4945 ms/op 6.4935 ms/op 1.00
phase0 getAttestationDeltas - 250000 worstcase 6.4839 ms/op 6.3958 ms/op 1.01
phase0 processSlashings - 250000 worstcase 3.3889 ms/op 3.5975 ms/op 0.94
altair processSyncCommitteeUpdates - 250000 166.12 ms/op 168.30 ms/op 0.99
BeaconState.hashTreeRoot - No change 272.00 ns/op 265.00 ns/op 1.03
BeaconState.hashTreeRoot - 1 full validator 50.457 us/op 50.956 us/op 0.99
BeaconState.hashTreeRoot - 32 full validator 489.40 us/op 502.57 us/op 0.97
BeaconState.hashTreeRoot - 512 full validator 5.4782 ms/op 4.9597 ms/op 1.10
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 60.907 us/op 60.772 us/op 1.00
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 873.80 us/op 873.71 us/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.142 ms/op 11.262 ms/op 0.99
BeaconState.hashTreeRoot - 1 balances 49.785 us/op 46.080 us/op 1.08
BeaconState.hashTreeRoot - 32 balances 421.89 us/op 474.18 us/op 0.89
BeaconState.hashTreeRoot - 512 balances 4.3671 ms/op 4.1359 ms/op 1.06
BeaconState.hashTreeRoot - 250000 balances 74.214 ms/op 72.599 ms/op 1.02
aggregationBits - 2048 els - zipIndexesInBitList 16.022 us/op 15.570 us/op 1.03
regular array get 100000 times 43.466 us/op 32.326 us/op 1.34
wrappedArray get 100000 times 32.681 us/op 32.232 us/op 1.01
arrayWithProxy get 100000 times 15.754 ms/op 15.601 ms/op 1.01
ssz.Root.equals 562.00 ns/op 537.00 ns/op 1.05
byteArrayEquals 550.00 ns/op 529.00 ns/op 1.04
shuffle list - 16384 els 6.8044 ms/op 6.7324 ms/op 1.01
shuffle list - 250000 els 97.441 ms/op 98.356 ms/op 0.99
processSlot - 1 slots 8.3110 us/op 8.7520 us/op 0.95
processSlot - 32 slots 1.3463 ms/op 1.3359 ms/op 1.01
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 30.420 ms/op 33.308 ms/op 0.91
getCommitteeAssignments - req 1 vs - 250000 vc 2.8658 ms/op 2.8824 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 4.0864 ms/op 4.0952 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4559 ms/op 4.5345 ms/op 0.98
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6000 ns/op 4.5700 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 833.83 ns/op 907.60 ns/op 0.92
computeProposers - vc 250000 10.230 ms/op 10.290 ms/op 0.99
computeEpochShuffling - vc 250000 100.52 ms/op 103.70 ms/op 0.97
getNextSyncCommittee - vc 250000 165.82 ms/op 182.63 ms/op 0.91
computeSigningRoot for AttestationData 12.838 us/op 13.310 us/op 0.96
hash AttestationData serialized data then Buffer.toString(base64) 2.3271 us/op 2.3731 us/op 0.98
toHexString serialized data 1.0772 us/op 1.0702 us/op 1.01
Buffer.toString(base64) 313.40 ns/op 319.05 ns/op 0.98

by benchmarkbot/action

@nflaig nflaig changed the title fix(logger): increase DailyRotateFile max listeners to 20 fix(logger): increase max listeners of file transports to 20 May 29, 2023
@nflaig
nflaig force-pushed the nflaig/fix-DailyRotateFile-max-listeners branch from f96c5a1 to 791f125 Compare May 29, 2023 14:53
@nflaig
nflaig marked this pull request as ready for review May 29, 2023 15:06
@nflaig
nflaig force-pushed the nflaig/fix-DailyRotateFile-max-listeners branch from 791f125 to bd73f9a Compare May 29, 2023 17:19
@wemeetagain
wemeetagain merged commit bf52a7f into unstable May 30, 2023
@wemeetagain
wemeetagain deleted the nflaig/fix-DailyRotateFile-max-listeners branch May 30, 2023 14:28
@wemeetagain

Copy link
Copy Markdown
Member

馃帀 This PR is included in v1.9.0 馃帀

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.

MaxListenersExceededWarning when creating >10 child loggers

2 participants