正しい実装でt.coの見えない世界へ
document: https://dev.twitter.com/docs/streaming-api/user-streams
正しい実装でt.coの見えない世界へ
document: https://dev.twitter.com/docs/streaming-api/user-streams
import functools | |
import logging | |
from google.appengine.api import memcache | |
def cached(time=1200): | |
""" | |
Decorator that caches the result of a method for the specified time in seconds. | |
Use it as: | |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
public class SampleFragment extends Fragment { | |
/** Fragmentで保持しておくデータ */ | |
private int mData; | |
/** | |
* Fragmentインスタンスを生成した返却. | |
* | |
* コンストラクタに引数を渡すのはダメ。 | |
* Fragmentがメモリ不足で破棄され、そこから復帰する時に空のコンストラクタ呼ばれる。 |
2024-04-11
時雨堂
2024.4
時雨堂クラウドサービスを支える技術
#import <Foundation/Foundation.h> | |
@interface NSURL (dictionaryFromQueryString) | |
-(NSDictionary *) dictionaryFromQueryString; | |
@end |
2013-11-02
0.0.3
@voluntas
概要
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "VPC knowhow template", | |
"Parameters": { | |
"KeyName": { | |
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances", | |
"Type": "String", | |
"MinLength": "1", | |
"MaxLength": "64", | |
"AllowedPattern": "[-_ a-zA-Z0-9]*", |