i'm working on 1 part of set of services work app/platform. area i'm needing on in vanilla express server use serve our client app (a react app, specific). have number of other services running on other node processes our client app interacts , consumes.
for time being, it's really lightweight express server uses res.sendfile()
send html file down client. we'll transition more isomorphic (yay buzzwords) approach renders on server. use fantastic pm2 module monitor , configure our node processes on server, , that's main question lies.
here's relevant part of entire server:
app.use("/app", express.static(__dirname + '/public')); app.get('*', function(req, res) { res.sendfile(path.join(__dirname + '/index.html')); });
we use few standard middleware functions before gets point in stack. don't think relevant here, can include them if thinks issue lies.
we use wildcard route move of routing responsibility react-router
, makes use of html5 history/location apis. there's little configuration server apart basic route/response code.
this seems extremely lightweight, when looking @ results of pm2 monit
(which shows memory usage) looks each cluster takes ~3mb increase per request. i'm not sure if safe/ignorable increase in rss or heap or if should concerned. seems it's buffering index.html
, app.js
, , app.css
memory.
can me diagnose this? looking @ memory leak? should considering memory leak here? don't see of usual signs (accumulating memory on time w/o interaction, etc.). suppose @ level i'm depending on pm2 here, it's well-known module gets lots of action in production different people i'm not skeptical yet.
turns out caused newrelic monitor installed w/ npm. wary of third party tools! :)
Comments
Post a Comment