Updating plugin versions from Docker Manager exhausting memory


(Ken Cooper) #1

I’m running a Digital Ocean 2 Gb docker instance with a relatively small number of users (< 1000) a relatively new database (< 100 topics), and 8 plugins. Frequently when I attempt to update plugins, the process fails from memory exhaustion while gzipping (see log below).

Is there a way to prepare the system to free up some memory in advance? Or is this perhaps an indication of a problem with rebuild process?

$ cd /var/www/discourse/plugins/discourse-adplugin && git fetch && git reset --hard     HEAD@{upstream}
HEAD is now at c6b753a variable change for amazon mobile ad
********************************************************
*** Please be patient, next steps might take a while ***
********************************************************
$ bundle install --deployment --without test --without development
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.4
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using loofah 2.0.3
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.4
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.4
Using globalid 0.3.6
Using activejob 4.2.4
Using mime-types 2.6.2
Using mail 2.6.3
Using actionmailer 4.2.4
Using activemodel 4.2.4
Using active_model_serializers 0.8.3
Using arel 6.0.3
Using activerecord 4.2.4
Using jmespath 1.1.3
Using aws-sdk-core 2.1.29
Using aws-sdk-resources 2.1.29
Using aws-sdk 2.1.29
Using babel-source 5.8.19
Using execjs 2.6.0
Using babel-transpiler 0.7.0
Using ember-source 1.12.1
Using barber 0.9.0
Using byebug 6.0.2
Using bundler 1.10.6
Using dotenv 2.0.2
Using nenv 0.2.0
Using rspec-logsplit 0.1.3
Using hitimes 1.2.3
Using timers 4.1.1
Using celluloid-essentials 0.20.2.1
Using celluloid-extras 0.20.1
Using celluloid-fsm 0.20.1
Using celluloid-pool 0.20.1
Using celluloid-supervision 0.20.1.1
Using celluloid 0.17.1.2
Using certified 1.0.0
Using coderay 1.1.0
Using connection_pool 2.2.0
Using crass 1.0.2
Using daemons 1.2.3
Using diff-lcs 1.2.5
Using thor 0.19.1
Using railties 4.2.4
Using discourse-qunit-rails 0.0.8
Using docile 1.1.5
Using email_reply_parser 0.5.8
Using ember-data-source 1.0.0.beta.16.1
Using hike 1.2.3
Using multi_json 1.11.2
Using tilt 1.4.1
Using sprockets 2.11.0
Using ember-handlebars-template 0.1.5
Using jquery-rails 3.1.2
Using ember-rails 0.18.2
Using eventmachine 1.0.8
Using excon 0.45.4
Using exifr 1.2.3.1
Using fabrication 2.9.8
Using fakeweb 1.3.0
Using multipart-post 2.0.0
Using faraday 0.9.1
Using fast_blank 1.0.0
Using rake-compiler 0.9.5
Using fast_stack 0.1.0
Using fast_xor 1.1.3
Using fast_xs 0.8.0
Using fastimage_discourse 1.6.6
Using ffi 1.9.10
Using flamegraph 0.1.0
Using fspath 2.1.1
Using sorcerer 1.0.2
Using given_core 3.5.4
Using guess_html_encoding 0.0.11
Using handlebars-source 2.0.0
Using hashie 3.4.2
Using highline 1.7.7
Using hiredis 0.6.0
Using htmlentities 4.3.4
Using image_size 1.4.1
Using in_threads 1.3.1
Using progress 3.1.0
Using image_optim 0.20.2
Using jwt 1.5.1
Using kgio 2.10.0
Using libv8 3.16.14.11
Using listen 0.7.3
Using logster 1.0.0.3.pre
Using lru_redux 1.1.0
Using redis 3.2.1
Using message_bus 1.0.16
Using metaclass 0.0.4
Using method_source 0.8.2
Using mocha 1.1.0
Using mock_redis 0.15.2
Using moneta 0.8.0
Using msgpack 0.6.2
Using multi_xml 0.5.5
Using mustache 1.0.2
Using netrc 0.10.3
Using nokogumbo 1.4.1
Using oauth 0.4.7
Using oauth2 1.0.0
Using oj 2.12.14
Using omniauth 1.2.2
Using omniauth-oauth2 1.3.1
Using omniauth-facebook 2.0.1
Using omniauth-github-discourse 1.1.2
Using omniauth-google-oauth2 0.2.5
Using omniauth-oauth 1.1.0
Using ruby-openid 2.7.0
Using rack-openid 1.3.1
Using omniauth-openid 1.0.1
Using omniauth-twitter 1.2.1
Using onebox 1.5.26
Using openid-redis-store 0.0.2
Using pg 0.18.3
Using slop 3.6.0
Using pry 0.10.1
Using pry-nav 0.2.4
Using pry-rails 0.3.4
Using puma 2.14.0
Using r2 0.2.5
Using rack-mini-profiler 0.9.7
Using rack-protection 1.5.3
Using sprockets-rails 2.0.1
Using rails 4.2.4
Using rails-observers 0.1.2
Using rails_multisite 1.0.2
Using raindrops 0.15.0
Using rb-fsevent 0.9.6
Using rb-inotify 0.9.5
Using trollop 2.1.1
Using rbtrace 0.4.7
Using redis-namespace 1.5.2
Using ref 2.0.0
Using rest-client 1.7.2
Using rinku 1.7.3
Using rmmseg-cpp 0.2.9
Using rspec-support 3.2.2
Using rspec-core 3.2.3
Using rspec-expectations 3.2.1
Using rspec-mocks 3.2.1
Using rspec 3.2.0
Using rspec-given 3.5.4
Using rspec-rails 3.2.1
Using rtlit 0.0.5
Using ruby-readability 0.7.0
Using sanitize 4.0.0
Using sass 3.2.19
Using sass-rails 4.0.5
Using seed-fu 2.3.5
Using shoulda-context 1.2.1
Using shoulda-matchers 2.7.0
Using shoulda 3.5.0
Using sidekiq 3.5.0
Using sidekiq-statistic 1.1.0
Using simple-rss 1.3.1
Using simplecov-html 0.10.0
Using simplecov 0.10.0
Using sinatra 1.4.6
Using spork 1.0.0rc4
Using spork-rails 4.0.0
Using therubyracer 0.12.2
Using thin 1.6.4
Using timecop 0.8.0
Using uglifier 2.7.2
Using unf_ext 0.0.6
Using unf 0.1.4
Using unicorn 4.9.0
Bundle complete! 93 Gemfile dependencies, 184 gems now installed.
Gems in the group development were not installed.
Bundled gems are installed into ./vendor/bundle.
$ bundle exec rake multisite:migrate
Migrating default
---------------------------------

