Skip to content

Commit 7dc6660

Browse files
authored
feat: add profiling for prysm (ethereum#722)
1 parent cdb20e1 commit 7dc6660

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/cl/prysm/prysm_launcher.star

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ DISCOVERY_UDP_PORT_NUM = 12000
1515
RPC_PORT_NUM = 4000
1616
HTTP_PORT_NUM = 3500
1717
BEACON_MONITORING_PORT_NUM = 8080
18+
PROFILING_PORT_NUM = 6060
1819

1920
# The min/max CPU/memory that the beacon node can use
2021
BEACON_MIN_CPU = 100
@@ -235,13 +236,19 @@ def get_beacon_config(
235236
{constants.RPC_PORT_ID: public_ports_for_component[3]}
236237
)
237238
)
239+
public_ports.update(
240+
shared_utils.get_port_specs(
241+
{constants.PROFILING_PORT_ID: public_ports_for_component[4]}
242+
)
243+
)
238244

239245
used_port_assignments = {
240246
constants.TCP_DISCOVERY_PORT_ID: discovery_port,
241247
constants.UDP_DISCOVERY_PORT_ID: discovery_port,
242248
constants.HTTP_PORT_ID: HTTP_PORT_NUM,
243249
constants.METRICS_PORT_ID: BEACON_MONITORING_PORT_NUM,
244250
constants.RPC_PORT_ID: RPC_PORT_NUM,
251+
constants.PROFILING_PORT_ID: PROFILING_PORT_NUM,
245252
}
246253
used_ports = shared_utils.get_port_specs(used_port_assignments)
247254

@@ -266,8 +273,11 @@ def get_beacon_config(
266273
# vvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
267274
"--disable-monitoring=false",
268275
"--monitoring-host=0.0.0.0",
269-
"--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM)
270-
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^
276+
"--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM),
277+
# vvvvvvvvv PROFILING CONFIG vvvvvvvvvvvvvvvvvvvvv
278+
"--pprof",
279+
"--pprofaddr=0.0.0.0",
280+
"--pprofport={0}".format(PROFILING_PORT_NUM),
271281
]
272282

273283
# If checkpoint sync is enabled, add the checkpoint sync url

src/package_io/constants.star

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ RPC_PORT_ID = "rpc"
4747
WS_RPC_PORT_ID = "ws-rpc"
4848
WS_PORT_ID = "ws"
4949
HTTP_PORT_ID = "http"
50+
PROFILING_PORT_ID = "profiling"
5051
VALIDATOR_HTTP_PORT_ID = "http-validator"
5152
METRICS_PORT_ID = "metrics"
5253
ENGINE_RPC_PORT_ID = "engine-rpc"

src/shared_utils/shared_utils.star

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ HTTP_APPLICATION_PROTOCOL = "http"
66
NOT_PROVIDED_APPLICATION_PROTOCOL = ""
77
NOT_PROVIDED_WAIT = "not-provided-wait"
88

9-
MAX_PORTS_PER_CL_NODE = 4
9+
MAX_PORTS_PER_CL_NODE = 5
1010
MAX_PORTS_PER_EL_NODE = 5
1111
MAX_PORTS_PER_VC_NODE = 3
1212
MAX_PORTS_PER_ADDITIONAL_SERVICE = 2
@@ -290,6 +290,7 @@ def get_port_specs(port_assignments):
290290
constants.WS_RPC_PORT_ID,
291291
constants.LITTLE_BIGTABLE_PORT_ID,
292292
constants.WS_PORT_ID,
293+
constants.PROFILING_PORT_ID,
293294
]:
294295
ports.update({port_id: new_port_spec(port, TCP_PROTOCOL)})
295296
elif port_id == constants.UDP_DISCOVERY_PORT_ID:

0 commit comments

Comments
 (0)