cnodejs生产环境是怎样部署的
 发布于 12 年前  作者 goooto  7083 次预览  最后一次回复是 12 年前  来自  

我部署时使用nginx+nodejs,nodejs使用Forever进行进程维护; 但好像出现部分js文件加载过慢的问题,有的js加载了1秒多,但我看cnodejs好像没有这个问题,不知道什么原因。

10 回复
alfredzh

顺路同问!先谢一下楼下的高手!!

vicanso

介绍一下我的node.js站点的处理,我的站点是没有使用nginx,使用的是varnish。因为我的项目每次deploy都会给静态文件生成一个version的后缀,因此我会让静态文件在varnish中缓存24小时(保证了如果24小时之内没有deploy,相同的静态文件只会向node.js请求一次)。 varnish的介绍可以看 https://www.varnish-cache.org/ 附上一句varnish的官方关于性能的描述:Varnish performs really, really well. It is usually bound by the speed of the network, effectively turning performance into a non-issue. We’ve seen Varnish delivering 20 Gbps on regular off-the-shelf hardware.

goooto

架设非常合理,我加nginx是因为要架多个站点,没有加前端缓存是因为站点比较小,懒得弄了 :)

goooto

@hexie 非常好的文章,O(∩_∩)O谢谢!

ldl694178563

我的博客就是用vps(centos + nginx + node.js + mongodb) 因为是小站,架构足矣,不过速度还是杠杠的~~~ http://www.9958.pw

lzyzsd

我现在用的就是nginx。看来很有必要试试varnish

goooto

pm2有什么优势吗

goooto

很强大,不过还没成熟。:)