Closed a-roberts closed 1 year ago
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Hi there, I'm looking to do some profiling for an enormous Node.js app with many different libraries and 0x looks to be an awesome tool to help me easily do exactly that*.
To cut a long story short I am running 0x inside of a container on OpenShift and I have a custom lifecycle/preExit hook that should help me get the output file out for analysis, later.
I'm quite certain this is down to my own user error, but I can't figure it out and hence this ask for help...
In my image I have installed
top
andps
through microdnf, as well as 0x, globally.If I get some extra wide ps output, I can see this is happening in my container:
(as you can see, there are two node processes - presumably based on the parent process ID for PID 14, that's the child, and 0x is supposed to generate that node --prof process). What you might also notice though is that --prof doesn't have any flags; presumably 0x is supposed to "chew up" and consume the output from that, if --quiet and --silent is set.
The output, however, is still present, and neverending (because why wouldn't it be, I've not sent a sighup yet).
It's a fast way to cause a pod to be evicted and I see ticks, such as this, until etcd eventually decides what I'm doing isn't right.
If I
docker run
the same image I'm using in my pod (through a simpledocker run -it (the image) sh
), my process starts as expected with profiling (indicating 0x is working great, nice and quiet until I do a Ctrl-C).I can't share the full image sadly since what I'm working on isn't open-source, but any thoughts would be appreciated.
The entrypoint to my application is as follows:
exec env 0x --quiet --silent --collect-only --output-dir /tmp/profiling -- node --dns-result-order=ipv4first server.js
What might I be missing, please?
*For a little background and rationale, I would use
--prof
based on the simple profiling blog I've seen, but AFAIK that has no customisable output dir - although--cpu-prof
might do the same thing and does allow a directory override. It's not easy for me to write to the current directory, short of tweaking my Dockerfile a bit, hence why I've gone with using 0x.Note: if I find the solution before anyone else, I shall reply to myself with it, and close, for anyone else who stumbles upon this. Thanks in advance to anyone who stumbles upon this!