Closed rg2011 closed 2 years ago
Maybe a new docker image flavour? https://github.com/telefonicaid/fiware-pep-steelskin/blob/master/docker/Dockerfile or just a new parameter to start docker image? https://github.com/telefonicaid/fiware-pep-steelskin/blob/0c7bb57a1f2cf3a22e92d9d94e7298af4870f68a/docker/entrypoint.sh#L47
Maybe a new docker image flavour? https://github.com/telefonicaid/fiware-pep-steelskin/blob/master/docker/Dockerfile or just a new parameter to start docker image?
Even better, maybe something that can be switch on/off via API? Eg:
PUT /admin/profiler?level=1 (to enable it)
PUT /admin/profiler?level=0 (to disable it)
although not sure if this is technically possible (I don't know anything about the Node inspector and how it works :)
(Note we already are using /admin API for log configuration, eg. PUT /admin/log?level=DEBUG)
Btw, this issue can apply to other node-based componentes:
We maybe should create twin issues for them in their respective repositories.
btw I'm using
node --inspect-brk=0.0.0.0 /opt/fiware-pep-steelskin/bin/pepProxy
in this point:
Btw, this issue can apply to other node-based componentes:
* IOTAs (all the suite) * Perseo-FE * STH
We maybe should create twin issues for them in their respective repositories.
For iotas you can use current image and add this sentence to docker-compose.yml:
command: node --inspect-brk=0.0.0.0 /opt/iotagent-json/bin/iotagent-json
Since version 10.x, node.js provides a CPU profiling API that can be used to collect CPU profiles on-demand: https://nodejs.org/docs/latest-v10.x/api/inspector.html. The API was added as experimental in release 10.x and marked as stable in release 14.x
Having the ability to collect CPU profiles on-demand would greatly help to troubleshoot issues with PEP in production, where sometimes we find CPU usages unexpectedly high for the number of requests served.
These traces are usually enabled by adding an HTTP GET endpoint to the application, that enables trace-collection on demand for a few seconds, then disables it, and returns the profile collected during that interval.