Welcome! Log In Create A New Profile

Advanced

How do you avoid the dreaded 503 service temporarily not available???

Posted by gdork 
How do you avoid the dreaded 503 service temporarily not available???
January 28, 2011 10:11PM
I must have read over 100 pages of stuff and searched google for many hours.
I cant find a definitive answer. I run a site with a lot of image traffic.

What things cause nginx to throw a 503??? Ive tried a ton of configs.

At the linux level I did this:
http://fasterdata.es.net/fasterdata/host-tuning/linux/

changes sysctl.conf to have:
# increase TCP max buffer size setable using setsockopt()
# 16 MB with a few parallel streams is recommended for most 10G paths
# 32 MB might be needed for some very long end-to-end 10G or 40G paths
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
# (only change the 3rd value, and make it 16 MB or more)
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
# recommended to increase this for 10G NICS
net.core.netdev_max_backlog = 30000

-------------------------------------------------------------------

I run nginx with fastcgi to php on the back end. Config snippets I have added include:

events {
worker_connections 8192;
use epoll;
# multi_accept on;
}

client_header_buffer_size 1k;
large_client_header_buffers 8 16k;
proxy_buffering off;

client_body_timeout 65;
client_header_timeout 65;
keepalive_timeout 0 0;
send_timeout 65;

## TCP options
tcp_nodelay on;
tcp_nopush on;

server {
listen 80 default rcvbuf=64K backlog=5000;
# was hoping backlog would help... it did not.
# This is at the top server level... I have many virtual hosts underneath which do no specify backlog (causes a conflict).
# Is a single backlog directive correct at the top server level???

# Below here all the virtual host files are loaded.

ANY IDEAS on how to make it foolproof against 503's? The server unix load is only about a 2 on a quad cpu box.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 240
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready