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

    评论

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程