dqkyz02602 2012-09-28 11:55
浏览 57

Node vs nginx + php-fpm用于数据库驱动的网站

Is the node a good choice for database driven websites? I understand the performance advantage in real-time scenarios and applications. But does it offer the same performance advantage for classic, database driven CMS websites, compared to nginx + php-fpm.

  • 写回答

1条回答 默认 最新

  • dri8163 2013-03-07 18:48
    关注

    Node is good choice for database driven websites given that you have database binding written in non-blocking way. Most used database servers now have nodejs bindings written in non-blocking way.

    For example, PHP with apache. It creates a thread per request. When doing IO with database thread is in blocking state. It means http server can't do anything with that request till IO completes, 40,000,000 cycles. This is wrong way of doing IO. While in nodeJS, if db binding is written in non-blocking way, binding is doing IO in thread pool and node event loop is listening for events.

    IO latency (in CPU cycles)

    L1: < 10 cycles

    L2: < 20 cycles

    RAM: ~300 cycles

    Disc: 40,000,000 cycles

    Network: 240,000,000 cycles

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP