简体   繁体   English

服务器的tmp目录填满了吗?

[英]Server's tmp directory filling up?

Today there were some problems with my site: php file uploads weren't handling properly, and none of the passenger-wsgi python scripts were executing. 今天我的网站出现了一些问题:php文件上传没有正确处理,并且没有乘客-wsgi python脚本正在执行。 I contacted my webhost, and they said that the server's tmp directory had reached a "disk space shortage" and that they fixed the problem. 我联系了我的webhost,他们说服务器的tmp目录已达到“磁盘空间不足”并且他们修复了问题。

The same thing started happening a couple minutes later, to which they replied similarly that the problem is now fixed. 同样的事情在几分钟后开始发生,他们同样回答说问题现在已经解决了。

I haven't had a problem since, but I'm quite worried this is going to be an ongoing thing. 从那以后我没有遇到任何问题,但我很担心这将是一个持续的事情。 They sent me: 他们发给我了:

We unfortunately cannot guarantee that the issue will happen again because a new user may abuse /tmp but we do usually resolve these issues within 10 or 15 minutes of them being detected from our monitoring system. 遗憾的是,我们无法保证问题会再次发生,因为新用户可能会滥用/ tmp,但我们通常会在10或15分钟内从我们的监控系统中检测到这些问题。

I'm on shared hosting, so this isn't completely unexpected, but it's still rather unsettling. 我正在共享托管,所以这并非完全出乎意料,但它仍然令人不安。 Is there anything I can do in this case? 在这种情况下我能做些什么吗? Is there any way I can at least know when it's going to happen - perhaps checking the used space in tmp along with the total allowed space with PHP? 有什么方法我至少可以知道它何时会发生 - 也许用tmp检查tmp中的已用空间以及允许的总空间?

This isn't the first problem I've had with them, and I've only used them for about 2 weeks now, so I'm considering the 45 money back guarantee and finding another host. 这不是我和他们一起遇到的第一个问题,我现在只使用它们大约2周,所以我正在考虑45退款保证并找到另一个主机。 I haven't, however, been to find a good php/python host that either supports M2Crypto and other Python modules I use or would allow me to install them myself. 但是,我没有找到一个好的php / python主机,它支持M2Crypto和我使用的其他Python模块,或者允许我自己安装它们。 Should I stick with them or jump ship and find another web host? 我应该坚持使用它们还是跳船并找到另一个网络主机?

Easy one : if you host allows this, get your PHP scripts to use upload_tmp_dir a custom tmp directory for uploads. 简单的一个:如果你的主机允许这个,请让你的PHP脚本使用upload_tmp_dir一个自定义的tmp目录进行上传。

That way, it will depend on up your hosting space only ! 这样,它只取决于您的托管空间!

PHP have the disk_free_space function which you can use to monitor /tmp. PHP具有disk_free_space函数,您可以使用它来监视/ tmp。 This should, however, not be needed . 但是,这不应该是必需的。 It's the hosts responsibility to solve this once and for all. 主人有责任一劳永逸地解决这个问题。

I have myself worked as a system administrator on a shared web hosting company and I know that a solution to these types of issues are vital. 我自己在共享的网络托管公司担任系统管理员,我知道解决这些类型的问题至关重要。 A full temp directory will effectively shut out almost all websites on the server so it should be in their best interest to find a solution, otherwise the customers will leave. 完整的临时目录将有效地关闭服务器上的几乎所有网站,因此找到解决方案应该符合他们的最佳利益,否则客户将离开。 You should ask them them what plans they have to resolve this issue. 你应该告诉他们他们有什么计划来解决这个问题。 If you get a stupid know-nothing answer, demand that the issue gets escalated to a technician so you can talk (or e-mail) with someone in charge. 如果您得到一个愚蠢的无知答案,请求将问题升级为技术人员,以便您可以与负责人交谈(或发送电子邮件)。 Don't let them put this issue aside, but demand a long-term solution, otherwise it will happen again. 不要让他们把这个问题放在一边,但需要长期解决方案,否则再次发生。

If you are unable to find shared hosting up to your needs, try a dedicated virtual hosting (VPS) instead. 如果您无法找到满足您需求的共享主机,请尝试使用专用虚拟主机(VPS)。 The downside to that is that you must be your own sysadmin, but at least you get what you need in terms of software. 这样做的缺点是你必须是自己的系统管理员,但至少你得到了你需要的软件。

You could try to set upload_tmp_dir and whatnot to places inside of your personal area instead of the global /tmp. 您可以尝试将upload_tmp_dir和whatnot设置为个人区域内的位置而不是global / tmp。 This would, however, require access to a php.ini file. 但是,这需要访问php.ini文件。 Access that you probably don't have. 您可能没有的访问权限。 Also, if you don't have access to anything above the webroot, you shouldn't do this (and you should promptly leave the host -- putting things above the webroot is essential). 此外,如果您无法访问webroot上方的任何内容,则不应该这样做(并且您应该立即离开主机 - 将内容放在webroot上面是必不可少的)。

In short, if this problem persists, I would leave the host. 简而言之,如果这个问题仍然存在,我会离开主持人。 There's not much you can do about it other than take your business else where. 除了将您的业务带到其他地方之外,您无能为力。

I avoid shared hosting for situations like this. 我避免在这种情况下共享托管。 You can get stable, well resourced VPSs for fairly cheap these days (though that of course brings it's own set of problems, especially if you're hosting a small number of sites). 这些天你可以以相当便宜的价格获得稳定,资源充足的VPS(当然这会带来一系列问题,特别是如果你要托管少量网站)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM