1

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. 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.

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.

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?

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. 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. Should I stick with them or jump ship and find another web host?

mowwwalker
  • 16,634
  • 25
  • 104
  • 157

3 Answers3

2

Easy one : if you host allows this, get your PHP scripts to use upload_tmp_dir a custom tmp directory for uploads.

That way, it will depend on up your hosting space only !

Justin T.
  • 3,643
  • 1
  • 22
  • 43
1

PHP have the disk_free_space function which you can use to monitor /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. The downside to that is that you must be your own sysadmin, but at least you get what you need in terms of software.

Emil Vikström
  • 90,431
  • 16
  • 141
  • 175
  • I'm quit intimidated by vps's. I have very little linux experience (might be the last Windows user on SO...) and the idea of installing everything myself seems quite daunting. I use cpanel for a lot of things, and wouldn't want to pay for a license for it. If I decide to try this route though, how can I emulate the experience of a vps with a virtualbox and linux? Or, are there free online vps's? – mowwwalker May 14 '12 at 08:59
  • I fully understand your concerns. It's a big step to go from fully-managed shared hosting to nothing-managed dedicated hosting. You can run Linux in a virtual machine on your own computer (e.g., VirtualPC or Virtualbox) to get a feeling for what needs to be done. The networking part may be hard to configure though, so it's somewhat hard to try out web hosting that way. The best would be if you have a spare PC you can dedicate to the project (from your perspective as a customer, the VPS is exactly the same as a dedicated machine). You should try to only use the commandline as well. – Emil Vikström May 14 '12 at 09:06
  • As a matter of fact, I have a real piece of junk that no one uses. I think 256mb ram, 20gb hard drive type thing. I tried installing debian at one point and it was taking hours. Would it be worth getting something like a raspberry pi to experiment with? – mowwwalker May 14 '12 at 09:09
  • 1
    It's *always* worth getting a Raspberry Pi, isn't it? ;-) But 256 MB should be enough for trying out (use "Expert" install and don't install any graphical environment!), and 20 GB HDD is more than I currently have on my laptop! – Emil Vikström May 14 '12 at 09:11
  • Really? 20gb is more than you use? What is it, some kind of monster SSD? – mowwwalker May 14 '12 at 09:12
  • I have my main computer at home, but my laptop doesn't use more than 6 GB for the system and programs, and user files are just a couple of hundreds of MB. I run Debian as my main OS at all my machines. Most of my projects are not stored at all on the laptop though, but on a server at home, reachable over the Internet. A minimal Debian install without GUI fits within 1 GB of HDD space. – Emil Vikström May 14 '12 at 09:18
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/11218/discussion-between-walkerneo-and-emil-vikstrom) – mowwwalker May 14 '12 at 09:19
0

You could try to set upload_tmp_dir and whatnot to places inside of your personal area instead of the global /tmp. This would, however, require access to a php.ini file. 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).

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).

Corbin
  • 33,060
  • 6
  • 68
  • 78