cd /usr/ports/www/nginx
make install clean
Добавляем в автозапуск:
vi /etc/rc.conf
Добавляем там:
nginx_enable="YES"
Запускаем:
/usr/local/etc/rc.d/nginx start
cd /usr/ports/www/nginx
make install clean
vi /etc/rc.conf
nginx_enable="YES"
/usr/local/etc/rc.d/nginx start
find /var/lib/nginx/cache -type f -exec rm {} \;
for i in `find /var/lib/nginx/cache -type f`; do rm $i ; done
for i in `find /var/lib/nginx/cache/ -type f`; do cat $i | grep -a KEY; done | sort | uniq
2011/05/31 10:54:38 [alert] 4089#0: worker process 4664 exited on signal 9
Posted by Igor Sysoev (Guest) on 2008-07-08 14:10
On Tue, Jul 08, 2008 at 02:55:08PM +0300, Athan Dimoy wrote:
> Just a question according the new build. What this error really means
> "worker process 94184 exited on signal 9"?
This means that someone kills -9 worker process.
apt-get install -y nginx
vi /etc/nginx/sites-enabled/default
server {
listen 80;
server_name wiki.domain.ru;
access_log /var/log/nginx/access.log;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8180;
}
}
/etc/init.d/nginx restart
ab -c 45 -n 1000000 http://domain.ru/
2010/12/05 21:54:14 [crit] 21537#0: *14117 connect() to 127.0.0.1:11211 failed (99: Cannot assign requested address) while connecting to upstream, client: xx.xx.xx.xx server: domain.ru, request: "POST /test.php HTTP/1.1", subrequest: "/test.php", upstream: "memcached://127.0.0.1:11211", host: "domain.ru"
netstat -an |grep TIME_WAIT | grep 11211 | wc -l
24203
Нужно увеличить число исходящих портов. Как это сделать в Линуксе - не знаю.
--
Игорь Сысоев
sysctl -a|grep range
net.ipv4.ip_local_port_range = 32768 61000
now my benchmark test works fine. are there any other problems
when i run debian with this large port range?
No, there should no be problems.
You may set 1024-65535.
sysctl -a | grep recycl
net.ipv4.tcp_tw_recycle = 0
sysctl -a | grep reuse
net.ipv4.tcp_tw_reuse = 0
echo "net.ipv4.ip_local_port_range = 18000 61000" >> /etc/sysctl.conf
sysctl -p
/etc/init.d/nginx restart
vi /etc/nginx/nginx.conf
server_names_hash_bucket_size 512;
/etc/init.d/nginx restart
С геоип:
средняя для -n1 (10 измерений, каждый запрос с нового адреса): 5.20
средняя для -n10000 -c1: 6.63
Средняя для -n10000 -c10: 55.06
потребление памяти: каждый воркер имеет свою базу geoip (страны - 500 Кб, города - 20 Мб)
C гео:
средняя для -n1 (10 измерений, каждый запрос с нового адреса): 6.61
средняя для -n10000 -c1: 6.73
Средняя для -n10000 -c10: 58.01
потребление памяти: каждый воркер имеет свою базу geoip (только страны - 4 Мб)
Без геоип:
средняя для -n1 (10 измерений, каждый запрос с нового адреса): 6.70
Средняя для -n10000 -c1: 6.76
Средняя для -n10000 -c10: 57.91
cd /usr/src
wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
unzip GeoIPCountryCSV.zip
cd /usr/src
wget http://sysoev.ru/nginx/nginx-0.7.65.tar.gz
tar -xf nginx-0.7.65.tar.gz
perl nginx-0.7.65/contrib/geo2nginx.pl < GeoIPCountryWhois.csv > geo.conf
mv geo.conf /etc/nginx/
vi /etc/nginx/nginx.conf
geo $country {
default no;
include /etc/nginx/geo.conf;
}
log_format vhost_ip_full_format '$remote_addr - $remote_user [$time_local] $host $server_addr $request '
'$status $body_bytes_sent "$http_referer"'
'"$http_user_agent" "$http_x_forwarded_for" $request_time-$upstream_response_time "$country"';
access_log /var/log/nginx/access.log vhost_ip_full_format;
/etc/init.d/nginx reload
log_not_found off;
/etc/init.d/nginx reload
http://127.0.0.1:5000
apt-get install -y nginx
rm /etc/nginx/sites-enabled/default
vi /etc/nginx/sites-enabled/default
server {
listen 80;
server_name domain.ru;
access_log /var/log/nginx/access.log;
location / {
# передаем хостнейм Paster, хотя это не обязательно
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:5000;
}
}
/etc/init.d/nginx restart
cd myapp
nohup paster serve --reload development.ini &
cat /var/log/nginx/error.log | grep -v '2: No such file or directory' | grep -v 'failed (20: Not a directory' | grep -v ' access forbidden by rule' | egrep -v 'conflicting server name.*ignored' | grep -v 'Connection refused' | grep -v 'upstream timed out' | grep -v 'Connection reset by peer' | grep -v 'upstream prematurely closed connection while reading response header'
cat /var/log/apache2/error.log /var/log/httpd/error_log | grep -v '\[notice\] mod_fcgid: call' | grep -v 'Init: SSL server IP/port conflict' | grep -v 'RSA server certificate wildcard' | grep -v 'suEXEC mechanism enabled' | grep -v 'Init: You should not use name-based virtual hosts in conjunction with SSL' | grep -v 'mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations' | grep -v 'File does not exist' | grep -v 'RSA server certificate is a CA certificate' | grep -v 'RSA server certificate CommonName ' | grep -v 'Graceful restart requested, doing restart' | grep -v 'caught SIGTERM, shutting down' | grep -v 'Digest: done' | grep -v 'Digest: generating secret for digest authentication' | grep -v 'configured -- resuming normal operations' | grep -v 'Could not reliably determine the server' | egrep -v 'DocumentRoot.*does not exist' | egrep -v 'mod_fcgid: process.*terminated by calling exit\(\), return code: 0' | grep -v 'No such file or directory: Timeout connecting daemon' | grep -v 'process.*going graceful shutdown, sending SIGTERM' | grep -v 'process.*graceful shutdown timeouted, sending SIGKILL' | grep -v 'mod_fcgid: cleanup zombie process' | grep -v 'mod_fcgid: too much' | grep -v 'process.*exit(communication error)' | grep -v 'process.*exit(shutting down)' | grep -v 'Premature end of script headers: ispmgr' | egrep -v 'script.*not found or unable to stat' | grep -v 'client denied by server configuration' | grep -v 'mod_fcgid: process.*exit(lifetime expired)' | grep -v 'mod_fcgid: process.*exit(idle timeout)' | grep -v 'mod_fcgid: process.*exit(busy timeout)'
cat /usr/local/ispmgr/var/ispmgr.log | grep Error -i | grep -v 'error.log' | grep -v 'location_error' | grep -v 'fdata='
for i in `find /var/www/*/data/logs | grep 'error.log'`; do file $i | grep -q 'gzip compressed data'; if [ $? -eq 0 ]; then zcat $i ; else cat $i; fi ; done | grep -v 'File does not exist' | grep -v 'client denied by server configuration' | grep -v 'script not found or unable to stat' | grep -v 'not found or unable to stat' | grep -v 'No such file or directory: Timeout connecting daemon' | grep -v 'File name too long' | grep -v 'Directory index forbidden by Options directive' | grep -v 'attempt to invoke directory as script' | grep -v 'mod_fcgid: server is restarted' | grep -v 'Permission denied: file permissions deny server access' | egrep -v 'script.*not found or unable to stat' | grep -v "Permission denied: Can't open directory for index" | grep -v 'stderr: WordPress database error' | grep -v 'mod_fcgid: read data timeout in 40 seconds' | grep -v 'Premature end of script headers' | grep -v 'Request exceeded the limit of 10 internal redirects'