10 ms·
Debugging Node.js in Production
- irishcule 11y agoSorry if this is slightly off topic but can anyone tell me why I would not be able to access the netflix tech blog? Every time I try to go to it I get a "Web page unavailable" despite sites like downforeveryoneorjustme.com telling me it is not down. Not sure if its just my laptop as I am abroad at the moment in Italy and have no other computer to check the site.
- deleted 11y ago[deleted]
- joshuacc 11y agoIt's hosted on Blogger. Do you have problems with any other Blogger sites?
- arca_vorago 11y ago"abroad at the moment in Italy" Here is the basic checklist for something like this: check your hosts file ping the website tracert the website clear dns cache check dns server up/down temporarily disable av/firewall If all the above indicate normal operation but it still fails, it could be blocked anywhere upstream of you.
- irishcule 11y agoIt's strange, nothing in the hosts file, any ping says it can't find the host http://techblog.netflix.com/ http://techblog.netflix.com/, or even anyone of those check ip sites says the same. Asked some work colleagues here and in Ireland and it seems our company is blocking it, I guess through the firewall which unfortunately I can't disable.
- obituary_latte 11y agoHere's the talk: https://www.youtube.com/watch?v=O1YP8QP9gLA https://www.youtube.com/watch?v=O1YP8QP9gLA
- myth_buster 11y agoIf you are viewing from work they may block the domain for obvious reasons...
- cdnsteve 11y agoRestify, interesting.
- frik 11y agoInteresting that they choose the brute force way. And that it works that good and maybe has less overhead than instrumenting the code.
- z3t4 11y ago"Name your functions": Easier to know what the code does, flattens the "Christmas tree from hell", no need for ugly closures, + Makes it's easier to debug. Anonymous functions is probably the most abused syntax in JavaScript.
- jtmarmon 11y agoeven more abused now w/ es6 arrow shorthand
- lewisl9029 11y agoI wish named arrow functions made it into the spec.
- gotchange 11y agoA workaround for this to get the best of the two worlds: let func = () => {};
- ehynds 11y agoThat seems to do it. let func = () => {}; console.log(func.name); // func and in stack traces: let func = () => foo(); func() results in: Uncaught ReferenceError: foo is not defined func @ test.js:1
- lewisl9029 11y agoWow. I had no idea that would work. All this time I've been using the full named function expressions over arrow functions just for the stack traces.
- ehynds 11y agoStill though, in situations where I care about the stack trace, I don't see myself writing: let doStuffCallback = () => {}; doStuff(doStuffCallback); over: doStuff(function doStuffCallback() { });
- ryanelfman 11y agoWhy not use New Relic?
- jonesb6 11y agoMy early impressions of New Relic were that they were a really fast and easy way to correlate all the default logging of the web application stack. I imagine Netflix would want something a little deeper and more customized then this, also deploying New Relic at scale would be costly and at the very least require an audit of potential performance implications.
- VOYD 11y agoalways bad practice to be forced to debug in production, but I guess that's what you get in the "DevOps" model.
- dap 11y agoOn the contrary: there are many bugs you will not find until software is in production. (That's not a reason not to test or roll out to staging environments first and the like, because you can continue to find new bugs that way. But despite all of our efforts, there remain bugs that only manifest for the first time in production.)
- VOYD 11y agosure, but that is paramount of environments not being in sync, and inaccurate pre-production testing.
- jtchang 11y agoI am fairly new to node but find that it is hard as heck to debug. node debug index.js seems really weird and not at all like python's pdb. Is there something I am missing?
- smokeyj 11y agoCheck out node-inspector
- cookiecaper 11y agoNope. node and server-side JS in general is a pretty gross fad.
- ep103 11y agoYeah, there are better debuggers out there for node. Hopefully others will come along and make a list, but there's a number of graphical ones you can find with a little searching. Even visual studio has step through debugging at this point.
- specialist 11y agoTrying to figure out some websocket stuff, I somehow managed to get nodejs, autobahn, and whatnot running locally (client and server) using Jetbrains' WebStorm on a Mac. This tool stack makes me want to knock my teeth out. That WebStorm's debugger (with break points!) works at all is a marvel. Props to the JetBrains team.