RubyLouvre / agate

灵活易用的nodejs后端框架
GNU General Public License v2.0
74 stars 21 forks source link

缓存 #2

Open RubyLouvre opened 9 years ago

RubyLouvre commented 9 years ago

https://cnodejs.org/topic/55210d88c4f5240812f55408 https://www.mnot.net/cache_docs/

RubyLouvre commented 9 years ago

image

RubyLouvre commented 9 years ago

image

RubyLouvre commented 9 years ago

为什么使用pm2 ? 最牛的监控平台,集成多线程及热启动技术。

如果你在启动时报以下错误

D:\agate>pm2 start app --node-args="--harmony"
fs.js:751
  return binding.mkdir(pathModule._makeLong(path),
                 ^
Error: ENOENT, no such file or directory 'D:\Users\qincheng.zhong.QUNARSERVERS\.
pm2'

那么你应该建立D:\Users\qincheng.zhong.QUNARSERVERS\.pm2目录就可以了

D:\agate>mkdir D:\Users\qincheng.zhong.QUNARSERVERS\.pm2

D:\agate>dir D:\Users\qincheng.zhong.QUNARSERVERS\.pm2

https://doesnotscale.com/deploying-node-js-with-pm2-and-nginx/ 然后运行pm2 start app --node-args="--harmony"(你不需要再运行node app --harmony) image

当然我们也可以用配置方式json启动pm2

//需要跑到config目录下
$ pm2 start pm2.json
$ pm2 stop pm2.json
$ pm2 delete pm2.json
$ pm2 restart pm2.json

pm2.json在window下不能使用监控功能watch 配置方式不时会出问题,实在不行,还是换回命令行方式

pm2 start app --node-args="--harmony" --name "kkk" --watch

-i 好像不怎么好用