google app engineã§LIMITãè¶ ãã¦ã¿ã
éã¢ãSNSå
ã§ãmixiã®ecooã®ãããªã
twitterã®ãã¼ãªãã®ããgoogle app engineã使ã£ã¦éçºãã¦ã¿ãã
使ã£ãè¨èªã¯Ajax + Flash + gae(python+mysql+memcached)ã
ããã§ãææãï¼googleãéä¿¡ãããã¦
ãªã¯ã¨ã¹ãã®åº¦ã«SQLãããããããªâã¿ãããªå¦çãããã¦ãããï¼è¨èªã¯pythonï¼
def get : sql = 'SELECT * FROM hoge LIMIT 50'; dbObj = db.GqlQuery(sql); ..
ãã£ã¹ã¯ï¼å¸¯åï¼CPUã®é ã«å¶éã...ã®è¨äºã©ããã®ç¾è±¡ãçºçã1æ¥ï¼ï¼ä¸ãªã¯ã¨ã¹ããããã§CPUãªã¼ãã¼ãï½
è¦æ¨¡ã¨ãã¦ã¯ã ããããç´1æ¥10ä¸ã30ä¸pvç¨åº¦ã§ã
ä¼å¡æ°ã¯20000人ã§openPNEã§åãã¦ããµã¼ãã¹ã
ããã§ãä»æ§ãã¿ãªãã㦠memcacached åãã¦ã¿ãã¼ã¨ããã£ã¦ã
def get : dbs = []; if memcache.get( "db" ) is None: dbs = db.GqlQuery('SELECT * FROM hoge LIMIT 50'); memcache.add(cache_key, dbs , 60*60*10); else : dbs = memcache.get( "db" ) ...
ã¾ã¼ããã£ããã ãã©ãããªãããã«ãã¦ã¿ãããã¼ãããã
ãã¡ãããmemcachedããå¼ãã§ããã¦ã¯ãããã ãã©ã
ãªããããããã¼ãã¾ããçµæã ãããã£ãã·ã¥ãããã
ãDBã®å¦çãè¡ã£ã¦ãã®çµæãåºããã¾ã§ã®å¦çãã®ãã®ã
ãã£ãã·ã¥ããã¦ãã¾ãã¿ããã§ãçµæã ãããã¾ãåç´ã§ããªããã¼ã ã
ãã®å¾ããã®çµæãã³ãã³ããã¦åºåããhtmlã®ã¿ã
memcachedããã¦ã¿ããã¼ãªã®ã«ããã¦ã¿ãã¨ãã
ã©ãã
ã¼ãã¨CPUè² è·ã¯ãããã¾ããã¨ãã
ã¾ãããããã¾ããªãã ãã©ã
google app engineã§ãå²ã¨ãã£ããããªãã¨
ãããªäºã«ãªã£ã¡ãããã¼ã£ã¦ãã人æ±ã¬ãã§ããã¨ãã
ã¡ãªã¿ã«ãããªãã®openPNEã§ãåããããªãã£ããæ©è½å®è£
ãããï¼
ã¨ãã£ã¦è¦æãããã°ãåãåãããã ãããªã
åèãªã³ã¯
http://code.google.com/intl/ja/appengine/docs/python/memcache/