gpt4 book ai didi

php - 什么是守护进程?它们的实际用途?与php一起使用?

转载 作者:行者123 更新时间:2023-12-03 19:07:08 29 4
gpt4 key购买 nike

有人可以用两个词来解释我,什么是守护进程以及它们在 php 中的用途?

我知道这是一个过程,它一直在运行。
但我不明白它在 php 应用程序中的用途是什么?

有人可以举个例子吗?
我可以使用守护进程来减少我的应用程序的内存使用吗?

据我了解,守护进程可以保存数据并根据请求提供数据,所以基本上我可以将大多数可用数据存储在那里,以避免从 mysql 为每个访问者获取数据?

还是我完全错了? :)

谢谢 ;)

最佳答案

Could someone explain me in two words, what is daemon and what use of them in php?



cli应用程序或进程

I, know that this is a process, which is runing all the time. But i can't understand what use of it in php app?



你可以用它来做;对用户或界面不可见的作业,例如数据库陈旧数据清理,计划您想要更新部分的任务或后台数据库或页面上的内容

Can someone please give examples of use? Can i use daemon to lessen memory usage of my app?



我认为 drupal 或 cron 有 cron 脚本......也许检查它会有所帮助。减少内存?不,内存优化总是在应用程序设计或脚本编码上。

As i understand, daemon can hold data and give it on request, so basically i can store most usable data there, to avoid getting it from mysql for each visitor?



不,守护程序是一个脚本,但是您可以创建守护程序脚本可以处理的 JSON 或 XML 数据文件。

关于php - 什么是守护进程?它们的实际用途?与php一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4118053/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com