Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


   


   


   















      :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Nginx !



, , , . .

iotop ?

11 2012., 1:45 ProxyKZ <nginx-forum@xxxxxxxx> :
Xeon 2,4GHz QuadCore / RAM 2Gb / SAS 500Gb
100 50-100 7-10
1000-2000 . Nginx/0.6.32 Apache.
Apache nginx
502 .. , MaxClient 25
. Nginx -
nginx -
. ,
-
js css,
(404),
. 1MBit/s
, 3-5-
10 .

Apache:
-----------------------------
ServerRoot "/etc/apache2"

LockFile /var/lock/apache2/accept.lock

PidFile ${APACHE_PID_FILE}

Timeout 15
KeepAlive Off
MaxKeepAliveRequests 400
KeepAliveTimeout 3

ExtendedStatus On

<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 2
MaxSpareServers 10
MaxClients 25
MaxRequestsPerChild 1000
</IfModule>

<IfModule mpm_worker_module>
StartServers 2
MaxClients 50
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 1000
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>

DefaultType text/plain

HostnameLookups Off
ErrorLog /var/log/apache2/error.log
LogLevel info

Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

Include /etc/apache2/httpd.conf

Include /etc/apache2/ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

Include /etc/apache2/conf.d/

NameVirtualHost *:443
<VirtualHost _default_:443>
ServerName example.com:443
SSLEngine on
SSLCertificateFile /etc/apache2/ssl.crt/server.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/server.key
</VirtualHost>

Include /usr/local/ispmgr/etc/ispmgr.inc

<Directory /home/user/www/domen.example.com>
AllowOverride all
php_admin_value open_basedir "/home/user:."
</Directory>
-----------------------------
..


Nginx:
-----------------------------
user www-data;
worker_processes 4;
worker_rlimit_nofile 16384;

error_log /var/log/nginx/error.log error;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
use epoll;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

access_log /var/log/nginx/access.log;
#expires 30d;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
client_max_body_size 10m;
client_body_buffer_size 16k;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 10m;

gzip on;
gzip_comp_level 3;
gzip_proxied any;
gzip_min_length 1000;
gzip_types application/x-_javascript_ text/css;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

keepalive_timeout 35;


include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
log_format isp '$bytes_sent $request_length';
server {
listen 82.200.198.10:80;
server_name example.com www.example.com;
rewrite ^(/manager/.*)$ https://$host$1 permanent;
error_page 404 = @fallback;
location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/|pgadmin/) {
proxy_pass http://82.200.198.10:81;
proxy_redirect http://example.com:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
proxy_pass http://82.200.198.10:81;
proxy_redirect http://example.com:81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
location ~*
^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
root /home/user/www/example.com;
access_log /home/httpd-logs/example.com.access.log ;
access_log /home/nginx-logs/user isp;
}
location @fallback {
proxy_pass http://82.200.198.10:81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}
-----------------------------
.. 100 .

Nginx :
worker_connections
worker_processes
sendfile
proxy_connect_timeout
proxy_send_timeout
proxy_read_timeout
gzip_proxied
gzip_comp_level
,
.

Apache Server Status 10 Request,
( 20-25), nginx
?

Top- nginx 2% CPU ,
CPU Apache 3-4 30-70%
MySQL 20-30% , 50-70%
. RAM CPU .
, nginx
, .

, ,
...
- !!!

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,231602,231602#msg-231602

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.