lux-fw 0.5.35 → 0.5.36

Sign up to get free protection for your applications and to get access to all the features.
data/misc/lux.png DELETED
Binary file
data/misc/nginx.conf DELETED
@@ -1,60 +0,0 @@
1
- # /etc/nginx/nginx.conf
2
- # worker_processes 4; # one per proc "grep processor /proc/cpuinfo | wc -l"
3
- # worker_connections 1024;
4
- # SSL https://certbot.eff.org/
5
- # 11 11 * * * certbot renew --post-hook "service nginx restart"
6
-
7
- server {
8
- listen 80;
9
- server_name .domain.com;
10
- return 301 https://$host$request_uri;
11
- }
12
-
13
- server {
14
- server_name .stemical.com;
15
-
16
- root $ROOT/public;
17
- error_log $ROOT/log/nginx-error.log;
18
-
19
- passenger_enabled on;
20
- passenger_friendly_error_pages on;
21
-
22
- client_body_timeout 12;
23
- client_body_in_file_only clean;
24
- client_body_buffer_size 32K; # form POST
25
- client_header_timeout 12;
26
- client_max_body_size 50M;
27
- keepalive_timeout 20;
28
- send_timeout 10;
29
- sendfile on;
30
-
31
- gzip on;
32
- gzip_comp_level 2;
33
- gzip_min_length 1000;
34
- gzip_proxied expired no-cache no-store private auth;
35
- gzip_types text/plain application/x-javascript text/xml text/css application/xml;
36
-
37
- access_log off;
38
-
39
- # ssl_session_timeout 1d;
40
- ssl_session_cache shared:SSL:50m;
41
- ssl_stapling on;
42
- ssl_stapling_verify on;
43
-
44
- location = /favicon.ico {
45
- log_not_found off;
46
- access_log off;
47
- }
48
-
49
- location ^~ /assets/ {
50
- gzip_static on;
51
- expires max;
52
- add_header Cache-Control public;
53
- }
54
-
55
- location ^~ /.well-known {
56
- allow all;
57
- default_type "text/plain";
58
- root $ROOT/public;
59
- }
60
- }
@@ -1,43 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Instantiate about one process per X MiB of available memory, scaling up to as
3
- # close to MAX_THREADS as possible while observing an upper bound based on the
4
- # number of virtual/logical CPUs. If there are fewer processes than
5
- # MAX_THREADS, add threads per process to reach MAX_THREADS.
6
- require 'etc'
7
-
8
- KB_PER_WORKER = 64 * 1_024 # average of peak PSS of single-threaded processes (watch smem -k)
9
- MIN_WORKERS = 2
10
- MAX_WORKERS_PER_VCPU = 1.25 # virtual/logical
11
- MIN_THREADS_PER_WORKER = 1
12
- MAX_THREADS = Integer(ENV['MAX_CONCURRENCY'] || 256)
13
-
14
- def meminfo arg
15
- File.open('/proc/meminfo') do |f|
16
- f.each_line do |line|
17
- key, value = line.split(/:\s+/)
18
- return value.split(/\s+/).first.to_i if key == arg
19
- end
20
- end
21
-
22
- raise "Unable to find `#{arg}' in /proc/meminfo!"
23
- rescue
24
- 1_000_000
25
- end
26
-
27
- def auto_tune
28
- avail_mem = meminfo('MemAvailable') * 0.8 - MAX_THREADS * 1_024
29
-
30
- workers = [
31
- [(1.0 * avail_mem / KB_PER_WORKER).floor, MIN_WORKERS].max,
32
- (Etc.nprocessors * MAX_WORKERS_PER_VCPU).ceil
33
- ].min
34
-
35
- threads_per_worker = [
36
- workers < MAX_THREADS ? (1.0 * MAX_THREADS / workers).ceil : -Float::INFINITY,
37
- MIN_THREADS_PER_WORKER
38
- ].max
39
-
40
- [workers, threads_per_worker]
41
- end
42
-
43
- p auto_tune if $0 == __FILE__
@@ -1,3 +0,0 @@
1
- puma -w 5 -t 2:2 -p 3000 -e production --preload
2
-
3
- siege -c 200 -t 10s -q --log=./siege.log http://profile.lvh.me:3000/en
data/misc/unicorn.rb DELETED
@@ -1,37 +0,0 @@
1
- # set path to application
2
- app_dir = File.expand_path("../..", __FILE__)
3
- working_directory app_dir
4
-
5
- # Set unicorn options
6
- worker_processes 10
7
- preload_app true
8
- timeout 20
9
-
10
- # Set up socket location
11
- listen "127.0.0.1:3000", :tcp_nopush => true
12
- listen "#{app_dir}/tmp/unicorn.sock", :backlog => 512
13
-
14
- # Logging
15
- stderr_path "#{app_dir}/log/unicorn.stderr.log"
16
- stdout_path "#{app_dir}/log/unicorn.stdout.log"
17
-
18
- # Set master PID location
19
- pid "#{app_dir}/tmp/unicorn.pid"
20
-
21
- worker_processes 5
22
- timeout 15
23
-
24
- preload_app true
25
-
26
- GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true
27
-
28
- check_client_connection false
29
-
30
- before_exec do |server|
31
- end
32
-
33
- before_fork do |server, worker|
34
- end
35
-
36
- after_fork do |server, worker|
37
- end