Questions tagged [unicorn]
Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. http://unicorn.bogomips.org/
125
questions
31
votes
5
answers
37k
views
Need to increase nginx throughput to an upstream unix socket -- linux kernel tuning?
I am running an nginx server that acts as a proxy to an upstream unix socket, like this:
upstream app_server {
server unix:/tmp/app.sock fail_timeout=0;
}
server {
listen ###.###.###....
16
votes
2
answers
11k
views
Optimal number of per CPU unicorn processes
We are running a Ruby on Rails web app under Unicorn. Our app is not strictly CPU bound (we have a dual Xeon E5645 system w/12 cores and a peak load average value is around 6). We started with 40 ...
8
votes
2
answers
6k
views
How to define different stop/restart signals with upstart
I am starting to convert all of our systems to using upstart to manage our various application processes. One thing that I am constantly missing is the ability to send a different signal to the ...
8
votes
1
answer
1k
views
Unicorn behind ELB, no nginx
If I understand Unicorn right (and in particular from their philosophy doc) it seems like Unicorn was really designed to operate behind a reverse proxy like nginx.
My question is: can I drop nginx ...
5
votes
3
answers
5k
views
Using Upstart to manage Unicorn w/ rbenv + bundler binstubs w/ ruby-local-exec shebang
Alright, this is melting my brain. It might have something to do with the fact that I don't understand Upstart as well as I should. Sorry in advance for the long question.
I'm trying to use Upstart ...
5
votes
4
answers
6k
views
Operation not permitted when starting Unicorn
I've created an nginx/unicorn/capistrato setup on Ubuntu (Amazon EC2) by following mostly this guide. I guess everything is set up like it should but when I start Unicorn I get (a LOT of) this error ...
5
votes
1
answer
2k
views
NGINX Unicorn 504 Gateway Time-out
I try all what I found in the Google by this question, but - nothing. It doesn't work anyway.
My NGINX default:
upstream app {
server unix:/tmp/unicorn.rails.sock fail_timeout=0;
}
server {
...
5
votes
1
answer
4k
views
Unicorn workers timing out intermittently
I'm getting intermittent timeouts from unicorn workers for seemingly no reason, and I'd like some help to debug the actual problem. It's worse because it works about 10 - 20 requests then 1 will ...
4
votes
1
answer
8k
views
Instances slow when connected to AWS load balancer
I have setup 5 t1.micro EC2's behind an AWS load balancer.
All the instances slow down once they are connected to the LB. Eight out of 10 requests takes more than 30s even when I do the requests ...
4
votes
1
answer
3k
views
can nginx retry request if unicorn is overloaded and returns a 502?
Is it possible to have nginx retry a second backend before returning a 502 to the client?
Would something like this work?
Front end:
# haproxy:85 => [a few app servers]:8000
# more specifically:
...
4
votes
1
answer
5k
views
Request timeout issue with nginx, unicorn and rails
I have an application in rails and it runs unicorn in production. There are some requests that take too long to process. I have configured the server to increase the timeout, so these request work ...
4
votes
1
answer
5k
views
Unicorn workers dying
Last night at around midnight, our app fell over and I'm trying to determine why.
We currently have a nginx front end server and 2 unicorn worker (app) servers on EC2.
Pretty much our unicorn workers ...
4
votes
1
answer
1k
views
Writing an upstart config file for Unicorn
I've had a good hunt and can't find a good example of an upstart script for Unicorn.
From what I've read however I think that upstart and unicorn might step on each others toes if I just try to set ...
4
votes
0
answers
867
views
Suddenly started experiencing enormous wait times before requests hit server
Our web app has been getting 20k-30k views a day, and steadily growing. About 4 days ago we suddenly started seeing wait times of 30-40 seconds before the HTML was even being delivered, on pages that ...
4
votes
0
answers
2k
views
Gitlab not working because of unicorn
gitlab looks like it should be ok, but it is not - page returns always:
502 Whoops, GitLab is taking too much time to respond.
Status:
$ gitlab-ctl status
run: gitlab-workhorse: (pid 10244) 718s; ...
4
votes
1
answer
525
views
Nginx + unicorn + spdy + performance testing
I have a ruby on rails website that is hosted on unicorn webserver behind a nginx reverse proxy. I want to evaluate if using spdy will enhance my performance under this setup.
Specifically, I need ...
4
votes
0
answers
319
views
Rails 4 Unicorn+Nginx on Ubuntu 13.04 VPS keeps crashing
I bought a years subscription at bluevm.com (found some coupon code, it was only about $15 for a whole year) to launch my first Rails Production server. I'm running Nginx with Unicorn and MySQL on ...
4
votes
1
answer
2k
views
Rails when served by unicorn is generating the wrong fingerprint for precompiled assets
I have a production server with nginx -> unicorn -> rails. I precompile assets, which puts assets in public/assets with a fingerprint (hash) appended to the filename. However, when a web page is ...
3
votes
1
answer
3k
views
Where does Varnish usually go in a Rails web stack?
I have a production Rails application deployed on Unicorn with nginx in front for static file serving. I now need some features of Varnish and I'm wondering how to introduce it.
Some people put ...
3
votes
2
answers
4k
views
Explain load-balancing with Nginx like I'm five
I've found plenty of DIY posts and tutorials on how to configure Nginx as a load-balancer using upstream server:
upstream backend {
ip_hash;
server 1.2.3.4;
server 1.2.3.5;
server 1.2.3.6;
}
...
3
votes
1
answer
2k
views
Nginx and Unicorn on separate machines
I've got a pretty standard Rails application running with Unicorn and Nginx all on one box. I'd like to split off the application itself and have Nginx on one machine and Unicorn (with the Rails app) ...
3
votes
3
answers
1k
views
Is slow IO on my cloud server causing my slow server restart issues?
I'm running two servers on Rackspace cloud one for the web app and one for the db and redis instances. The web server has 1Gb of ram and single core. Nginx sits in front of unicorn which is running 2 ...
3
votes
1
answer
2k
views
How to debug why my server has 3s delay on each request nginx/unicorn?
I am trying to debug why my server has 3 seconds delay on each request.
These are my nginx and unicorn config files: https://gist.github.com/regedarek/de7f2e5cd1918b6224ac
My server info:
Welcome ...
3
votes
1
answer
2k
views
Who should own the god process?
I have a stack running on ubuntu consisting of a Rack application written in Sinatra and GrapeAPI. The application stack includes Redis, Postgres, Nginx and unicorn. I want to use god to handle ...
3
votes
1
answer
2k
views
Rails + Nginx + Unicorn increase post data size ( 414 Request-URI Too Large)
I get 414 (Request-URI Too Large) exception on my POST Request while sending bulk date to my server. Is it possible to increase the limit of POST data?
I have done following change in nginx ...
3
votes
1
answer
1k
views
Nginx + Unicorn
I am working on a migration from nginx + passenger to nginx + unicorn and I have reached a point where I am a bit stuck.
When I attempt to view my test server, I get nothing but a 404 page. I am sure ...
3
votes
0
answers
1k
views
Rails, Capistrano, Nginx, Unicorn - Application has been already initialized (RuntimeError)
Can anyone shed some light on what exactly this error refers to?
I'm having trouble deploying new versions of the site.
I, INFO -- : reloading config_file=[snip]/current/config/unicorn.rb
I, INFO -...
2
votes
1
answer
1k
views
How to properly secure Unicorn/RoR server on ubuntu? Or, harden RoR application stack?
I have few Unicorn servers running on Ubuntu 12.04 and I am looking to secure them against exploits which give remote shell.
My main concern is, if it makes sense to deploy ModSecurity?
Another ...
2
votes
1
answer
10k
views
Forward real IP through Haproxy => Nginx => Unicorn
How do I forward the real visitors ip adress to Unicorn? The current setup is:
Haproxy => Nginx => Unicorn
How can I forward the real IP address from Haproxy, to Nginx, to Unicorn? Currently it ...
2
votes
1
answer
2k
views
Unicorn and copy_on_write_friendly?
While researching Unicorn configuration options I came across this snippet..
GC.respond_to?(:copy_on_write_friendly=) and
GC.copy_on_write_friendly = true
If I undertand correctly, it optimizes ...
2
votes
1
answer
2k
views
configure www.example.com as example.com
I am using nginx as server backend
sqlbuddy.example.com - for db manage (php-fpm)
example.com - main site (unicorn)
When I go to www.example.com I get sqlbuddy.example.com
How do I get example.com ...
2
votes
1
answer
358
views
Nginx and unicorn
I have 2 aplications, each one running on unicorn.
I'd like to use nginx as a front end for each of those application.
For each nginx / unicorn pair I would then use a dedicated unix socket.
To do so, ...
2
votes
1
answer
2k
views
IP spoofing attack errors after setting up a nodebalancer on Linode.com
I recently set up a NodeBalancer in front of a Rails 3.2.12 app.
The app is served by nginx and Unicorn.
All seems to work fine, but I get a lot of errors such as these that I didn't get when I only ...
2
votes
1
answer
1k
views
Why is there a separate "unicorn_rails" for Rails apps?
According to the Unicorn docs, there are different binaries for Rails apps and other Rack apps:
non-Rails Rack applications
In APP_ROOT, run:
unicorn
for Rails applications (should work for ...
2
votes
1
answer
3k
views
Apache / Unicorn: how to get Apache to serve static files
I'm following this tutorial to install apache + unicorn but it seems that apache doesn't serve any of the static files. Here's the config I came up with (take a look at Redirect all non-static ...
2
votes
1
answer
2k
views
Rails - Nginx not caching images
I've got a VPS where I'm running my Rails app using Nginx and Unicorn. I was successful to add expires headers to JS and CSS files, however I cannot force Nginx to cache images as well (according to ...
2
votes
3
answers
3k
views
Rails + Nginx + Unicorn multiple apps
I get the server where is currently installed two apps and i need to add another one, here is my configs.
nginx.conf
user www-data www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
...
2
votes
1
answer
5k
views
Trouble with nginx config and upstream servers
I'm trying to configure two applications to be served up by nginx. The first seems to be working fine and I duplicated the config for the second, however I'm having some problems.
I'm running a ...
2
votes
1
answer
5k
views
Monitoring slow nginx/unicorn requests
I'm currently using Nginx to proxy requests to a Unicorn server running a Sinatra application. The application only has a couple of routes defined, those of which make fairly simple (non costly) ...
2
votes
0
answers
264
views
Deploying sinatra app on rails app sub uri using( unicorn and nginx)
I have rails app running on unicorn+nginx. below is the nginx.conf and unicorn.rb configuration.
nginx.conf
upstream unicorn {
server unix:/tmp/unicorn.todo.sock fail_timeout=0;
}
server{
...
2
votes
1
answer
1k
views
Unicorn error while hosting a Rails app with NGINX
All of a sudden my app stopped working and these are the last lines I am getting from
unicorn.log
unicorn worker[0] -D -c /home/deployer/apps/myapp/current/config/unicorn.rb -E production: ...
2
votes
0
answers
4k
views
How to load environment variables with Unicorn
I can't seem to get my server to load up the environment variables. In my ideal setup I would like 1 user (deployer) to serve multiple applications on a single server. Ubuntu 12.04, Nginx, Unicorn.
...
1
vote
3
answers
928
views
What are the benefits of running a app server in user space, like Unicorn, as opposed to as sudo?
I've been using Phusion Passenger + Rails/Sinatra for a lot of projects. Passenger runs under the main Nginx or Apache process.
But I'm interested in Unicorn, partly because it runs in user space. ...
1
vote
1
answer
1k
views
Block masking URL from nginx
Some bad person is masking my website with his domain www.baddomain.com. I would like to block it somehow from my nginx config file if that is possible.
I tried to see from "baddomain.com" source ...
1
vote
3
answers
4k
views
Rails 3 shows 404 error instead of index.html (nginx + unicorn)
I have an index.html in public/ that should be loading by default but instead I get a 404 error when I try to access http://example.com/
The page you were looking for doesn't exist.
You may ...
1
vote
2
answers
3k
views
nginx load balancing images not loading
Below is my load balancing configuration.my other servers contain nginx unicorn based application setup. When i tried above configuration the images are not loading. I have total three servers 1 ...
1
vote
4
answers
11k
views
nginx Permission denied error
I'm runnning nginx and unicorn to serve Rails application.
Unicorn and Rails app works fine, but nginx can't open rails public directory with permission error and return 502 Bad Gateway.
curl http://...
1
vote
3
answers
2k
views
Nginx + Unicorn multiple apps with locations - routing
I would like to run multiple rails apps with just using different location blocks. Different unicorn workers are started and configured, they are working just fine.
Every app is under the same folder:...
1
vote
1
answer
2k
views
scalability with nginx, passenger, ruby on rails setup [duplicate]
Possible Duplicate:
How do you do Load Testing and Capacity Planning for Web Sites
Hey guys I had a question regarding scalability for my RoR application.
We have been optimizing our ...
1
vote
1
answer
2k
views
Elastic Load Balancer & SSL termination
I am setting up a Rails app on AWS that:
1) all traffic must be ssl encrypted
2) will highly fluctuate in the amount of traffic on a weekly basis
3) will by maintained by someone that is a stronger ...