dqj5046 2013-11-26 08:00
浏览 17

PHP NGINX PHP-FPM,分叉需要/可能吗?

I'm using a setup including PHP (5.5), NGINX (1.1.19) and PHP-FPM, with MySQL (5.5.34) as Database, and many, many stored procedures.

I dont want to get too far into the reason for why I'm using stored procedures, but as far as I know it's a good practice to use persistent connections with them, since they load with every connection, slowing things down (is that still true?).

Now, as far as my knowledge goes, to have persistent connections I need some child processes, but is that even necessary / possible with PHP-FPM? I've read mixed things about this, and I'm not entirely sure.

The main question, basically, would be: When using the mentioned Setup (PHP-FPM, NGINX, MySQL) waht's the best way to use / handle persistent connections to MySQL? Is it possible? If not, what's a possible workaround?

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • dongqiang2069 2014-02-09 06:12
    关注

    PHP-FPM runs as a daemon and thus keeps certain state persistent until the worker is released. This means you can leverage persistent connections, such as what is documented in the connections and connection management section.

    Regarding stored procedures being loaded on every connection, the answer is not unless you are creating and dropping them constantly. Stored procedures are typically persisted on the database server similar to triggers and other database objects in your schema and thus only incur an overhead when actually executed.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大