== Seed from /var/www/discourse/db/fixtures/001_categories.rb

== Seed from /var/www/discourse/db/fixtures/002_groups.rb

== Seed from /var/www/discourse/db/fixtures/003_post_action_types.rb
 - PostActionType {:id=>1, :name_key=>"bookmark", :is_flag=>false, :position=>1}
 - PostActionType {:id=>2, :name_key=>"like", :is_flag=>false, :icon=>"heart", :position=>2}
 - PostActionType {:id=>3, :name_key=>"off_topic", :is_flag=>true, :position=>3}
 - PostActionType {:id=>4, :name_key=>"inappropriate", :is_flag=>true, :position=>4}
 - PostActionType {:id=>5, :name_key=>"vote", :is_flag=>false, :position=>5}
 - PostActionType {:id=>8, :name_key=>"spam", :is_flag=>true, :position=>6}
 - PostActionType {:id=>6, :name_key=>"notify_user", :is_flag=>true, :position=>7}
 - PostActionType {:id=>7, :name_key=>"notify_moderators", :is_flag=>true, :position=>8}

== Seed from /var/www/discourse/db/fixtures/004_screened_ip_addresses.rb
 - ScreenedIpAddress {:id=>1, :ip_address=>"10.0.0.0/8", :action_type=>2}
 - ScreenedIpAddress {:id=>2, :ip_address=>"192.168.0.0/16", :action_type=>2}
 - ScreenedIpAddress {:id=>3, :ip_address=>"127.0.0.0/8", :action_type=>2}
 - ScreenedIpAddress {:id=>4, :ip_address=>"172.16.0.0/12", :action_type=>2}
 - ScreenedIpAddress {:id=>5, :ip_address=>"fc00::/7", :action_type=>2}

