设置更高的内存限制有哪些潜在问题?

发布于 2024-10-07 17:38:11 字数 47 浏览 0 评论 0原文

当 php.ini 中的内存限制设置为 100MB 时,可能会遇到哪些潜在问题?

What are the potential problems that could be encountered when the memory limit in php.ini is set to say 100MB?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

左秋 2024-10-14 17:38:11

我只能看到明显的一个:贪婪或损坏的脚本可能会占用您的大量资源。如果多个客户端同时请求这样的脚本,则可能会成为服务器的严重资源问题。

根据您的用例,也许明智的做法是增加每个脚本的内存限制。

I can see only the obvious one: That a greedy or broken script can hog a lot of your resources. If such a script gets requested by multiple clients simultaneously, it could become a serious resource problem for your server.

Depending on your use case, maybe it's wise to increase the memory limit on a per-script basis instead.

野生奥特曼 2024-10-14 17:38:11

在 Linux 上,如果服务器内存不足,它就会开始交换(使用慢速硬盘作为虚拟内存)。

如果交换空间用完,它就会开始半随机地终止进程(算法很复杂并且通常难以预测)。

On Linux, if the server runs out of memory, it starts swapping (using slow hard disk for virtual memory).

If it runs out of swap, it starts killing processes at semi-random (the algorithms are complex and usually hard to predict).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文