Re: [nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-09 Thread boby rahmawan
Hi moacir, is there any socket process not completed to execute? Maybe it
can make your server not responding because main program wait the response
from socket.
On Aug 9, 2015 10:55 PM, "zladuric"  wrote:

> Well, in that case, I would say it looks like a memory leak or something.
> You say the socket should close in two minutes - are you leaving some
> closures there too? Maybe those get piled up and then afterwards they only
> accept new requests when old ones expire.
>
> Did you count how many requests get piled up before this block?
>
> Also, you seem to also be using third-party services - outgoing calls?
> Your global max of http connections is set?
>
> Zlatko
>
>
> On Sunday, August 9, 2015 at 3:21:23 AM UTC+2, Moacir Braga wrote:
>>
>> Hello Rob. I'm not using webpack nor sass.
>>
>> Zladuric, I'm logging the connections and I found one service that
>> usually is involved with the problem, however when I restart the
>> application, I create a request with the same logged data, but the problem
>> does not reproduce. Strange, right? Not be able to reproduce an error is
>> really bad.
>>
>> I analysed the function, but all outputs are handled with HTTP 200 or
>> 302, i.e., I'm always closing the connections, but even if I don't, the
>> socket should do that in two minutes.
>>
>> Sometimes I think about if this problem happens only on Windows... but
>> unfortunately I must use Windows because this application is just a
>> middleware for my main solution.
>>
>> On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:
>>>
>>> It’s been a few weeks since I started trying to solve this problem, but
>>> I still haven’t figured out a possible solution. The issue is that my
>>> server accepts requests and responds to them normally in the beginning.
>>> However, after an unknown event happens (I’m still trying to discover which
>>> event it is), the server continues accepting requests, but it stops
>>> responding to them.
>>>
>>>
>>>
>>> I’ve already checked the Process Monitor (the server is running on
>>> Windows Server 2012 R2) and I could notice that when this problem happens,
>>> new requests generate a TCP Accept, a TCP Receive, but not a TCP Send nor a
>>> Disconnect.
>>>
>>>
>>>
>>> I tried to execute the server in debug mode, but then again, when this
>>> problem happens the debugger does not work and it hangs up as well.
>>>
>>>
>>>
>>> The server doesn’t explode and no errors occur. Thus, domains won’t help
>>> me in this case. I’ve tried to handle uncaughtException, but it also didn’t
>>> work.
>>>
>>>
>>>
>>> The server keeps running without using excessive processor or memory
>>> resources. Its behavior is still similar to the one during the first
>>> execution, except for the fact that it’s not responding as it was before.
>>>
>>>
>>>
>>> When I sent a SIGNAL via console, the server simply started working
>>> normally again without restarting or anything. It just got back to normal.
>>>
>>>
>>>
>>> I tried to execute a lot of requests using ApacheBench and NeoLoad, but
>>> I just can’t reproduce this problem. It simply happens randomly.
>>>
>>>
>>>
>>> The socket has a timeout of two minutes. However, the server keeps
>>> hanging up the requests for hours.
>>>
>>>
>>>
>>> When I sent the SIGNAL mentioned before, all requests that were hanging
>>> were executed, as if they were in a queue waiting for the last request to
>>> be finished.
>>>
>>>
>>>
>>> I don’t know what else could I do to find out what is causing this
>>> problem.
>>>
>>>
>>> I'm using Node.js + Express + body-parser + cookie-parser + Windows
>>> Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.
>>>
>>>
>>> *If somebody has any idea of what is causing the server to hang up
>>> forever, please tell me.*
>>>
>>>
>>> Best Regards,
>>>
>>> *Moacir Braga*
>>>
>> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/75a9f95f-f069-4449-b8d8-4bf2a8d20a01%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe fro

[nodejs] performance issue with express-validator

2015-08-09 Thread Sebastian M Cheung
After adding express-validator, the app slows down dramatically: why is 
that?

// mongoose config
require('./database');

var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
//var expressValidator = require('express-validator');

var routes = require('./routes/index');
var users = require('./routes/users');
var form = require('./routes/form');

var app = express();

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
//app.use(expressValidator);

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/4e2c28db-9d32-42a1-8628-d876c5a77387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] A microframework in node.js called elet

2015-08-09 Thread Angel Java Lopez
Nice!

First suggestions, questions:

- Maybe fs.readFileSync in view.js engine method is something to be cached,
or replaced by async call (yes, I know, it could imply that engine method
becomes async... no free lunch ;-) I would prefer file content caching, and
watch file system changes. Or implement async call using fiber module (but
I think it could be "too much")

- Any example of: authentication, upload file?

- Maybe cache of compiled templates, like the output of hogan.compile...
Mustache cache the same text, and then skip compile

- Tests, tests, tests ;-)

Angel "Java" Lopez
@ajlopez


On Sun, Aug 9, 2015 at 3:44 AM, Justin John 
wrote:

