i?php require_once('chorus/Utils.php'); require_once('chorus/Kestrel.php'); require_once('chorus/DataService.php'); require_once('chorus/Shard.php'); Database::set_defaults(array( 'user' => 'tumblr3', 'password' => 'm3MpH1C0Koh39AQD83TFhsBPlOM1Rx9eW55Z8YWStbgTmcgQWJvFt4', 'database' => 'tumblr3', // 'write_lock_tables' => '*', 'extended_log' => (idate('G') == 17 && intval(idate('i')) == 56 && trim(`hostname`) == 'web10.tumblr.com') )); if (__FILE__ == '/var/www/apps/tumblr/config/config.php' || __FILE__ == '/data/tumblr/config/config.php') { define('ENVIRONMENT', 'production'); if (! defined('DEFAULT_DATABASE')) define('DEFAULT_DATABASE', 'primary'); define('S3_BUCKET', 'data.tumblr.com'); define('ENABLE_PANTHER', true); define('ENABLE_MEDIA_CDN', true); define('ASSETS_URL', (ENABLE_MEDIA_CDN && ! (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'http://assets.tumblr.com' : '')); define('MEMCACHE_HOST', '10.252.0.68'); define('MEMCACHE_VERSION_HOST', '10.252.0.67'); define('VALIDATION_FAILURE_LOG', BASE_PATH . '/validate.log'); define('REDIRECT_403_LOG', BASE_PATH . '/403.log'); define( 'GOOGLE_API_KEY', (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'www.tumblr-beta.com') ? 'ABQIAAAAJlAd0HJn-kbPSqUsrS6CyhTpoeXstiwCMpsI5pU3slU-WDRPJxQts41ksQogKsyRsq_7Er6g4bSs0g' : 'ABQIAAAAJlAd0HJn-kbPSqUsrS6CyhTRJXjjauvD2gSXXVziOjeBJgmKOBTPW-8l5i5Pbk9Bvb1VCh4uVklE2g' ); Database::add('primary', array('host' => '192.168.200.142')); Database::add('db-tumblelogs', array('host' => '192.168.200.103')); //Database::add('db1', array('host' => '192.168.200.113' /* db-notifs */)); //Database::add('db1', array('host' => '192.168.201.58' /* db-notifs mmm writer */)); Database::add('db1', array('host' => '192.168.201.56' /* db-notifs01 */)); Database::add('db2', array('host' => '192.168.200.35')); Database::add('db3', array('host' => '192.168.201.71')); Database::add('db4', array('host' => '192.168.200.37')); Database::add('db-index-dashboard', array('host' => '192.168.200.115' /* slave-notes05 */)); Database::add('tumblr_feeds', array('host' => '192.168.200.100', 'database' => 'tumblr_feeds')); Database::add('stats_heap', array('host' => '192.168.200.100')); Database::add('tumblelogs-index', array('host' => '192.168.200.118')); Database::add('db-likes', array('host' => '192.168.200.236')); Database::add('db-tags', array('host' => '10.42.0.134')); //Database::add('db-users', array('host' => '192.168.200.117')); Database::add('db-users', array('host' => '192.168.200.137')); Database::add('db-notes', array('host' => '192.168.200.116')); Database::add('db-logs', array('host' => '192.168.200.81')); Database::add('db-themebackups', array('host' => '192.168.200.115')); Database::add('db-globaltags', array('host' => '192.168.200.83')); Database::add('db-primary01', array('host' => '192.168.200.22')); Database::add('db-primary02', array('host' => '10.42.0.253')); //dbm-blogsB100.d2 Database::add('db-primary03', array('host' => '192.168.200.190')); //Database::add('db-primary03', array('host' => '10.42.1.1')); //dbm-blogsC100.d2 // Database::add('db-primary04', array('host' => '192.168.200.101')); Database::add('db-primary04', array('host' => '10.42.0.245')); Database::add('db-primary05', array('host' => '192.168.201.51')); // shard 05 mmm writer vip //Database::add('dbm-blogsF', array('host' => '10.42.0.180')); //dbm-blogsF100.d2 Database::add('dbm-blogsF', array('host' => '10.42.0.172')); //dbm-blogsF101.d2 Database::add('dbm-unpublishedpostsref', array('host' => '10.252.0.138')); Database::add('dbs-unpublishedpostsref', array( 'host' => array( '10.252.0.138', // db-tags.tumblr.com (master) ), )); Database::add('dbm-legacy-nonpost', array('host' => '10.252.0.142')); Database::add('dbs-legacy-nonpost', array( 'host' => array( '10.42.0.144', // legacy-slave1.d2.tumblr.com '10.42.0.146', // legacy-slave2.d2.tumblr.com ), )); Database::add('slave-globaltags', array( 'host' => array( '192.168.200.83' // master ), 'inherit' => 'db-globaltags', 'failover' => 'db-globaltags' )); Database::add('slave-users', array( 'host' => array( '192.168.200.137', // db-users (MASTER) //'192.168.200.117', // slave-users01 (THIS WAS MASTER, ISSUES) '192.168.200.158', // slave-users02 (SLAVE) '192.168.200.159', // slave-users03 (backups) //'192.168.201.72', // slave-users04 (slave?) ), 'inherit' => 'db-users', 'failover' => 'db-users' )); Database::add('slave-likes', array( 'host' => array( '192.168.200.236', // db-likes01.tumblr.com (master) '192.168.200.102', // slave-likes01.tumblr.com '192.168.200.102', // (x2) //'192.168.200.157', // slave-likes02.tumblr.com (backups) ), 'inherit' => 'db-likes', 'failover' => 'db-likes' )); Database::add('slave', array( 'host' => array( //'192.168.200.54', // slave11 (slow slave) '192.168.200.55', // slave12 '192.168.200.56', // slave13 '192.168.200.57', // slave14 '192.168.200.58', // slave15 //'192.168.200.77', // slave16 //'192.168.200.112', // slave17 - spare (backups) ), 'write_lock_tables' => '*', 'failover' => 'primary' )); Database::add('db-friends', array('host' => '192.168.200.120')); Database::add('slave-friends', array( 'host' => array( '192.168.200.121', // slave-friends01 '192.168.200.120', // db-friends (master) //'10.42.0.136', // dbs-friends100.d2.tumblr.com (backups) ), 'failover' => 'db-friends' )); Database::add('slave-themebackups', array( 'host' => array( '10.252.0.115', // db-themebackups.tumblr.com (master) '10.42.0.217', // dbs-themebackups100.d2.tumblr.com //'10.42.0.229', // dbs-themebackups101.d2.tumblr.com (backups) ), 'failover' => 'db-themebackups' )); Database::add('slave-following', array( 'host' => array( //'192.168.200.54', // slave11 (moved to slow-slave, ugh) '192.168.200.55', // slave12 '192.168.200.56', // slave13 '192.168.200.57', // slave14 '192.168.200.58', // slave15 //'192.168.200.77', // slave16 //'192.168.200.112', // slave17 - spare (backups) ), 'write_lock_tables' => '*', 'failover' => 'primary' )); Database::add('slave3', array('inherit' => 'slave', 'host' => '192.168.200.12')); Database::add('slave-notes', array( 'host' => array( '192.168.200.23', // slave-notes01 '192.168.200.116', // db-notes (master) //'192.168.200.82', // slave-notes02 //'192.168.200.116', // slave-notes09 (being used by david, new notes_dev) //'192.168.200.17', // slave5 - spare (backups) ), 'failover' => 'db-notes' )); Database::add('slave-db1', array( 'host' => array( //'192.168.201.59', // db-notifs mmm reader '192.168.201.57', // db-notifs02 //'192.168.200.34', // slave-notifs01 //'192.168.200.59', // slave-notifs02 ), 'failover' => 'db1' )); Database::add('slave-notifs', array( 'host' => array( //'192.168.201.59', // db-notifs mmm reader '192.168.201.57', // db-notifs02 //'192.168.200.34', // slave-notifs01 //'192.168.200.59', // slave-notifs02 ), 'failover' => 'db1' )); Database::add('slave-tumblelogs', array( 'inherit' => 'slave', 'host' => array( //'192.168.200.78', // slave-tumblelogs01 //'192.168.200.60', // slave-tumblelogs02 //'192.168.200.37', // slave-tumblelogs03 - spare '192.168.200.39', // slave-tumblelogs04 - ssd '192.168.200.113', // slave-tumblelogs05 - ssd //'10.42.0.140', // dbs-tumblelogs100.d2 - ssd ), 'failover' => 'db-tumblelogs' )); Database::add('slave-tumblelogs-index', array( 'host' => array( '192.168.200.119', // slave-tumbleindex01 '192.168.200.139', // slave-tumbleindex02 ), 'failover' => 'tumblelogs-index' )); Database::add('slave-tags', array( 'host' => array( //'192.168.200.164', // slave-tags01.tumblr.com '10.42.0.182', // dbs-posttags.d2 //'192.168.200.150', // slave-tags.tumblr.com (backups) ), //'failover' => 'db-tags' )); Database::add('slave-index-dashboard', array( 'host' => array( //'192.168.200.115', // slave-notes05.tumblr.com (master) '192.168.200.160', // slave-postsindex01.tumblr.com //'192.168.200.161', // spare-ssd01.tumblr.com ), 'failover' => 'db-index-dashboard' )); Database::add('slave-ref', array( 'inherit' => 'slave', 'host' => array( //'10.252.0.191', // db-postref //'192.168.200.79', // slave-ref01 //'192.168.200.80', // slave-ref02 //'192.168.200.81', // slave-ref03 '192.168.200.155', // slave-ref05 '192.168.200.163', // slave-ref06 // '192.168.200.122', // slave-ref07 '192.168.200.123', // slave-ref08 '192.168.200.114', // slave-ref09 '192.168.200.124', // slave-ref10 //'192.168.200.162', // slave-ref11 //'192.168.201.71', // slave-ref12 //'192.168.200.38', // slave10 - notes backups '10.42.0.138', // dbs-postref100.d2 ), 'failover' => 'db3' )); Database::add('slave-slow', array( 'inherit' => 'slave', 'host' => array( //'192.168.200.61', // slave19 //'192.168.200.135', // slave20 '192.168.200.189', // slave21 //'192.168.200.54', // slave11 ), 'failover' => 'slave' )); Database::add('slave-search-local', array( 'inherit' => 'slave', 'host' => array( //'127.0.0.1', // localhost // slave-slow //'192.168.200.22', // slave7 //'192.168.200.61', // slave19 '192.168.200.135', // slave20 '192.168.200.189', // slave21 '192.168.200.54', // slave11 //'192.168.200.33', // db1 // slave (main) //'192.168.200.55', // slave12 //'192.168.200.56', // slave13 //'192.168.200.57', // slave14 //'192.168.200.58', // slave15 ) )); Database::add('slave-primary05', array( 'host' => array( '192.168.201.52', // slave-primary05 // original - '192.168.201.54', // mmm reader virtual ip associated with db-primary05 (master) //'192.168.201.55', // mmm reader virutal ip associated with slave-primary05 ), 'inherit' => 'db-primary05', 'failover' => 'db-primary05' )); Kestrel::configure(array( '192.168.200.147', '192.168.200.148', '192.168.200.149', '192.168.200.187', '192.168.200.188', '192.168.200.204', '192.168.200.205', '192.168.200.206', '192.168.200.207', '192.168.200.208', )); define('POST_ID_URL', 'http://192.168.200.20:9000/next-id'); define('KESTREL_MASTER', '192.168.200.100'); // app2 define('VARNISH_IP_AL', '10.42.0.102'); // varnish1.d2.tumblr.com define('VARNISH_IP_MZ', '10.42.0.106'); // varnish2.d2.tumblr.com define('SKIP_EAGER_CACHE_SET_CHANCE', 0.65); } else { define('ENVIRONMENT', 'development'); if (! defined('DEFAULT_DATABASE')) define('DEFAULT_DATABASE', 'primary'); define('S3_BUCKET', 'data.tumblr.com'); define('ASSETS_URL', ''); define('ENABLE_PANTHER', true); define('ENABLE_MEDIA_CDN', true); define('VALIDATION_FAILURE_LOG', BASE_PATH . '/validate.log'); define('REDIRECT_403_LOG', BASE_PATH . '/403.log'); define( 'GOOGLE_API_KEY', 'ABQIAAAAJlAd0HJn-kbPSqUsrS6CyhRHynFsxzvvL0_IN23RhygKuIhc7hTTV_TXEiR9100ct2lSZ6t7sb2eHg' ); define('MEMCACHE_HOST', '127.0.0.1'); define('MEMCACHE_VERSION_HOST', '127.0.0.1'); Database::add('primary', array('host' => '127.0.0.1:3400')); Database::add('db-tumblelogs', array('host' => '127.0.0.1:3430')); Database::add('db1', array('host' => '127.0.0.1:3410')); Database::add('slave-db1', array('host' => '127.0.0.1:3410')); // just db1 for now Database::add('db2', array('host' => '127.0.0.1:3412')); Database::add('db3', array('host' => '127.0.0.1:3413')); Database::add('db4', array('host' => '127.0.0.1:3414')); Database::add('db-index-dashboard', array('host' => '127.0.0.1:3432' /* slave-notes05 */)); Database::add('slave-index-dashboard', array('host' => '127.0.0.1:3441', 'inherit' => 'db-index-dashboard')); Database::add('tumblr_feeds', array('host' => '127.0.0.1:3399', 'database' => 'tumblr_feeds')); Database::add('stats_heap', array('host' => '127.0.0.1:3399')); Database::add('tumblelogs-index', array('host' => '127.0.0.1:3417')); Database::add('db-likes', array('host' => '127.0.0.1:3435' /* slave-notes03 */)); Database::add('slave-likes', array('host' => '127.0.0.1:3435', 'inherit' => 'db-likes')); Database::add('db-tags', array('host' => '127.0.0.1:3437')); Database::add('slave-tags', array('host' => '127.0.0.1:3440')); Database::add('db-users', array('host' => '127.0.0.1:3438')); Database::add('slave-users', array('host' => '127.0.0.1:3439', 'inherit' => 'db-users')); Database::add('db-notes', array('host' => '127.0.0.1:3450')); Database::add('db-logs', array('host' => '127.0.0.1:3452')); Database::add('db-primary01', array('host' => '127.0.0.1:3460')); Database::add('db-primary02', array('host' => '127.0.0.1:3461')); Database::add('db-primary03', array('host' => '127.0.0.1:3462')); Database::add('db-primary04', array('host' => '127.0.0.1:3463')); Database::add('slave', array( 'host' => array( '127.0.0.1:3401', // slave12 ), 'write_lock_tables' => '*', 'failover' => 'primary' )); Database::add('db-friends', array('host' => '127.0.0.1:3433')); Database::add('slave-friends', array( 'host' => array( '127.0.0.1:3434' /* slave-friends01 */ ), 'failover' => 'db-friends' )); Database::add('slave-following', array('inherit' => 'slave')); Database::add('slave-notes', array('inherit' => 'db2')); Database::add('slave-tumblelogs', array('host' => '127.0.0.1:3431' /* slave-tumblelogs01 */)); Database::add('slave-tumblelogs-index', array( 'host' => array( '127.0.0.1:3418', // slave-tumbleindex01 ) )); Database::add('slave-ref', array( 'inherit' => 'slave', 'host' => array( '127.0.0.1:3420', // slave10 ), 'write_lock_tables' => '*', 'failover' => 'slave' )); Database::add('slave-slow', array( 'inherit' => 'slave', 'host' => array( '127.0.0.1:3407', // slave7 ), 'failover' => 'slave' )); Database::add('slave-search-local', array('inherit' => 'slave-slow')); Database::add('slave-search', array('inherit' => 'slave', 'host' => '127.0.0.1:3411' /* search1 */)); Kestrel::configure(array()); // no servers -- will call run() on all tasks, instead of actually queueing // define('DEBUG_REDIRECTS', true); // define('STRICT_DEVELOPMENT_MODE', true); } // Shard configuration ShardManager::add(array( 'db' => 'db-primary01', 'callback' => function($key) { return ($key['tumblelog_id'] < 3000000); }, )); ShardManager::add(array( 'db' => 'db-primary02', 'callback' => function($key) { return ($key['tumblelog_id'] >= 3000000 && $key['tumblelog_id'] < 6000000); }, )); ShardManager::add(array( 'db' => 'db-primary03', 'callback' => function($key) { return ($key['tumblelog_id'] >= 6000000 && $key['tumblelog_id'] < 9000000); }, )); ShardManager::add(array( 'db' => 'db-primary04', 'callback' => function($key) { return ($key['tumblelog_id'] >= 9000000 && $key['tumblelog_id'] < 12695000); }, )); ShardManager::add(array( 'db' => 'db-primary05', 'callback' => function($key) { return ($key['tumblelog_id'] >= 12695000); }, )); // Mirroring ShardManager::add(array( 'db' => 'dbm-blogsF', 'write_callback' => function($key) { return ($key['tumblelog_id'] >= 5000000 && $key['tumblelog_id'] < 6000000); }, )); define( 'IS_SAFE_DOT_TUMBLR', isset($_SERVER['HTTP_HOST']) && in_array( $_SERVER['HTTP_HOST'], array('safe.tumblr.com', 'safe.tumblr', 'safe.tumblr-beta.com') ) ); define( 'SAFE_DOMAIN', (isset($_SERVER['HTTP_HOST']) && ends_with($_SERVER['HTTP_HOST'], 'tumblr.com')) ? 'safe.tumblr.com' : ( (isset($_SERVER['HTTP_HOST']) && ends_with($_SERVER['HTTP_HOST'], 'tumblr-beta.com')) ? 'safe.tumblr-beta.com' : 'safe.tumblr' ) ); define( 'IS_TUMBLR_DOT_COM', isset($_SERVER['HTTP_HOST']) && in_array($_SERVER['HTTP_HOST'], array('184.73.227.231', 'www.tumblr.com', 'tumblr.com', 'tumblr', 'www.tumblr-beta.com', 'tumblr-beta.com')) ); define('LOGIN_SSL_PREFIX', isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'tumblr' ? 'http://tumblr' : (0 || isset($_REQUEST['ssllogin']) ? 'https://www.tumblr.com' : 'http://www.tumblr.com') ); define('ROUTES_404_CONTROLLER', 'tumblelog'); define('ROUTES_404_ACTION', 'execute_router_404'); define('POSTS_PER_PUBLISHER_PAGE', 10); define('S3_KEY_ID', '0RYTHV9YYQ4W5Q3HQMG2'); define('S3_SECRET_KEY', '+m8pTe0qHJ69tlLhj3Sx7k0Xd44nebi3JkaKT688'); define('S3_URL', 'http://s3.amazonaws.com/' . S3_BUCKET . '/'); define('S3_ASSETS_BUCKET', ''); define('HEYWATCH_API_USER', 'tumblr'); define('HEYWATCH_API_PASSWORD', '3GI14tn2mYHhyP'); define('HEYWATCH_API_URL', 'https://heywatch.com'); define('HEYWATCH_S3_PICKUP_BUCKET', 'precoded.video.tumblr.com'); define('HEYWATCH_S3_KEY_ID', 'AKIAIIR72ADPMGUFFGGA'); define('HEYWATCH_S3_SECRET_KEY', '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'); define('HEYWATCH_S3_BUCKET', 'video.tumblr.com'); define('AUTHORIZE_ID', '55SS24VbfX'); define('AUTHORIZE_SECRET_KEY', '5W43msChsX8B7B57'); define('MEDIA_HOST', 'media.tumblr.com'); define('SERVER_TIMEZONE', 'US/Eastern'); define('VIMEO_API_KEY', 'f40bbbfaf1194768cb17c4368c8f2e74'); define('VIMEO_API_SECRET', '16b9ec6c0'); define('CLICKATELL_USER', 'davidkarp'); define('CLICKATELL_PASSWORD', 'JLVchl23'); define('CLICKATELL_API_ID', '3096519'); define('P3P_CP', 'ALL ADM DEV PSAi COM OUR OTRo STP IND ONL'); define('PHOTOSET_PHOTO_LIMIT', 10); define('APP_LOG_DATABASE', 'db1'); define('FACEBOOK_API_KEY', '12b9890602a9c4d25a6233b0bfae6d98'); define('FACEBOOK_SECRET_KEY', '35e59c2d28e668c21ec2d2a9f0e94125'); if (! defined('SEARCH_INDEXING')) define('SEARCH_INDEXING', false); if (ENVIRONMENT == 'development') { define('RECAPTCHA_PUBLIC_KEY', '6Ldk0goAAAAAAK9OygnYgrQm1QdORWaSPt2OBqy7'); define('RECAPTCHA_PRIVATE_KEY', '6Ldk0goAAAAAABsd6y9vEjsSQRWKraQMmBKsr2ll'); } else { define('RECAPTCHA_PUBLIC_KEY', '6Ld0xAoAAAAAAJAlxwY5F687b2n2cgXoBhwy_xtC'); define('RECAPTCHA_PRIVATE_KEY', '6Ld0xAoAAAAAAF5sofH5JYS9u22Bhjx2u9IA85HQ'); } define('TWITTER_OAUTH_CONSUMER_KEY', 'OaoQcfFKB3I1Ei9JC7Qkg'); define('TWITTER_OAUTH_CONSUMER_SECRET', 'yqeoAV0gH885SPirdW30ZeIKME63lPqi8hq2tYNUIGg'); // Memcache pools require_once('chorus/Cache.php'); if (ENVIRONMENT == 'development') { $posts = new FileCache('posts'); $tumblelogs = new FileCache('tumblelogs'); $users = new FileCache('users'); $auto = new FileCache('auto'); $tumblelog_html = new FileCache('tumblelog_html'); $notes = new FileCache('notes'); $following = new FileCache('following'); $pages = new FileCache('pages'); $oauth = new FileCache('oauth'); $performance = new FileCache('performance'); $performance_uncompressed = new FileCache('performance_uncompressed'); $performance_uncompressed->compression = false; $performance_uncompressed->serialization = false; $dashboard_post_ids = new FileCache('dashboard_post_ids'); $liked_post_count = new FileCache('liked_post_count'); $twitter_api = new FileCache('twitter_api'); $tag_channel = new FileCache('tag_channel'); $tumblelog_tags = new FileCache('tumblelog_tags'); $notifications = new FileCache('notifications'); $cs_array_schema = new FileCache('cs_array_schema'); $compact_tumblelog = new FileCache('compact_tumblelog'); $local = new FileCache('local'); } else { // -------- Localhost pool on each webserver, use like APC ----------- $local = new MemcachedCache('local'); $local->addServer('127.0.0.1'); // ----- Main pool: Models, small- to medium-sized, low evictions ---- // cache1, 2, 4, 5, 6, 7, 8, 10 $posts = new MemcachedCache('posts'); $posts->addServer('10.252.0.40'); // cache1 $posts->addServer('10.252.2.64'); // cache2 $posts->addServer('10.252.0.41'); // cache4 $posts->addServer('10.252.0.66'); // cache6 $posts->addServer('10.252.0.68'); // cache8 $posts->addServer('10.252.0.129'); // cache10 $posts->addServer('10.252.0.67'); // cache7 $posts->addServer('10.252.0.65'); // cache5 $posts->addServer('10.42.0.110'); // memcache-objects100.d2 $tumblelogs = new MemcachedCache('tumblelogs'); $tumblelogs->addServer('10.252.0.40'); // cache1 $tumblelogs->addServer('10.252.2.64'); // cache2 $tumblelogs->addServer('10.252.0.41'); // cache4 $tumblelogs->addServer('10.252.0.66'); // cache6 $tumblelogs->addServer('10.252.0.68'); // cache8 $tumblelogs->addServer('10.252.0.129'); // cache10 $tumblelogs->addServer('10.252.0.67'); // cache7 $tumblelogs->addServer('10.252.0.65'); // cache5 $tumblelogs->addServer('10.42.0.110'); // memcache-objects100.d2 $compact_tumblelog = new MemcachedCache('compact_tumblelog'); $compact_tumblelog->addServer('10.252.0.40'); // cache1 $compact_tumblelog->addServer('10.252.2.64'); // cache2 $compact_tumblelog->addServer('10.252.0.41'); // cache4 $compact_tumblelog->addServer('10.252.0.66'); // cache6 $compact_tumblelog->addServer('10.252.0.68'); // cache8 $compact_tumblelog->addServer('10.252.0.129'); // cache10 $compact_tumblelog->addServer('10.252.0.67'); // cache7 $compact_tumblelog->addServer('10.252.0.65'); // cache5 $compact_tumblelog->addServer('10.42.0.110'); // memcache-objects100.d2 $users = new MemcachedCache('users'); $users->addServer('10.252.0.40'); // cache1 $users->addServer('10.252.2.64'); // cache2 $users->addServer('10.252.0.41'); // cache4 $users->addServer('10.252.0.66'); // cache6 $users->addServer('10.252.0.68'); // cache8 $users->addServer('10.252.0.129'); // cache10 $users->addServer('10.252.0.67'); // cache7 $users->addServer('10.252.0.65'); // cache5 $users->addServer('10.42.0.110'); // memcache-objects100.d2 $notifications = new MemcachedCache('notifications'); $notifications->addServer('10.252.0.40'); // cache1 $notifications->addServer('10.252.2.64'); // cache2 $notifications->addServer('10.252.0.41'); // cache4 $notifications->addServer('10.252.0.66'); // cache6 $notifications->addServer('10.252.0.68'); // cache8 $notifications->addServer('10.252.0.129'); // cache10 $notifications->addServer('10.252.0.67'); // cache7 $notifications->addServer('10.252.0.65'); // cache5 $notifications->addServer('10.42.0.110'); // memcache-objects100.d2 $notes = new MemcachedCache('notes'); $notes->addServer('10.252.0.40'); // cache1 $notes->addServer('10.252.2.64'); // cache2 $notes->addServer('10.252.0.41'); // cache4 $notes->addServer('10.252.0.66'); // cache6 $notes->addServer('10.252.0.68'); // cache8 $notes->addServer('10.252.0.129'); // cache10 $notes->addServer('10.252.0.67'); // cache7 $notes->addServer('10.252.0.65'); // cache5 $notes->addServer('10.42.0.110'); // memcache-objects100.d2 $pages = new MemcachedCache('pages'); $pages->addServer('10.252.0.40'); // cache1 $pages->addServer('10.252.2.64'); // cache2 $pages->addServer('10.252.0.41'); // cache4 $pages->addServer('10.252.0.66'); // cache6 $pages->addServer('10.252.0.68'); // cache8 $pages->addServer('10.252.0.129'); // cache10 $pages->addServer('10.252.0.67'); // cache7 $pages->addServer('10.252.0.65'); // cache5 $pages->addServer('10.42.0.110'); // memcache-objects100.d2 $oauth = new MemcachedCache('oauth'); $oauth->addServer('10.252.0.40'); // cache1 $oauth->addServer('10.252.2.64'); // cache2 $oauth->addServer('10.252.0.41'); // cache4 $oauth->addServer('10.252.0.66'); // cache6 $oauth->addServer('10.252.0.68'); // cache8 $oauth->addServer('10.252.0.129'); // cache10 $oauth->addServer('10.252.0.67'); // cache7 $oauth->addServer('10.252.0.65'); // cache5 $oauth->addServer('10.42.0.110'); // memcache-objects100.d2 // this does a LOT of connections $cs_array_schema = new MemcachedCache('cs_array_schema'); $cs_array_schema->addServer('10.252.0.40'); // cache1 $cs_array_schema->addServer('10.252.2.64'); // cache2 $cs_array_schema->addServer('10.252.0.41'); // cache4 $cs_array_schema->addServer('10.252.0.66'); // cache6 $cs_array_schema->addServer('10.252.0.68'); // cache8 $cs_array_schema->addServer('10.252.0.129'); // cache10 $cs_array_schema->addServer('10.252.0.67'); // cache7 $cs_array_schema->addServer('10.252.0.65'); // cache5 $cs_array_schema->addServer('10.42.0.110'); // memcache-objects100.d2 Cache::set_automatic_params('MemcachedCache', array( '10.252.0.40', // cache1 '10.252.2.64', // cache2 '10.252.0.41', // cache4 '10.252.0.66', // cache6 '10.252.0.68', // cache8 '10.252.0.129', // cache10 '10.252.0.67', // cache7 '10.252.0.65', // cache5 '10.42.0.110', // memcache-objects100.d2 )); // ------- Performance pools: Small items, almost never evicted ------ // cache13, 14, 12 and cache9, 11 $performance = new MemcachedCache('performance'); $performance->addServer('10.252.0.143'); // cache13 $performance->addServer('10.252.0.144'); // cache14 $performance->addServer('10.252.0.131'); // cache12 $performance_uncompressed = new MemcachedCache('performance_uncompressed', false, false); $performance_uncompressed->serialization = false; $performance_uncompressed->addServer('10.252.0.143'); // cache13 $performance_uncompressed->addServer('10.252.0.144'); // cache14 $performance_uncompressed->addServer('10.252.0.131'); // cache12 $dashboard_post_ids = new MemcachedCache('dashboard_post_ids', false, false); $dashboard_post_ids->serialization = false; $dashboard_post_ids->addServer('10.252.0.143'); // cache13 $dashboard_post_ids->addServer('10.252.0.144'); // cache14 $dashboard_post_ids->addServer('10.252.0.131'); // cache12 $liked_post_count = new MemcachedCache('liked_post_count', false, false); $liked_post_count->addServer('10.252.0.143'); // cache13 $liked_post_count->addServer('10.252.0.144'); // cache14 $liked_post_count->addServer('10.252.0.131'); // cache12 $following = new MemcachedCache('following'); $following->addServer('10.252.0.128'); // cache9 $following->addServer('10.252.0.130'); // cache11 // --------------- Large items, frequent eviction --------------------- // cache3, 5, 7 $auto = new MemcachedCache('auto'); $auto->addServer('10.252.0.42'); // cache3 //$auto->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false); //$auto->addServer('192.168.200.203', 11280); // cache3 via moxi-app4 $twitter_api = new MemcachedCache('twitter_api'); $twitter_api->addServer('10.252.0.42'); // cache3 //$twitter_api->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false); //$twitter_api->addServer('192.168.200.203', 11280); // cache3 via moxi-app4 $tumblelog_html = new MemcachedCache('tumblelog_html'); $tumblelog_html->addServer('10.252.0.42'); // cache3 //$tumblelog_html->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false); //$tumblelog_html->addServer('192.168.200.203', 11280); // cache3 via moxi-app4 $tumblelog_tags = new MemcachedCache('tumblelog_tags'); $tumblelog_tags->addServer('10.252.0.42'); // cache3 //$tumblelog_tags->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false); //$tumblelog_tags->addServer('192.168.200.203', 11280); // cache3 via moxi-app4 $tag_channel = new MemcachedCache('tag_channel'); $tag_channel->addServer('10.252.0.42'); // cache3 //$tag_channel->memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, false); //$tag_channel->addServer('192.168.200.203', 11280); // cache3 via moxi-app4 } Cache::add_instance('posts', $posts); Cache::add_instance('tumblelogs', $tumblelogs); Cache::add_instance('users', $users); Cache::add_instance('notes', $notes); Cache::add_instance('following', $following); Cache::add_instance('oauth', $oauth); Cache::add_instance('performance', $performance); Cache::add_instance('performance_uncompressed', $performance_uncompressed); Cache::add_instance('pages', $pages); Cache::add_instance('dashboard_post_ids', $dashboard_post_ids); Cache::add_instance('liked_post_count', $liked_post_count); Cache::add_instance('tumblelog_html', $tumblelog_html); Cache::add_instance('twitter_api', $twitter_api); Cache::add_instance('tag_channel', $tag_channel); Cache::add_instance('tumblelog_tags', $tumblelog_tags); Cache::add_instance('notifications', $notifications); Cache::add_instance('cs_array_schema', $cs_array_schema); Cache::add_instance('compact_tumblelog', $compact_tumblelog); Cache::add_instance('local', $local); Cache::add_instance('auto', $auto); $new_post_counts = new MemcachedCache('new_post_counts', false, false); $new_post_counts->addServer('10.252.0.144'); // cache14 Cache::add_instance('new_post_counts', $new_post_counts); Cache::set_default('auto'); DataService::add_config('192.168.200.83'); define('USE_POSTS_REF_CACHE', true); define('UPDATE_POSTS_REF_CACHE', false); define('USE_LIKES_TABLE', false); define('WRITE_TO_LIKES_TABLE', true); define('ENABLE_CHECK_FOR_NEW_POSTS_FREQUENCY', 1); require_once('lib/GiantOctopus.php'); require_once('lib/TumblrOAuth.php');
Fatal Error
In /var/www/apps/tumblr/app/controllers/app.php at line 104

Cannot modify header information - headers already sent by (output started at /var/www/apps/tumblr/config/config.php:748)
Stack Trace
  • error_handler(2, "Cannot modify header information - headers already sent by (output started at /var/www/apps/tumblr/config/config.php:748)", "/var/www/apps/tumblr/app/controllers/app.php", 104, Array(3))


  • header("P3P: CP="P3P_CP"")
    app/controllers/app.php:104


  • AppController->__construct(false)
    app/controllers/tumblelog.php:19


  • TumblelogController->__construct()
    chorus/Controller.php:71


  • Controller::execute("tumblelog", "rss")
    chorus/Dispatch.php:186


  • require_once("/var/www/apps/chorus/Dispatch.php")
    www/dispatch.php:83


notice (4)
  1. 0 ms: [trace] config/routes.php:30: Use of undefined constant IS_TUMBLR_DOT_COM - assumed 'IS_TUMBLR_DOT_COM'
  2. 1 ms: [trace] config/routes.php:620: Use of undefined constant IS_TUMBLR_DOT_COM - assumed 'IS_TUMBLR_DOT_COM'
  3. 1 ms: [trace] config/routes.php:649: Use of undefined constant IS_TUMBLR_DOT_COM - assumed 'IS_TUMBLR_DOT_COM'
  4. 11 ms: [trace] app/controllers/app.php:104: Use of undefined constant P3P_CP - assumed 'P3P_CP'
memory (1)
  1. 15 ms: [trace] 4.5MB in use, 5.3 MB peak
Server
  • 174.122.44.224

Timers
TimeExecsMemTimer
23 ms Total
10 ms 1 3139 KB include
0 ms 0 0 KB construct
0 ms 0 0 KB exec
Variables
$REDIRECT_STATUS
200
$HTTP_X_FEEDBURNER_URI
MaimedByRock
$HTTP_USER_AGENT
FeedBurner/1.0 (http://www.FeedBurner.com)
$HTTP_PRAGMA
no-cache
$HTTP_HOST
maimedbyrock.tumblr.com
$HTTP_ACCEPT
text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
$HTTP_ACCEPT_ENCODING
gzip
$HTTP_X_FORWARDED_FOR
209.85.224.80, 192.168.200.98
$HTTP_X_VARNISH
3228405985
$PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/b
in:/sbin:/bin:/usr/sbin:/usr/bin
$SERVER_SIGNATURE
Apache/2.2.3 (CentOS) Server at maimedbyrock.tumblr.com
Port 80
$SERVER_SOFTWARE
Apache/2.2.3 (CentOS)
$SERVER_NAME
maimedbyrock.tumblr.com
$SERVER_ADDR
174.122.44.224
$SERVER_PORT
80
$REMOTE_ADDR
174.122.44.206
$DOCUMENT_ROOT
/var/www/apps/tumblr/www
$SERVER_ADMIN
root@localhost
$SCRIPT_FILENAME
/var/www/apps/tumblr/www/dispatch.php
$REMOTE_PORT
47253
$REDIRECT_URL
/rss
$GATEWAY_INTERFACE
CGI/1.1
$SERVER_PROTOCOL
HTTP/1.1
$REQUEST_METHOD
GET
$QUERY_STRING
$REQUEST_URI
/rss
$SCRIPT_NAME
/dispatch.php
$PHP_SELF
/dispatch.php
$REQUEST_TIME
1300533141
$UNFILTERED_REQUEST_URI
/rss
$load_avg
0.55
$base
/var/www/apps/tumblr
$tz
America/New_York
$router
Router Object
$path
/rss
$qs
$THRIFT_ROOT
/var/www/apps/tumblr/lib/giant_octopus/thrift