Skip to content

Commit

Permalink
Switching from 64 free sites to 12 to handle load.
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelclay committed Mar 14, 2013
1 parent e4fc8b6 commit f5ec4fa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
22 changes: 17 additions & 5 deletions fabfile.py
Expand Up @@ -60,12 +60,20 @@
'task10.newsblur.com',
'task11.newsblur.com',
],
'ec2app': ['ec2-54-242-38-48.compute-1.amazonaws.com',
'ec2-54-242-34-138.compute-1.amazonaws.com',
],
'ec2task': ['ec2-54-242-38-48.compute-1.amazonaws.com',
'ec2-184-72-214-147.compute-1.amazonaws.com',
'ec2-107-20-103-16.compute-1.amazonaws.com',
'ec2-50-17-12-16.compute-1.amazonaws.com',
'ec2-54-242-34-138.compute-1.amazonaws.com',
'ec2-184-73-2-61.compute-1.amazonaws.com',

# New post Reader shut-down
'ec2-50-17-135-87.compute-1.amazonaws.com',
'ec2-50-16-7-166.compute-1.amazonaws.com',
'ec2-54-234-182-177.compute-1.amazonaws.com',
],
'vps': ['task01.newsblur.com',
'task03.newsblur.com',
Expand All @@ -84,8 +92,8 @@
# ================

def server():
env.NEWSBLUR_PATH = "/home/%s/newsblur" % env.user
env.VENDOR_PATH = "/home/%s/code" % env.user
env.NEWSBLUR_PATH = "/srv/newsblur"
env.VENDOR_PATH = "/srv/code"

def app():
server()
Expand All @@ -111,6 +119,10 @@ def ec2task():
ec2()
env.roles = ['ec2task']

def ec2app():
ec2()
env.roles = ['ec2app']

def vps():
server()
env.roles = ['vps']
Expand Down Expand Up @@ -402,6 +414,7 @@ def setup_repo():
with settings(warn_only=True):
run('git clone https://github.com/samuelclay/NewsBlur.git newsblur')
sudo('mkdir -p /srv')
sudo('ln -f -s /home/%s/code /srv/code' % env.user)
sudo('ln -f -s /home/%s/newsblur /srv/newsblur' % env.user)

def setup_repo_local_settings():
Expand Down Expand Up @@ -730,7 +743,7 @@ def setup_mongo():
sudo('/etc/init.d/mongodb restart')

def setup_redis():
redis_version = '2.6.2'
redis_version = '2.6.11'
with cd(env.VENDOR_PATH):
run('wget http://redis.googlecode.com/files/redis-%s.tar.gz' % redis_version)
run('tar -xzf redis-%s.tar.gz' % redis_version)
Expand Down Expand Up @@ -834,7 +847,7 @@ def copy_task_settings():
# = Setup - EC2 =
# ===============

def setup_ec2_task():
def setup_ec2():
AMI_NAME = 'ami-834cf1ea' # Ubuntu 64-bit 12.04 LTS
# INSTANCE_TYPE = 'c1.medium'
INSTANCE_TYPE = 'c1.medium'
Expand Down Expand Up @@ -863,7 +876,6 @@ def setup_ec2_task():
host = instance.public_dns_name
env.host_string = host

setup_task()


# ==============
Expand Down
6 changes: 3 additions & 3 deletions media/js/newsblur/reader/reader.js
Expand Up @@ -888,7 +888,7 @@
$progress.addClass('NB-progress-error').addClass('NB-progress-big');
$('.NB-progress-link', $progress).html($.make('div', {
className: 'NB-modal-submit-button NB-modal-submit-green NB-menu-manage-feedchooser'
}, ['Choose your 64 sites']));
}, ['Choose your 12 sites']));

this.show_progress_bar();
},
Expand Down Expand Up @@ -918,7 +918,7 @@
NEWSBLUR.assets.folders.length) {
_.defer(_.bind(this.open_feedchooser_modal, this), 100);
} else if (!NEWSBLUR.Globals.is_premium &&
NEWSBLUR.assets.feeds.active().length > 64) {
NEWSBLUR.assets.feeds.active().length > 12) {
_.defer(_.bind(this.open_feedchooser_modal, this), 100);
}
},
Expand Down Expand Up @@ -2638,7 +2638,7 @@
]),
(show_chooser && $.make('li', { className: 'NB-menu-item NB-menu-manage-feedchooser' }, [
$.make('div', { className: 'NB-menu-manage-image' }),
$.make('div', { className: 'NB-menu-manage-title' }, 'Choose Your 64 sites'),
$.make('div', { className: 'NB-menu-manage-title' }, 'Choose Your 12 sites'),
$.make('div', { className: 'NB-menu-manage-subtitle' }, 'Enable the sites you want.')
])),
$.make('li', { className: 'NB-menu-separator' }),
Expand Down
4 changes: 2 additions & 2 deletions media/js/newsblur/reader/reader_feedchooser.js
Expand Up @@ -10,14 +10,14 @@ NEWSBLUR.ReaderFeedchooser.prototype = {

runner: function() {
this.start = new Date();
this.MAX_FEEDS = 64;
this.MAX_FEEDS = 12;
this.approve_list = [];
this.make_modal();
this.make_paypal_button();
_.defer(_.bind(function() { this.open_modal(); }, this));
if (!NEWSBLUR.Globals.is_premium) {
this.find_feeds_in_feed_list();
this.initial_load_feeds();
this.initial_load_feeds(true);
}
this.choose_dollar_amount(2);

Expand Down

0 comments on commit f5ec4fa

Please sign in to comment.