13 Replies Last post: Apr 3, 2013 10:45 PM by Angel Municio  
Angel Municio Newbie 2 posts since
Mar 1, 2013
Currently Being Moderated

Mar 8, 2013 5:48 AM

Starting Node.js Web Server in Debug Mode is Very Slow

Starting my Node.js server in debug mode has become very slow, to the point of being almost unusable.

 

Currently my Node.js server process takes about 11 seconds to start in debug. That is a big improvement in relationship with some of the earlier builds of version 6 which could take up to 20 seconds. But it compares badly with a second when I startit from the command line or simply hit "run" from WebStorm. The same project opened with WebStorm 5 only takes 4 seconds to start in debug. In all this cases, it is always the same project with the same code.

 

The startup sequence is quite straightforward: I load express (with some routes), connect to mongodb and redis and wait for connections. Nothing fancy.

 

I have increased my vm options to make sure that it is not memory starved, but I haven't seen any improvements. Any ideas?

 

 

Thanks

Angel

Vladimir Krivosheev Novice 158 posts since
Mar 3, 2007
Currently Being Moderated
Mar 8, 2013 10:42 AM in response to: Angel Municio
Re: Starting Node.js Web Server in Debug Mode is Very Slow

Could attach test project? See http://youtrack.jetbrains.com/issue/WEB-6581

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 8, 2013 10:24 PM in response to: Vladimir Krivosheev
Re: Starting Node.js Web Server in Debug Mode is Very Slow

I have the same problem, in WebStorm 5 the debugger would take maybe 30 seconds for my project to startup and be ready to debug for node.js, in WebStorm 6 I haven't timed it, but it's long enough to go take a nap, go to the bathroom, get a coffee and it's finally started.

 

I'll have to go back to WebStorm 5 until this is resolved,

thanks,

-Matt

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 8, 2013 10:44 PM in response to: Matt Palmerlee
Re: Starting Node.js Web Server in Debug Mode is Very Slow

One possible cause of this is the JetBrains Chrome Extension,

I didn't have it installed before I upgraded to WebStorm 6, now, even after I've gone back to using WebStorm 5, my debugging is very slow, I've even uninstalled the Chrome Extension and I have the same problem.

 

Please Help!

 

-Matt

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 8, 2013 11:04 PM in response to: Matt Palmerlee
Re: Starting Node.js Web Server in Debug Mode is Very Slow

More information: My co-worker is using WebStorm 6, same project and his

debugging is fine (just as it was in WebStorm 5), he thought he used to have the Chrome Extension installed, but when we looked, he doesn't have it installed anymore.

 

I can't seem to figure this out, I've switched back to version 6 and I'm still having the problem.

JOe  Blow Newbie 4 posts since
Mar 8, 2013
Currently Being Moderated
Mar 9, 2013 1:56 AM in response to: Angel Municio
Re: Starting Node.js Web Server in Debug Mode is Very Slow

How long does it take for debug mode from the command line (without WebStorm) to start for you?

 

For example, in your project directory, try

node debug app.js

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 9, 2013 8:37 AM in response to: JOe Blow
Re: Starting Node.js Web Server in Debug Mode is Very Slow

When I run node debug app.js it works great, maybe takes 10 seconds to start showing the log messages I expect and it breaks on the first line of app.js.

 

If I run the command that webstorm says it's running:

node --debug-brk=54854 app.js

 

It hangs forever just like in webstorm.

 

thanks for your help,

-Matt

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 9, 2013 8:42 AM in response to: Matt Palmerlee
Re: Starting Node.js Web Server in Debug Mode is Very Slow

One note:

if I start on the command line with: node --debug-brk=56986 server.js

 

and then open my browser to:

http://127.0.0.1:56986

 

then the debugger process wakes up or stops hanging and I see my console messages.

 

Perhaps there is something similar going on when I debug through webstorm where it is waiting for the connection from the chrome extension?

 

-Matt

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 9, 2013 8:41 PM in response to: JOe Blow
Re: Starting Node.js Web Server in Debug Mode is Very Slow

Another Interesting thing to Note:

When I debug a simple node file through WebStorm (a mocha test debugging harness) instead of the main app.js which uses express/connect, etc...  It starts up and runs through, but it doesn't break on my breakpoints that I set at all!

 

This is on Mac OS X, I've tried different versions of node as well, 0.6.19 and 0.8.20, same issue.

 

-Matt

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 9, 2013 11:59 PM in response to: Matt Palmerlee
Re: Starting Node.js Web Server in Debug Mode is Very Slow

I was able to get the breakpoints working in my small (mocha test) configuration.   I think the key was by upgrading the nodejs plugin within webstorm.

 

After that was working, I noticed that in my larger project (with express, etc...) if I startup with the option of "break on all exceptions" I see it breaks immediately.  I tried this because I noticed this bug:

http://youtrack.jetbrains.com/issue/WEB-1917

mentions that breaking on all exceptions shows breakpoints.

 

Screen Shot 2013-03-09 at 11.55.58 AM.png

 

As I step through after "Breaking on all exceptions" it hits the fs.js file under frames in the debugger tab (as shown in the screenshot) and the path shows it hitting this exception for just about every node_module.

 

This could explain why it's taking forever to startup the debugging if it's hitting exceptions for whatever reason in every one of my node modules.

 

Hope this helps get the the bottom of the issue.  I'd rather not have to rebuild my whole machine to get the debugging working correctly again in WebStorm.

 

 

thanks,

-Matt

Vladimir Krivosheev Novice 158 posts since
Mar 3, 2007
Currently Being Moderated
Mar 11, 2013 11:32 AM in response to: Matt Palmerlee
Re: Starting Node.js Web Server in Debug Mode is Very Slow

We are investigating this problem. About JB IDE support extension — we use it only for browser debug, extension is not needed for Node JS.

Matt Palmerlee Newbie 8 posts since
Mar 8, 2013
Currently Being Moderated
Mar 20, 2013 4:35 AM in response to: Vladimir Krivosheev
Re: Starting Node.js Web Server in Debug Mode is Very Slow

Any updates on this issue?

 

My coworker had tested his debugger again and notified me that it was broken (super slow) for him as well.  I suspect it may be caused or made worse by some recent node_module put into our repository, I tried removing some of the more recently added modules though and it didn't help, so it's still a mystery to me.

 

thanks,

-Matt

Vladimir Krivosheev Novice 158 posts since
Mar 3, 2007
Currently Being Moderated
Apr 3, 2013 6:51 PM in response to: Angel Municio
Re: Starting Node.js Web Server in Debug Mode is Very Slow

I hope it was fixed in WebStorm 6.0.2 (coming soon)/IntelliJ IDEA 12.1.

More Like This

  • Retrieving data ...