Fork me on GitHub

2009/02/16

はてな
さらに朗報は続く
Google App Engine Blog: The sky's (almost) the limit! "High CPU" is no more.

We're very excited today to announce that we've raised limits on several App Engine operations:

  • No more "High CPU Requests"! App Engine Apps were once allowed no more than 2 CPU-intensive requests per minute. We've made some adjustments to the way we handle requests, and have eliminated this limitation altogether. To learn more about how this works and the implications for your app, see our documentation.
  • Response deadline raised to 30 seconds. The amount of time an App Engine app can take to respond to an incoming request has been raised from 10 to 30 seconds! There are limits on the number of simultaneous active requests an application can process at any given moment--see our docs to learn more.
  • Size limits on code files, static files, and requests/responses raised to 10MB! App Engine apps can now receive requests and send responses of up to 10MB in size, and users can upload 10MB code and static files as well. Note that API requests (e.g. memcache.set(), db.put()) are still limited to 1MB in size.
http://googleappengine.blogspot.com/2009/02/skys-almost-limit-high-cpu-is-no-more.html
Google App Engineに1分あたり2CPU以上負荷を掛ける様なリクエストが許される事になりました。
またレスポンスのデッドラインが10秒から30秒にまで引き上げられました。
さらにコード、静的ファイル、および要求/応答におけるサイズ制限が10MBに引き上げられました(但しmemcache.set()、db.put()はまだ1MBに制限されています)。

これで例えば、デカいクエリを投げる様な処理でもエラーで落ちるって事が少なくなるんじゃないですかね。
もうすぐすると、Google App Engineでタイマ発動処理をサポートするという噂もあるので、よりインタラクティブな処理が作れるんじゃないですかね。

2009/02/10

はてな
これは朗報。
Google App Engine Blog: SDK version 1.1.9 Released
  • You can now use the Python standard libraries urllib, urllib2 or httplib to make HTTP requests. This has been a frequent request on our issue tracker.
  • We've been working on a set of tools that will make the process of uploading and downloading data from App Engine applications easier. Today we're excited to announce an early release of our new bulk uploading client. You can try it out here. Let us know what you think in our Google Group!
  • Several updates to our datastore, including the automatic generation of single property indexes and the addition of IN and != operators to db.Query. See the Datastore API docs for more details.
  • A bunch of additional bugfixes and enhancements, listed in our Release Notes.
http://googleappengine.blogspot.com/2009/02/sdk-version-119-released.html
試しに以下の様なコードを書いて
import urllib2

f = urllib2.urlopen('http://www.google.com/')
print "Content-Type: text/plain;"
print
print f.read()

実行させてみた。

おー動いてる。これで今までGoogle App Engineのurlfetch API様にパッチを当ててきた物が要らなくなる。

2008/09/17

はてな
Google App Engineにファイルを転送しようとするとき、ファイルの数が多いと途中で失敗したり時間が掛かったりと結構嫌な思いをする事があったのですが、今日公開されたGAE SDK 1.3にてstaticファイルをZIPでまとめる事が出来る様になりました。
Google App Engine Blog: SDK 1.1.3 Now Available for download

Support for zipimport and a new module, zipserve, which serves static files from a zip archive. These allow you to work past the 1000-file app deployment limit.

The development console now includes a memcache viewer (you can use this by accessing http://localhost:8080/_ah/admin while your app is running on the SDK).

URLFetch now allows users to disable automatically following HTTP redirects.

We now allow composite indexes with repeated properties.

http://googleappengine.blogspot.com/2008/09/sdk-113-now-available-for-download.html
使い方も簡単。まず以下の様な構成のzipファイルを用意します。
Archive:  zippage.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
      289  08/09/17 13:03   index.html
      203  08/09/17 12:53   test.html
     4233  08/01/30 15:55   logo.png
 --------                   -------
     4725                   3 files
そしてアプリケーションハンドラの設定を以下の様に設定します。
import wsgiref.handlers
from google.appengine.ext import webapp
from google.appengine.ext import zipserve

def main():
  application = webapp.WSGIApplication(
    [
      ('/zippage/(.*)', zipserve.make_zip_handler('zippage.zip')),
    ])
  wsgiref.handlers.CGIHandler().run(application)

if __name__ == '__main__':
  main()
もちろんハンドラを分ければ、あるURLではpythonのハンドラ、あるURLではZIP内ファイルという事も出来ます。なお、動いている物はこの辺で確認出来ます。
他にも今回のバージョンアップにて開発者用コンソールにMemcache Viewerが使える様になりました。
gae-memcache-viewer
直接値を編集する事も出来ますが、現状マルチバイト文字でエラーが出ているようです。
他、URLFetchでURLの自動フォローを出来ないようになったり等の修正も行われています。

話は変わって、tokuhiromさん作のjavascript v8エンジンで動くCGIインタフェースllv8callですが、tokuhiromさんが入れ込んでる機能をwin32に移植して行っていますがlibmemcachedのwin32版がMSVCでビルド出来なかったので、自前でmemcacehdとお喋りする様にしました。興味がある方はこの辺のソースをご覧下さい。


2008/04/08

はてな
コードはcodereposに置いておきます。
/lang/python/webSimple
google appengineのurlfech APIがある場合は、そちらを使うようになっています。
ただしgoogle appengineにはminidomが使っているpyexpatが入ってないのでcontentを取得するまでは動きますがparse_xmlは動きません。
つまりはgoogle appengineのボツネタ第一号って事になりました。
なおfilckr_echo.plをpythonで書いた場合のコードは以下の様になります。
#!-*- coding:utf-8 -*-
from webSimple import Simple

api = Simple({
    'base_url' : 'http://api.flickr.com/services/rest',
    'param' : {
        'api_key' : 'your-api-key'
    },
})
res = api.get({
    'method' : 'flickr.test.echo',
    'name' : 'value',
});
print res.parse_xml().getElementsByTagName('name')[0].childNodes[0].data
google appengineでない場合には使えるのでよかったらどうぞ。
10分程度で作った物なので適当ですが