无论设置正确与否,PHP 连接都会在大文件上传时重置

发布于 2024-12-07 09:46:55 字数 496 浏览 1 评论 0原文

我遇到了一个非常常见的问题,似乎找到的所有可用解决方案都不起作用。

我们有一个接收大量流量的 LAMP 服务器。使用此服务器,我们执行定期文件提交上传。在小文件上传时,它工作得很好。对于大约 4-5MB 的文件,此提交上传会间歇性失败(有时有效,但很多时候失败)。

我们的 PHP 上有以下配置:

max_input_time: 600
max_execution_time: 600
max_upload_size: 10M
post_max_size: 10M

Apache 设置:

Timeout: 600
Keep-Alive Timeout: 15
Keep-Alive: On
Per Child: 1000
Max Conn: 100

因此,我想知道是否有人可以帮助我解决这个问题。我们在网上找到了问题和解决方案,但没有一个适用于我们的案例。

太感谢了。非常感谢任何意见/反馈!

I am having a very common problem which it seems that all the available solutions found are not working.

We have a LAMP server which is receiving high amount of traffic. Using this server, we perform a regular file submission upload. On small file uploads, it works perfectly. On files of around 4-5MB, this submission upload failed intermittently (sometimes it works but many times it failed).

We have the following configuration on our PHP:

max_input_time: 600
max_execution_time: 600
max_upload_size: 10M
post_max_size: 10M

Apache setting:

Timeout: 600
Keep-Alive Timeout: 15
Keep-Alive: On
Per Child: 1000
Max Conn: 100

Thus, I wonder if anyone can help me with this. We have found the issues and solutions online but none of them work in our case.

Thank you so much. Any input / feedback is much appreciated!

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

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

发布评论

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

评论(1

滥情空心 2024-12-14 09:46:55

连接可能会在几个地方终止:

  1. Apache
  2. php.ini 内的帖子大小限制
  3. php.ini 内的内存限制
  4. php.ini 内的输入时间限制 php.ini
  5. 内的执行时间限制或 set_time_limit()

我会增加所有这些,看看它是否仍然存在。但是您必须反弹 apache 才能使 php.ini 内部的更改生效。

这些还受到最终用户的连接速度的影响,如果某些用户失败,那是因为他们的连接速度比其他人慢,并且他们与服务器的连接正在终止。

The connection coud be terminating at several places:

  1. Apache
  2. Post size limit inside of php.ini
  3. Memory limit inside of php.ini
  4. Input time limit inside of php.ini
  5. Execution time limit inside of php.ini or set_time_limit()

I would increase all of these, and see if it still persists. But you will have to bounce apache for the changes inside of php.ini to take affect.

These are also affected by what kind of connection speed the end user has, if it is failing for certain users, it's because their connection is slower than others, and their connection with the server is terminating.

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