14đź‘Ť
This is a horrible suggestion but I’ll make it anyway:
Build a little client application or just use wget
with cron
to periodically access your app, maybe once every 5 minutes or so. That should keep Google from putting it into a dormant state.
I say this is a horrible suggestion because it’s a waste of resources and an abuse of Google’s free service. I’d expect you to do this only during a short testing/startup phase.
20đź‘Ť
Now Google has added a payment option “Always On” which is 0.30$ a day.
Using this feature, your application will not have to cold start any more.
Always On
While warmup requests help your
application scale smoothly, they do
not help if your application has very
low amounts of traffic. For
high-priority applications with low
traffic, you can reserve instances via
App Engine’s Always On feature.Always On is a premium feature which
reserves three instances of your
application, never turning them off,
even if the application has no
traffic. This mitigates the impact of
loading requests on applications that
have small or variable amounts of
traffic. Additionally, if an Always On
instance dies accidentally, App Engine
automatically restarts the instance
with a warmup request. As a result,
Always On applications should be sure
to do as much initialization as
possible during warmup requests.Even after enabling Always On, your
application may experience loading
requests if there is a sudden increase
in traffic.To enable Always On, go to the Billing
Settings page in your application’s
Admin Console, and click the Always On
checkbox.
http://code.google.com/intl/de-DE/appengine/docs/adminconsole/instances.html
- Python/Django: sending emails in the background
- Why is django's settings object a LazyObject?
- Django can't access raw_post_data
- Django 1.7 upgrade error: AppRegistryNotReady: Models aren't loaded yet
7đź‘Ť
To summarize this thread so far:
- Cold starts take a long time
- Google discourages pinging apps to keep them warm, but people do not know the alternative
- There is an issue filed to pay for a warm instance (of the Java)
- There is an issue filed for Python. Among other things, .py files are not precompiled.
- Some apps are disproportionately affected (can’t find Google Groups ref or issue)
- March 2009 thread about Python says <1s (!)
I see less talk about Python on this issue.
- Run django app via nginx+uwsgi in a subpath
- Validating a Django model field based on another field's value?
- Django-Rest-Framework serializer class meta
- Assign Value of Named URL to a Variable in Django Templates
- All the values of the many to many field : Django
4đź‘Ť
If it’s responding quickly after the first request, it’s probably just a case of getting the relevant process up and running. Admittedly it’s slightly surprising that it takes so long that it times out. Is this after you’ve updated the application and verified that the AppEngine dashboard shows it as being ready?
“First hit slowness” is quite common in many web frameworks. It’s a bit of a pain during development, but not a problem for production.
- Is exposing a session's CSRF-protection token safe?
- AttributeError: 'NoneType' object has no attribute 'attname' (Django)
- Django Newsletter App
- Enable PK based filtering in Django Graphene Relay while retaining Global IDs
4đź‘Ť
One more tip which might increase the response time.
Enabling billing does increase the quotas, and, to my personal experience, increase the overall response of an application as well. Probably because of the higher priority for billing-enabled applications google has. For instance, an app with billing disabled, can send up to 5-10 emails/request, an app with billing enabled easily copes with 200 emails/request.
Just be sure to set low billing levels – you never know when Slashdot, Digg or HackerNews notices your site 🙂
3đź‘Ť
I encounteres the same with pylons based app. I have the initial page server as static, and have a dummy ajax call in it to bring the app up, before the user types in credentials. It is usually enough to avoid a lengthy response… Just an idea that you might use before you actually have a million users ;).
- How to populate user profile with django-allauth provider information?
- Django docker – could not translate host name "db" to address: nodename nor servname provided, or not known
- ProgrammingError: relation "django_session" does not exist
3đź‘Ť
I used pingdom for obvious reasons – no cold starts is a bonus. Of course the customers will soon come flocking and it will be a non-issue
1đź‘Ť
You may want to try CloudUp. It pings your google apps periodically to keep them active. It’s free and you can add as many apps as you want. It also supports azure and heroku.
- Cross platform interface for virtualenv
- How to show more than 100 items on each paginated "Change List" page in Django Admin?
- ProgrammingError: relation "django_session" does not exist