> I would like to present a microframework in Node.js called Elet which was
> inspired by CakePHP framework. It helps in building web applications
> simpler and require less code.
> Please check: https://github.com/justin-john/elet
> 
>
>
> Please review Elet and let me know how I can improve it. Your suggestion
> will be highly appreciated. If any one of you like to contribute with your
> ideas, please do not hesitate to contact me or make a pull request in
> repository.
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/f7e69b80-3943-4a02-aa4c-c71922427774%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAMs%2BDqKXT%3D_9%3DJ7JukzPKggODPxepydVKNDK%2BtPp6oJ6VRMNGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [nodejs] A microframework in node.js called elet

2015-08-09 Thread Adam Reynolds
Had a quick look. Why would I use this over express?
On 9 Aug 2015 16:55, "Justin John"  wrote:

> I would like to present a microframework in Node.js called Elet which was
> inspired by CakePHP framework. It helps in building web applications
> simpler and require less code.
> Please check: https://github.com/justin-john/elet
> 
>
>
> Please review Elet and let me know how I can improve it. Your suggestion
> will be highly appreciated. If any one of you like to contribute with your
> ideas, please do not hesitate to contact me or make a pull request in
> repository.
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/f7e69b80-3943-4a02-aa4c-c71922427774%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAFszCkO2C4KWaeyuqNHi-faNBbA4EY%3D3%3Dw839F%2B-YY3oUgY6_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] A microframework in node.js called elet

2015-08-09 Thread Justin John
I would like to present a microframework in Node.js called Elet which was 
inspired by CakePHP framework. It helps in building web applications 
simpler and require less code. 
Please check: https://github.com/justin-john/elet 

 

Please review Elet and let me know how I can improve it. Your suggestion 
will be highly appreciated. If any one of you like to contribute with your 
ideas, please do not hesitate to contact me or make a pull request in 
repository. 

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/f7e69b80-3943-4a02-aa4c-c71922427774%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[nodejs] Re: Server is accepting requests but is not responding. There is something hanging up the response.

2015-08-09 Thread zladuric
Well, in that case, I would say it looks like a memory leak or something. 
You say the socket should close in two minutes - are you leaving some 
closures there too? Maybe those get piled up and then afterwards they only 
accept new requests when old ones expire.

Did you count how many requests get piled up before this block?

Also, you seem to also be using third-party services - outgoing calls? Your 
global max of http connections is set?

Zlatko


On Sunday, August 9, 2015 at 3:21:23 AM UTC+2, Moacir Braga wrote:
>
> Hello Rob. I'm not using webpack nor sass.
>
> Zladuric, I'm logging the connections and I found one service that usually 
> is involved with the problem, however when I restart the application, I 
> create a request with the same logged data, but the problem does not 
> reproduce. Strange, right? Not be able to reproduce an error is really bad.
>
> I analysed the function, but all outputs are handled with HTTP 200 or 302, 
> i.e., I'm always closing the connections, but even if I don't, the socket 
> should do that in two minutes.
>
> Sometimes I think about if this problem happens only on Windows... but 
> unfortunately I must use Windows because this application is just a 
> middleware for my main solution.
>
> On Friday, August 7, 2015 at 12:51:17 PM UTC-3, Moacir Braga wrote:
>>
>> It’s been a few weeks since I started trying to solve this problem, but I 
>> still haven’t figured out a possible solution. The issue is that my server 
>> accepts requests and responds to them normally in the beginning. However, 
>> after an unknown event happens (I’m still trying to discover which event it 
>> is), the server continues accepting requests, but it stops responding to 
>> them.
>>
>>  
>>
>> I’ve already checked the Process Monitor (the server is running on 
>> Windows Server 2012 R2) and I could notice that when this problem happens, 
>> new requests generate a TCP Accept, a TCP Receive, but not a TCP Send nor a 
>> Disconnect.
>>
>>  
>>
>> I tried to execute the server in debug mode, but then again, when this 
>> problem happens the debugger does not work and it hangs up as well.
>>
>>  
>>
>> The server doesn’t explode and no errors occur. Thus, domains won’t help 
>> me in this case. I’ve tried to handle uncaughtException, but it also didn’t 
>> work.
>>
>>  
>>
>> The server keeps running without using excessive processor or memory 
>> resources. Its behavior is still similar to the one during the first 
>> execution, except for the fact that it’s not responding as it was before.
>>
>>  
>>
>> When I sent a SIGNAL via console, the server simply started working 
>> normally again without restarting or anything. It just got back to normal.
>>
>>  
>>
>> I tried to execute a lot of requests using ApacheBench and NeoLoad, but I 
>> just can’t reproduce this problem. It simply happens randomly.
>>
>>  
>>
>> The socket has a timeout of two minutes. However, the server keeps 
>> hanging up the requests for hours.
>>
>>  
>>
>> When I sent the SIGNAL mentioned before, all requests that were hanging 
>> were executed, as if they were in a queue waiting for the last request to 
>> be finished.
>>
>>  
>>
>> I don’t know what else could I do to find out what is causing this 
>> problem.
>>
>>
>> I'm using Node.js + Express + body-parser + cookie-parser + Windows 
>> Server 2012 R2 x64 with GUI + Amazon EC2 micro instance.
>>
>>
>> *If somebody has any idea of what is causing the server to hang up 
>> forever, please tell me.*
>>
>>
>> Best Regards,
>>
>> *Moacir Braga*
>>
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/75a9f95f-f069-4449-b8d8-4bf2a8d20a01%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.