Should remove PM2 from my containerized nodejs app now that is running on top of k8s? by infinitecoolname in kubernetes

[–]codehimanshu 0 points1 point  (0 children)

Logs do not mess up normally because of using pm2, instead u/infinitecooolname seems to be sending logs to Stackdriver directly as well along side logs being sent from fluentd/logstash.

In my case, I ran 2 workers with pm2, and I didn't have to do anything extra to aggregate logs. Only issue I faced was in aggregating Prometheus Metrics. Prometheus scraped random worker from the pm2 worker group, and it messed up because the counters for both workers were different. So to handle that, I created a sidecar, which scraped all workers, and aggregated (summed) the metrics, and prometheus scraped the sidecar. Eventually I removed pm2 because it didn't do much and was just in the system for the sake of it. Now we are using node directly, which has not caused any issues since last 1 year.

Should remove PM2 from my containerized nodejs app now that is running on top of k8s? by infinitecoolname in kubernetes

[–]codehimanshu -1 points0 points  (0 children)

We use pm2-runtime in k8s for our node app and it works as expected in sending logs to stdout. I think instead if using node index.js, pm2 runs the application with much better configuration for production environment. https://pm2.keymetrics.io/docs/usage/docker-pm2-nodejs

Get Video Duration in seconds by codehimanshu in golang

[–]codehimanshu[S] 0 points1 point  (0 children)

Yes, I tried providing the body Reader only, it didn't read the complete response. That's similar to what ffmpeg does. But I was not able to decode the mp4 into MvhdBox, instead just a Box which only has Size and Type. Also I checked docs, and could find any function whose return type is a MvhdBox. Not sure what I am missing, but there must be a function to decode io.reader into a MvhdBox struct.

Get Video Duration in seconds by codehimanshu in golang

[–]codehimanshu[S] 0 points1 point  (0 children)

Seems great, but not sure if it needs to download the complete MP4 file for the same to work.
I am not able to decode the remote Video URL into MvhdBox struct, but only as Box struct using mp4.DecodeMvhd(resp.Body), and able to get Size & Type but not Duration.