views:

56

answers:

3

I'm going to build a little service which monitors an IMAP email account and acts on the read messages. For this it just has to run every say 10 min, no external trigger required, but I want to host this service externally (so that I don't need to worry about up times.)

To be machine independent I could write the service in Java or Python. What are good hosting providers for this? and which of the two languages is better supported?

The service has either to run the whole time (and must do the waiting itself) or it has to be kicked off every 10 min. I guess most (web) hosts are geared towards request driven code (e.g. JSP) and I assume they shut down processes which run forever. Who offers hosting for user-written services like the one mentioned above?

A: 

Check out Google App Engine. You can set up a cron job for your Java or Python script.

advait
+1  A: 

Depending on what actions you require, and your requirements for resources, Google App Engine might be quite suitable for both Python and Java services (GAE supports both languages quite decently). cron jobs can be set to run every 10 minutes (the URL I gave shows how to do that with Python) and you can queue more tasks if the amount of work you need to perform on a certain occasion exceeds the 30-seconds limit that GAE supports.

GAE is particularly nice to get started and experiment since it has reasonably-generous free quotas for most all resources your jobs could consume (you need to enable billing, provide a credit card, and set up a budget, to allow your jobs to consume more than their free quota, though).

If you decide that GAE has limitations you can't stand, or would cost you too much for billed use of resources over the free quotas, any hosting provider supporting a Unix-like cron jobs scheduler should be acceptable. Starting up from scratch a Python script every 10 minutes may be faster than starting up from scratch a JVM, but that depends on what it is that you have to do every 10 minutes (for some kinds of tasks Python will be just as fast, or maybe even faster -- for others it will be slower, and we have no way to guess what kinds of tasks you require or at what "tipping point" the possibly-faster JVM will "pay for its own startup" wrt the possibly-slower Python... basically you'll need to assess that for yourself!-).

Alex Martelli
thanks heaps for the detailed info. i will give GAE a go!
halloleo
@halloleo, I see other answers suggest that too, but I'm glad to hear the details were of help!
Alex Martelli
+3  A: 

You are lucky, since Google AppEngine provides CRON jobs both for Python and Java. GAE - Python GAE - Java

houman001
An important feature of AppEngine is that it has very generous free levels of service. It's possible that you might be able to run you application at no cost to you at all. Also, the google-app-engine tag here on SO is very active, and you'll have no trouble getting any problems resolved.
Adam Crossland