node.js - Request sent is taking too long. why would that be? -


"request sent" taking 3+ seconds.

client code:

jq.ajax({   url: '/test',   type: 'post',   contenttype: 'application/json',   data: jsondata,   success: function(response) {   console.log('done');    } }); 

server code:

app.post('/test', function(req, res){   res.send(req.body) }); 

datalength 865853 ( seen headers )

server running nginx behind nodejs server running.

want understand why happening , ways reduce it. example

its post request. adding headers image: headers

request sent taking long. why be?

it anything.

want understand why happening , ways reduce it.

there may lots of reasons. without seeing single line of code it's impossible tell what's wrong it. may using blocking functions, may calling external services, may work in main process, may blocking event loop, may forget handle errors, may doing number of things wrong in application , may have misconfigured reverse proxy, may using wrong ports, wrong hosts, network may slow, routers may overloaded, packets may lost, can have memory leaks, swap trashing, cpu maxed out etc.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -