From 1c98e591af59fe51f0187863e5be9c3503dfe4e1 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Tue, 20 Sep 2016 21:00:53 +0000 Subject: [PATCH 1/2] 30 seconds wait for screenshot (from 1 min) --- environment.rb | 2 +- models/site.rb | 2 +- puma_config.rb | 2 +- rainbows_config.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/environment.rb b/environment.rb index 387685a6..03046ec7 100644 --- a/environment.rb +++ b/environment.rb @@ -150,5 +150,5 @@ CSV.foreach("./files/country_codes.csv") do |row| end gandi_opts = {} -gandi_opts[:env] = :test unless ENV['RACK_ENV'] == 'production' +gandi_opts[:env] = :test # unless ENV['RACK_ENV'] == 'production' $gandi = Gandi::Session.new $config['gandi_api_key'], gandi_opts diff --git a/models/site.rb b/models/site.rb index f8ff65fa..db76ddfe 100644 --- a/models/site.rb +++ b/models/site.rb @@ -1446,7 +1446,7 @@ class Site < Sequel::Model purge_cache path if pathname.extname.match HTML_REGEX - ScreenshotWorker.perform_in 1.minute, values[:username], relative_path + ScreenshotWorker.perform_in 30.seconds, values[:username], relative_path elsif pathname.extname.match IMAGE_REGEX ThumbnailWorker.perform_async values[:username], relative_path end diff --git a/puma_config.rb b/puma_config.rb index 5fb01d68..7d1bad15 100644 --- a/puma_config.rb +++ b/puma_config.rb @@ -21,7 +21,7 @@ daemonize pidfile '/var/run/neocities/neocities.pid' stdout_redirect '/var/log/neocities/neocities.log', '/var/log/neocities/neocities-errors.log', true quiet -workers processor_count +workers 4 worker_timeout 600 preload_app! on_worker_boot { DB.disconnect } diff --git a/rainbows_config.rb b/rainbows_config.rb index e30fd79a..04b41fe6 100644 --- a/rainbows_config.rb +++ b/rainbows_config.rb @@ -21,7 +21,7 @@ Rainbows! do client_max_body_size 100*1024*1024 # 100 Megabytes - worker_processes processor_count + worker_processes 4 worker_connections 32 timeout 600 # 10 minutes From 83e307674dbe2341e13156ac86bdedadb7edaef2 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Tue, 20 Sep 2016 21:03:56 +0000 Subject: [PATCH 2/2] revert to auto processor count for puma/rainbows --- puma_config.rb | 2 +- rainbows_config.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/puma_config.rb b/puma_config.rb index 7d1bad15..5fb01d68 100644 --- a/puma_config.rb +++ b/puma_config.rb @@ -21,7 +21,7 @@ daemonize pidfile '/var/run/neocities/neocities.pid' stdout_redirect '/var/log/neocities/neocities.log', '/var/log/neocities/neocities-errors.log', true quiet -workers 4 +workers processor_count worker_timeout 600 preload_app! on_worker_boot { DB.disconnect } diff --git a/rainbows_config.rb b/rainbows_config.rb index 04b41fe6..e30fd79a 100644 --- a/rainbows_config.rb +++ b/rainbows_config.rb @@ -21,7 +21,7 @@ Rainbows! do client_max_body_size 100*1024*1024 # 100 Megabytes - worker_processes 4 + worker_processes processor_count worker_connections 32 timeout 600 # 10 minutes