質問編集履歴

3

試したことを追記

2019/09/22 03:11

投稿

nanase21
nanase21

スコア144

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,73 @@
15
15
 
16
16
 
17
17
  ![イメージ説明](1dd6f12f2bef4b82177e4541696e957a.png)
18
+
19
+
20
+
21
+ ```
22
+
23
+ # set lets
24
+
25
+ $worker = 2
26
+
27
+ $timeout = 30
28
+
29
+ $app_dir = "/var/www/projects/meetup"
30
+
31
+ $listen = File.expand_path 'tmp/sockets/.unicorn.sock', $app_dir
32
+
33
+ $pid = File.expand_path 'tmp/pids/unicorn.pid', $app_dir
34
+
35
+ $std_log = File.expand_path 'log/unicorn.log', $app_dir
36
+
37
+ # set config
38
+
39
+ worker_processes $worker
40
+
41
+ working_directory $app_dir
42
+
43
+ stderr_path $std_log
44
+
45
+ stdout_path $std_log
46
+
47
+ timeout $timeout
48
+
49
+ listen $listen
50
+
51
+ pid $pid
52
+
53
+ # loading booster
54
+
55
+ preload_app true
56
+
57
+ # before starting processes
58
+
59
+ before_fork do |server, worker|
60
+
61
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!
62
+
63
+ old_pid = "#{server.config[:pid]}.oldbin"
64
+
65
+ if old_pid != server.pid
66
+
67
+ begin
68
+
69
+ Process.kill "QUIT", File.read(old_pid).to_i
70
+
71
+ rescue Errno::ENOENT, Errno::ESRCH
72
+
73
+ end
74
+
75
+ end
76
+
77
+ end
78
+
79
+ # after finishing processes
80
+
81
+ after_fork do |server, worker|
82
+
83
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
84
+
85
+ end
86
+
87
+ ```

2

試したことを追記

2019/09/22 03:11

投稿

nanase21
nanase21

スコア144

test CHANGED
File without changes
test CHANGED
@@ -11,3 +11,7 @@
11
11
  urlにアクセス出来ているので、プリコンパイルの問題からとも思ったのですがどうも関係ないようでした。
12
12
 
13
13
  ロードバランサーの設定がいまいちよくわかないかったのでなんとなくで設定してました。
14
+
15
+
16
+
17
+ ![イメージ説明](1dd6f12f2bef4b82177e4541696e957a.png)

1

試したことを追記

2019/09/22 02:27

投稿

nanase21
nanase21

スコア144

test CHANGED
File without changes
test CHANGED
@@ -6,4 +6,8 @@
6
6
 
7
7
  色々、私なりに調べてみたのですが何が原因なのかが分からないでいます。
8
8
 
9
+ 補足情報
10
+
9
11
  urlにアクセス出来ているので、プリコンパイルの問題からとも思ったのですがどうも関係ないようでした。
12
+
13
+ ロードバランサーの設定がいまいちよくわかないかったのでなんとなくで設定してました。