DEV Community

Discussion on: Increase Node JS Performance With Libuv Thread Pool

Collapse
 
louieaniez profile image
louieaniez

Hi! I just have a question, because I've implemented a, somewhat like a watchdog mechanism for user session, using socket.io, I sent an event in a regular interval from my client controller in angularjs to my node server, as long as the client's browser is active, the interval continues, does that affect my server's response time eventually due to a regular interval? And also, I'm using callbacks in all of my database query, like this:

app.post('/postData', (req, res) => {
modules.postData(req.body, function (response) {
if (!response) { res.send('Error') }
else { res.status(200).send(response) }
})
})

Does this affect the response time of the server initially? this seriously is a pain in the ass, because I've created an embeddable app, and before it loads, it should get its data from my node server, however, the server will return a connection timeout error very often and that causes the app to not to display in the clients iframe, any idea how should I fix this? thanks in advance!

Collapse
 
louieaniez profile image
louieaniez

I just started using nodeJS actually, I think it's been 2 months since I started to code in nodejs, there's a lot to learn I guess

Collapse
 
bleedingcode profile image
💻 Bleeding Code-By John Jardin

Hi there. Regular pings to your server should be fine as long as the actual processing time and payloads are kept to a minimum. Your example above doesn't really give me too much insight into what's happening.

I see below you are new to Node. Firstly welcome to Node World :). I recommend joining the Node Reddit Group and bouncing ideas and asking for help there, but you might need to provide a bit more info to get a response.