== Seed from /var/www/discourse/db/fixtures/005_badge_types.rb
 - BadgeType {:id=>1, :name=>"Gold"}
 - BadgeType {:id=>2, :name=>"Silver"}
 - BadgeType {:id=>3, :name=>"Bronze"}

== Seed from /var/www/discourse/db/fixtures/006_badges.rb
 - BadgeGrouping {:id=>1, :name=>"Getting Started", :default_position=>10}
 - BadgeGrouping {:id=>2, :name=>"Community", :default_position=>11}
 - BadgeGrouping {:id=>3, :name=>"Posting", :default_position=>12}
 - BadgeGrouping {:id=>4, :name=>"Trust Level", :default_position=>13}
 - BadgeGrouping {:id=>5, :name=>"Other", :default_position=>14}
 - Badge {:id=>1, :default_name=>"Basic User", :badge_type_id=>3, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at FROM users u\n    WHERE trust_level >= 1 AND (\n      :backfill OR u.id IN (:user_ids)\n    )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>false, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>2, :default_name=>"Member", :badge_type_id=>3, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at FROM users u\n    WHERE trust_level >= 2 AND (\n      :backfill OR u.id IN (:user_ids)\n    )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>false, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>3, :default_name=>"Regular", :badge_type_id=>2, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at FROM users u\n    WHERE trust_level >= 3 AND (\n      :backfill OR u.id IN (:user_ids)\n    )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>true, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>4, :default_name=>"Leader", :badge_type_id=>1, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at FROM users u\n    WHERE trust_level >= 4 AND (\n      :backfill OR u.id IN (:user_ids)\n    )\n", :default_badge_grouping_id=>4, :trigger=>4, :default_allow_title=>true, :default_icon=>"fa-user", :system=>true}
 - Badge {:id=>17, :default_name=>"Reader", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"    SELECT id user_id, current_timestamp granted_at\n    FROM users\n    WHERE id IN\n    (\n      SELECT pt.user_id\n      FROM post_timings pt\n      JOIN badge_posts b ON b.post_number = pt.post_number AND\n                            b.topic_id = pt.topic_id\n      JOIN topics t ON t.id = pt.topic_id\n      LEFT JOIN user_badges ub ON ub.badge_id = 17 AND ub.user_id = pt.user_id\n      WHERE ub.id IS NULL AND t.posts_count > 100\n      GROUP BY pt.user_id, pt.topic_id, t.posts_count\n      HAVING count(*) >= t.posts_count\n    )\n", :default_badge_grouping_id=>1, :auto_revoke=>false, :system=>true}
 - Badge {:id=>16, :default_name=>"Read Guidelines", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"    SELECT user_id, read_faq granted_at\n    FROM user_stats\n    WHERE read_faq IS NOT NULL AND (user_id IN (:user_ids) OR :backfill)\n", :default_badge_grouping_id=>1, :trigger=>8, :system=>true}
 - Badge {:id=>14, :default_name=>"First Link", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"    SELECT l.user_id, l.post_id, l.created_at granted_at\n    FROM\n    (\n      SELECT MIN(l1.id) id\n      FROM topic_links l1\n      JOIN badge_posts p1 ON p1.id = l1.post_id\n      JOIN badge_posts p2 ON p2.id = l1.link_post_id\n      WHERE NOT reflection AND p1.topic_id <> p2.topic_id AND not quote AND\n        (:backfill OR ( p1.id in (:post_ids) ))\n      GROUP BY l1.user_id\n    ) ids\n    JOIN topic_links l ON l.id = ids.id\n", :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>15, :default_name=>"First Quote", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"    SELECT ids.user_id, q.post_id, q.created_at granted_at\n    FROM\n    (\n      SELECT p1.user_id, MIN(q1.id) id\n      FROM quoted_posts q1\n      JOIN badge_posts p1 ON p1.id = q1.post_id\n      JOIN badge_posts p2 ON p2.id = q1.quoted_post_id\n      WHERE (:backfill OR ( p1.id IN (:post_ids) ))\n      GROUP BY p1.user_id\n    ) ids\n    JOIN quoted_posts q ON q.id = ids.id\n", :default_badge_grouping_id=>1, :trigger=>2, :system=>true}
 - Badge {:id=>11, :default_name=>"First Like", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"    SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n    FROM (\n      SELECT pa.user_id, min(pa.id) id\n      FROM post_actions pa\n      JOIN badge_posts p on p.id = pa.post_id\n      WHERE post_action_type_id = 2 AND\n        (:backfill OR pa.post_id IN (:post_ids) )\n      GROUP BY pa.user_id\n    ) x\n    JOIN post_actions pa1 on pa1.id = x.id\n", :default_badge_grouping_id=>1, :trigger=>1, :system=>true}
 - Badge {:id=>13, :default_name=>"First Flag", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>false, :query=>"    SELECT pa1.user_id, pa1.created_at granted_at, pa1.post_id\n    FROM (\n      SELECT pa.user_id, min(pa.id) id\n      FROM post_actions pa\n      JOIN badge_posts p on p.id = pa.post_id\n      WHERE post_action_type_id IN (3,4,7,8) AND\n        (:backfill OR pa.post_id IN (:post_ids) )\n      GROUP BY pa.user_id\n    ) x\n    JOIN post_actions pa1 on pa1.id = x.id\n", :default_badge_grouping_id=>2, :trigger=>1, :auto_revoke=>false, :system=>true}
 - Badge {:id=>25, :default_name=>"Promoter", :default_icon=>"fa-user-plus", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at\n    FROM users u\n    WHERE u.id IN (\n      SELECT invited_by_id\n      FROM invites i\n      JOIN users u2 ON u2.id = i.user_id\n      WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 0 AND not u2.blocked\n      GROUP BY invited_by_id\n      HAVING COUNT(*) >= 1\n    ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n      (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>26, :default_name=>"Campaigner", :default_icon=>"fa-user-plus", :badge_type_id=>2, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at\n    FROM users u\n    WHERE u.id IN (\n      SELECT invited_by_id\n      FROM invites i\n      JOIN users u2 ON u2.id = i.user_id\n      WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 1 AND not u2.blocked\n      GROUP BY invited_by_id\n      HAVING COUNT(*) >= 3\n    ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n      (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>27, :default_name=>"Champion", :default_icon=>"fa-user-plus", :badge_type_id=>1, :multiple_grant=>false, :target_posts=>false, :show_posts=>false, :query=>"\n    SELECT u.id user_id, current_timestamp granted_at\n    FROM users u\n    WHERE u.id IN (\n      SELECT invited_by_id\n      FROM invites i\n      JOIN users u2 ON u2.id = i.user_id\n      WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 2 AND not u2.blocked\n      GROUP BY invited_by_id\n      HAVING COUNT(*) >= 5\n    ) AND u.active AND NOT u.blocked AND u.id > 0 AND\n      (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>true, :system=>true}
 - Badge {:id=>12, :default_name=>"First Share", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"    SELECT views.user_id, i2.post_id, i2.created_at granted_at\n    FROM\n    (\n      SELECT i.user_id, MIN(i.id) i_id\n      FROM incoming_links i\n      JOIN badge_posts p on p.id = i.post_id\n      WHERE i.user_id IS NOT NULL\n      GROUP BY i.user_id\n    ) as views\n    JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>1, :trigger=>0, :system=>true}
 - Badge {:id=>21, :default_name=>"Nice Share", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"    SELECT views.user_id, i2.post_id, i2.created_at granted_at\n    FROM\n    (\n      SELECT i.user_id, MIN(i.id) i_id\n      FROM incoming_links i\n      JOIN badge_posts p on p.id = i.post_id\n      WHERE i.user_id IS NOT NULL\n      GROUP BY i.user_id,i.post_id\n      HAVING COUNT(*) > 25\n    ) as views\n    JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>22, :default_name=>"Good Share", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"    SELECT views.user_id, i2.post_id, i2.created_at granted_at\n    FROM\n    (\n      SELECT i.user_id, MIN(i.id) i_id\n      FROM incoming_links i\n      JOIN badge_posts p on p.id = i.post_id\n      WHERE i.user_id IS NOT NULL\n      GROUP BY i.user_id,i.post_id\n      HAVING COUNT(*) > 300\n    ) as views\n    JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>23, :default_name=>"Great Share", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"    SELECT views.user_id, i2.post_id, i2.created_at granted_at\n    FROM\n    (\n      SELECT i.user_id, MIN(i.id) i_id\n      FROM incoming_links i\n      JOIN badge_posts p on p.id = i.post_id\n      WHERE i.user_id IS NOT NULL\n      GROUP BY i.user_id,i.post_id\n      HAVING COUNT(*) > 1000\n    ) as views\n    JOIN incoming_links i2 ON i2.id = views.i_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>5, :default_name=>"Welcome", :badge_type_id=>3, :multiple_grant=>false, :target_posts=>true, :show_posts=>true, :query=>"    SELECT p.user_id, min(post_id) post_id, min(pa.created_at) granted_at\n    FROM post_actions pa\n    JOIN badge_posts p on p.id = pa.post_id\n    WHERE post_action_type_id = 2 AND\n        (:backfill OR pa.post_id IN (:post_ids) )\n    GROUP BY p.user_id\n", :default_badge_grouping_id=>2, :trigger=>1, :system=>true}
 - Badge {:id=>9, :default_name=>"Autobiographer", :badge_type_id=>3, :multiple_grant=>false, :query=>"    SELECT u.id user_id, current_timestamp granted_at\n    FROM users u\n    JOIN user_profiles up on u.id = up.user_id\n    WHERE bio_raw IS NOT NULL AND LENGTH(TRIM(bio_raw)) > 10 AND\n          uploaded_avatar_id IS NOT NULL AND\n          (:backfill OR u.id IN (:user_ids) )\n", :default_badge_grouping_id=>1, :trigger=>8, :system=>true}
 - Badge {:id=>10, :default_name=>"Editor", :badge_type_id=>3, :multiple_grant=>false, :query=>"    SELECT p.user_id, min(p.id) post_id, min(p.created_at) granted_at\n    FROM badge_posts p\n    WHERE p.self_edits > 0 AND\n        (:backfill OR p.id IN (:post_ids) )\n    GROUP BY p.user_id\n", :default_badge_grouping_id=>2, :trigger=>2, :system=>true}
 - Badge {:id=>6, :default_name=>"Nice Post", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n    SELECT p.user_id, p.id post_id, p.updated_at granted_at\n    FROM badge_posts p\n    WHERE p.post_number > 1 AND p.like_count >= 10 AND\n      (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>7, :default_name=>"Good Post", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n    SELECT p.user_id, p.id post_id, p.updated_at granted_at\n    FROM badge_posts p\n    WHERE p.post_number > 1 AND p.like_count >= 25 AND\n      (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>8, :default_name=>"Great Post", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n    SELECT p.user_id, p.id post_id, p.updated_at granted_at\n    FROM badge_posts p\n    WHERE p.post_number > 1 AND p.like_count >= 50 AND\n      (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>18, :default_name=>"Nice Topic", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n    SELECT p.user_id, p.id post_id, p.updated_at granted_at\n    FROM badge_posts p\n    WHERE p.post_number = 1 AND p.like_count >= 10 AND\n      (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>19, :default_name=>"Good Topic", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n    SELECT p.user_id, p.id post_id, p.updated_at granted_at\n    FROM badge_posts p\n    WHERE p.post_number = 1 AND p.like_count >= 25 AND\n      (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>20, :default_name=>"Great Topic", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"\n    SELECT p.user_id, p.id post_id, p.updated_at granted_at\n    FROM badge_posts p\n    WHERE p.post_number = 1 AND p.like_count >= 50 AND\n      (:backfill OR p.id IN (:post_ids) )\n", :default_badge_grouping_id=>3, :trigger=>1, :system=>true}
 - Badge {:id=>24, :default_name=>"Anniversary", :default_icon=>"fa-clock-o", :badge_type_id=>2, :query=>"    SELECT u.id AS user_id, MIN(u.created_at + interval '1 year') AS granted_at\n      FROM users u\n      JOIN posts p ON p.user_id = u.id\n     WHERE u.id > 0\n       AND u.active\n       AND NOT u.blocked\n       AND u.created_at + interval '1 year' < now()\n       AND p.deleted_at IS NULL\n       AND NOT p.hidden\n       AND p.created_at + interval '1 year' > now()\n       AND (:backfill OR u.id IN (:user_ids))\n     GROUP BY u.id\n     HAVING COUNT(p.id) > 0\n", :default_badge_grouping_id=>2, :trigger=>0, :auto_revoke=>false, :system=>true}
 - Badge {:id=>28, :default_name=>"Popular Link", :badge_type_id=>3, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"          SELECT tl.user_id, post_id, MIN(tl.created_at) granted_at\n            FROM topic_links tl\n            JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n            JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n           WHERE NOT tl.internal\n             AND tl.clicks >= 50\n        GROUP BY tl.user_id, tl.post_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>29, :default_name=>"Hot Link", :badge_type_id=>2, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"          SELECT tl.user_id, post_id, MIN(tl.created_at) granted_at\n            FROM topic_links tl\n            JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n            JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n           WHERE NOT tl.internal\n             AND tl.clicks >= 300\n        GROUP BY tl.user_id, tl.post_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}
 - Badge {:id=>30, :default_name=>"Famous Link", :badge_type_id=>1, :multiple_grant=>true, :target_posts=>true, :show_posts=>true, :query=>"          SELECT tl.user_id, post_id, MIN(tl.created_at) granted_at\n            FROM topic_links tl\n            JOIN posts p  ON p.id = post_id    AND p.deleted_at IS NULL\n            JOIN topics t ON t.id = p.topic_id AND t.deleted_at IS NULL AND t.archetype <> 'private_message'\n           WHERE NOT tl.internal\n             AND tl.clicks >= 1000\n        GROUP BY tl.user_id, tl.post_id\n", :default_badge_grouping_id=>2, :trigger=>0, :system=>true}

== Seed from /var/www/discourse/db/fixtures/009_users.rb
 - User {:id=>-1, :name=>"system", :username=>"system", :username_lower=>"system", :email=>"no_email", :password=>"e004c53c04276d0e430c1ba7f115e726", :active=>true, :admin=>true, :moderator=>true, :email_direct=>false, :approved=>true, :email_private_messages=>false, :trust_level=>4}

== Seed from /var/www/discourse/db/fixtures/500_lounge_category.rb

== Seed from /var/www/discourse/db/fixtures/501_meta_category.rb

== Seed from /var/www/discourse/db/fixtures/502_staff_category.rb

== Seed from /var/www/discourse/db/fixtures/999_settings.rb

== Seed from /var/www/discourse/db/fixtures/999_topics.rb
***  Bundling assets. This might take a while *** 
$ bundle exec rake assets:precompile
Purging temp files
Start compiling CSS: 2015-10-29 14:44:38 UTC
Compiling css for default
target: desktop desktop_974df1e9cff2e202dae0f73d9671bee8a44e7db5.css
target: mobile mobile_974df1e9cff2e202dae0f73d9671bee8a44e7db5.css
target: desktop_rtl desktop_rtl_974df1e9cff2e202dae0f73d9671bee8a44e7db5.css
target: mobile_rtl mobile_rtl_974df1e9cff2e202dae0f73d9671bee8a44e7db5.css
Done compiling CSS: 2015-10-29 14:44:38 UTC
Skipping: admin-fc252c4619166a3585771544f27fe8f4.js already compressed
Skipping: application-c337aa8249f734854347ee1cbffb91c1.js already compressed
Skipping: defer/html-sanitizer-bundle-d248c5e7fffd65438fab42fafa3d1d56.js already compressed
Skipping: discourse/controllers/application-2e543eef3840b46d5ab8678273b4b5e4.js already compressed
Skipping: discourse/helpers/application-1229be3e4d538a88468d81cd890dda26.js already compressed
Skipping: discourse/routes/application-9e29a6dab133c21a5d1ca3c55cd34661.js already compressed
Skipping: discourse/templates/application-07c797efbaa915b6ff4b6935232f3583.js already compressed
Skipping: discourse/views/application-f3e3f7248c0ad050326a388bc0792a94.js already compressed
Skipping: locales/ar-6dd30a2f4a5605be535c1d9b4c8cad96.js already compressed
Skipping: locales/bs_BA-8665fafcf66a7c5db0e595847c89cd4c.js already compressed
Skipping: locales/cs-6395b31981499f2acc22d97d3e411478.js already compressed
Skipping: locales/da-2d77b54f6760bb42592d93a83e9fb250.js already compressed
Skipping: locales/de-2b5b39da2818c5e8d537e3a31e50474c.js already compressed
Skipping: locales/en-f76138d1609fda79b071b66d2dac85fe.js already compressed
Skipping: locales/es-839452b6ceb1868dcd7ffc5a5a549f2e.js already compressed
Skipping: locales/fa_IR-7b98ac7988b180594b1407e3b35e3975.js already compressed
Skipping: locales/fi-20e2dfc465e1501e106f6cfaf14e0f21.js already compressed
Skipping: locales/fr-97f6b1aceb76f589dc3121a62150da69.js already compressed
Skipping: locales/he-7ca6c435076f3748a777434a8da5d27f.js already compressed
Skipping: locales/id-9210ef1cc0391fbc1378c356b079ebbe.js already compressed
Skipping: locales/it-ee2ceb73e71df9628b69358fdfa19c8b.js already compressed
Skipping: locales/ja-b16f5a8a642d15268ddf0b0bab086888.js already compressed
Skipping: locales/ko-1ef2c00641dcabbc0b77940420973a95.js already compressed
Skipping: locales/nb_NO-776579182c9973093a40ffe5b77788c7.js already compressed
Skipping: locales/nl-373aeb450585efee4462a94065ef3863.js already compressed
Skipping: locales/pl_PL-be895b7e8603dfabc524bc54b7b32f90.js already compressed
Skipping: locales/pt-444dda3d87c11fc8b164c7cc8ecfc3fd.js already compressed
Skipping: locales/pt_BR-0dcb0df86da2c962a6e708fb1cbe59e9.js already compressed
Skipping: locales/ro-c8b9b156d1543b45fb30c2e1131d7dec.js already compressed
Skipping: locales/ru-a51238a2e7448c893d4852cc72558cf9.js already compressed
Skipping: locales/sq-1d691c92ccbb8021ecfccd2393782568.js already compressed
Skipping: locales/sv-5b16f632847b602186e53774f7e74aff.js already compressed
Skipping: locales/te-8d30e6c7fdddeb3efb8d90652d5557d7.js already compressed
Skipping: locales/tr_TR-ef64ddbe3437a59437dd8375d9533b0a.js already compressed
Skipping: locales/uk-2f5f20d939abebd4cebe675d4bfd1a2c.js already compressed
Skipping: locales/zh_CN-db8ccb2568114c94e687df9b4b1ba086.js already compressed
Skipping: locales/zh_TW-351aae3beef9f19651a01fcb2a3f6304.js already compressed
Skipping: preload_store-d16a3675434b5a0043157cfc2b850471.js already compressed
Skipping: vendor-d726f166eae32585d948cc4b83590d33.js already compressed
Skipping: break_string-acd906f9185938240ab8b1b796f21d89.js already compressed
Skipping: browser-update-52c0c854d42ecbfc536988f134888f0e.js already compressed
Compressing: docker-manager-app-32f5da82f7e4727c9dbd28fc4be00be9.js
gzip /var/www/discourse/public/assets/docker-manager-app-32f5da82f7e4727c9dbd28fc4be00be9.js
Bundling assets
Compressing Javascript and Generating Source Maps
rake aborted!
Errno::ENOMEM: Cannot allocate memory - gzip -f -c -9 /var/www/discourse/public/assets/docker-manager-app-32f5da82f7e4727c9dbd28fc4be00be9.js > /var/www/discourse/public/assets/docker-manager-app-32f5da82f7e4727c9dbd28fc4be00be9.js.gz
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.2.4/lib/active_support/core_ext/kernel/agnostics.rb:7:in ``'
/var/www/discourse/lib/tasks/assets.rake:138:in `gzip'
/var/www/discourse/lib/tasks/assets.rake:179:in `block (2 levels) in '
/var/www/discourse/lib/tasks/assets.rake:160:in `each'
/var/www/discourse/lib/tasks/assets.rake:160:in `block in '
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

(Ken Cooper) #2

Here’s my process list, FWIW:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
discour+ 21820  1.0 16.7 1471452 343352 ?      Sl   Oct27  28:48 sidekiq 3.5.0 discourse [0 of 5 busy]                                                               
discour+ 21833  3.1 14.0 1070472 287188 ?      Sl   Oct27  88:16 unicorn worker[0] -E production -c config/unicorn.conf.rb                                           
discour+ 21856  3.1 13.8 1060212 284488 ?      Sl   Oct27  88:50 unicorn worker[1] -E production -c config/unicorn.conf.rb                                           
discour+ 21864  3.1 13.4 1052020 276448 ?      Sl   Oct27  88:47 unicorn worker[2] -E production -c config/unicorn.conf.rb                                           
discour+ 21044  0.2 11.0 463608 227144 ?       Sl   Oct27   6:56 unicorn master -E production -c config/unicorn.conf.rb                                              
redis       40  0.6  3.9 132556 79976 ?        Sl   Oct25  36:34 /usr/bin/redis-server *:6379               
postgres    58  0.0  3.7 386480 76588 ?        Ss   Oct25   1:53 postgres: checkpointer process                                    
postgres 27862  0.8  1.5 402996 31176 ?        Ss   14:58   0:04 postgres: discourse discourse [local] idle                        
postgres 29229  0.8  1.4 401608 30124 ?        Ss   14:59   0:04 postgres: discourse discourse [local] idle                        
postgres  6928  0.9  1.2 398864 25520 ?        Ss   15:05   0:01 postgres: discourse discourse [local] idle                        
postgres    39  0.0  1.0 386224 20696 ?        S    Oct25   0:30 /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main
postgres  2125  0.0  0.8 398440 18356 ?        Ss   15:02   0:00 postgres: discourse discourse [local] idle                        
postgres  7369  0.0  0.7 398196 15980 ?        Ss   15:05   0:00 postgres: discourse discourse [local] idle                        
postgres  2471  0.1  0.7 396068 15120 ?        Ss   15:03   0:00 postgres: discourse discourse [local] idle                        
postgres 11084  0.0  0.5 396040 11416 ?        Ss   15:06   0:00 postgres: discourse discourse [local] idle                        
postgres    60  0.0  0.4 386356  9804 ?        Ss   Oct25   2:37 postgres: wal writer process                                      
discour+ 11261  0.0  0.2  30952  5496 ?        R    15:07   0:00 ps aux --sort -rss
discour+ 11260  0.0  0.2  19968  4900 ?        S    15:07   0:00 sleep 1
discour+    42  0.1  0.2  30704  4480 ?        S    Oct25   8:13 /bin/bash config/unicorn_launcher -E production -c config/unicorn.conf.rb
www-data    49  0.2  0.1 122936  3900 ?        S    Oct25  11:32 nginx: worker process
www-data    50  0.2  0.1 123032  3800 ?        S    Oct25  11:27 nginx: worker process
postgres    59  0.0  0.1 386356  3484 ?        Ss   Oct25   0:06 postgres: writer process                                          
postgres    61  0.0  0.1 387092  3064 ?        Ss   Oct25   0:17 postgres: autovacuum launcher process                             
syslog      41  0.0  0.1 180144  2880 ?        Sl   Oct25   0:02 rsyslogd -n
root        36  0.0  0.1 121344  2808 ?        S    Oct25   0:00 nginx: master process /usr/sbin/nginx
postgres    62  0.0  0.0 104068  1988 ?        Ss   Oct25   1:27 postgres: stats collector process                                 
www-data    51  0.0  0.0 121508  1880 ?        S    Oct25   0:10 nginx: cache manager process
root        37  0.0  0.0  61364  1556 ?        S    Oct25   0:00 /usr/sbin/sshd -D -e
root         1  0.0  0.0  21088  1140 ?        Ss+  Oct25   0:00 /bin/bash /sbin/boot
root        38  0.0  0.0  26772  1024 ?        S    Oct25   0:02 cron -f
root        28  0.0  0.0    188    32 ?        S+   Oct25   0:07 /usr/bin/runsvdir -P /etc/service
root        29  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv nginx
root        30  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv postgres
root        31  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv unicorn
root        32  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv redis
root        33  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv sshd
root        34  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv cron
root        35  0.0  0.0    168     4 ?        Ss   Oct25   0:00 runsv rsyslog

(Régis Hanol) #3

How much swap do you have?


(Ken Cooper) #4

This is the stock droplet from Digital Ocean.

I’m a bit of a noob with this, but swapon -s shows none?


(Régis Hanol) #5

You should probably add some swap.


(Ken Cooper) #6

Will do, thanks. Reading this was quite helpful, and also helped understand why it isn’t the default: