How to keep an App Engine/Java app running with deaf requests from a Java/Python web cron?

前端 未结 4 1855
失恋的感觉
失恋的感觉 2021-01-14 16:04
  1. App Engine allows you 30 seconds to load your application
  2. My application takes around 30 seconds - sometimes more, sometimes less. I don\'t know how to fix th
相关标签:
4条回答
  • 2021-01-14 16:22

    App engine also has a new PAY feature where you can have it "always-on". Costs about $0.30 USD cents a day. Just go into your billing settings and enable it if you don't mind paying for the feature. I believe it guarantees you at least 3 instances always running.

    (I didn't realize hitting a /ping url which caused an instance to spin up would cause it to exceed the 30 sec limit!)

    0 讨论(0)
  • 2021-01-14 16:32

    It would probably be easier use the cron built in to App Engine to keep your application alive.

    0 讨论(0)
  • 2021-01-14 16:32

    I think what you want is just:

    import httplib
    hcon = httplib.HTTPConnection("foo.appspot.com")
    hcon.request("GET", "/someURL")
    hcon.close()
    
    0 讨论(0)
  • 2021-01-14 16:39

    the simplest Java http pinger:

    URLConnection hcon = new URL("http://www.google.com").openConnection();
    hcon.connect();
    hcon.getInputStream().read();
    
    0 讨论(0)
提交回复
热议问题