Hi all,
I'm running two rails apps with nginx and thin. Only one of the
thin processes actually works - half of all requests to each site
result in a 502 Bad Gateway from nginx, and thin spits out
"!! Unexpected error while processing request: deadlock;
recursive locking"
to the logfile. What am I doing wrong, or is this a bug in
thin?
I'm using thin 1.4.1 Chromeo
Here is my nginx config
/etc/nginx/sites-available/MyApp: upstream cluster_MyApp {
server unix:/home/ubuntu/MyApp/tmp/sockets/thin.0.sock; server
unix:/home/ubuntu/MyApp/tmp/sockets/thin.1.sock; }
MyApp config
server {
listen 80; server_name myapp.com; server_name www.myapp.com; root
/home/ubuntu/MyApp/public; location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_pass http://cluster_MyApp;
} }
/etc/nginx/sites-available/redmine:
upstream cluster_redmine {
server unix:/home/ubuntu/redmine-2.0.3/tmp/sockets/thin.0.sock;
server unix:/home/ubuntu/redmine-2.0.3/tmp/sockets/thin.1.sock;
}
server {
listen 80; server_name redmine.myapp.com; root
/home/ubuntu/redmine-2.0.3/public; location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
proxy_pass http://cluster_redmine;
} }
Thin config for MyApp:
chdir: /home/ubuntu/MyApp
environment: production
address: 0.0.0.0
port: 80
timeout: 600
log: log/thin.log
socket: tmp/sockets/thin.sock
max_conns: 1024
max_persistent_conns: 512
require: []
wait: 120
servers: 2
daemonize: true
onebyone: true
no-epoll: true
tag: myapp_thin
Thin config for redmine
chdir: /home/ubuntu/redmine-2.0.3
environment: production
address: 0.0.0.0
port: 80
timeout: 600
log: log/thin.log
socket: tmp/sockets/thin.sock
max_conns: 1024
max_persistent_conns: 512
require: []
wait: 300
servers: 2
daemonize: true
onebyone: true
no-epoll: true
tag: redmine_thin
Cheers