seal

seal
Рейтинг
62
Регистрация
10.10.2006

Alexei42, ну да. я же выше даже выложил рабочий конфиг.

поделюсь результатами тестирования.

вариант 1

apache 22 + mod_php5


ab -n 100 http://www.sat-expert.com/
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.sat-expert.com (be patient).....done


Server Software: Apache/2.2.6
Server Hostname: www.sat-expert.com
Server Port: 80

Document Path: /
Document Length: 48270 bytes

Concurrency Level: 1
Time taken for tests: 98.904084 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 4851368 bytes
HTML transferred: 4827000 bytes
Requests per second: 1.01 [#/sec] (mean)
Time per request: 989.041 [ms] (mean)
Time per request: 989.041 [ms] (mean, across all concurrent requests)
Transfer rate: 47.89 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 33 34 0.9 34 38
Processing: 756 954 53.7 978 1023
Waiting: 48 50 11.4 49 157
Total: 790 988 53.8 1012 1056

Percentage of the requests served within a certain time (ms)
50% 1012
66% 1018
75% 1024
80% 1027
vvs@venus~> ab -n 100 http://www.sat-expert.com/
95% 1038
98% 1050
99% 1056
100% 1056 (longest request)
vvs@venus~>

вариант 2

nginx + fastcgi


vvs@venus~> ab -n 100 http://www1.sat-expert.com/
This is ApacheBench, Version 2.0.41-dev <$Revision: 1.121.2.12 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www1.sat-expert.com (be patient).....done


Server Software: nginx/0.5.34
Server Hostname: www1.sat-expert.com
Server Port: 80

Document Path: /
Document Length: 47285 bytes

Concurrency Level: 1
Time taken for tests: 98.364476 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 4745468 bytes
HTML transferred: 4728500 bytes
Requests per second: 1.02 [#/sec] (mean)
Time per request: 983.645 [ms] (mean)
Time per request: 983.645 [ms] (mean, across all concurrent requests)
Transfer rate: 47.11 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 33 34 0.9 34 39
Processing: 709 948 47.2 971 1078
Waiting: 47 48 2.2 48 63
Total: 745 983 47.1 1005 1111

Percentage of the requests served within a certain time (ms)
50% 1005
66% 1012
75% 1014
80% 1016
90% 1023
95% 1034
98% 1043
99% 1111
100% 1111 (longest request)
vvs@venus~>

как видим nginx побыстрей в этой связке.

+ совсем другой расход памяти.....

желающим принять участие в оптимизации и тестировании - welcome!

не буду вдаваться в подробности а напишу кому надо. описанный выше rewrite имени apache работет вот в какой конфигурации:


server {
listen 80;
server_name host;

root /home/host/www/;
index index.html index.htm index.php;

if (!-e $request_filename) {
rewrite ^/.* /index.php break;
}

location ~ \.php$ {
fastcgi_pass localhost:1029;

fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/host/www$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT /home/host/www;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
}
}

скрипту index.php нигде не передавался $request_uri



location / {
root /usr/local/www/data/sab;
index index.php;
if (!-f $request_filename)
{
rewrite ^(.*)$ /index.php last;
# break;
}
if (!-d $request_filename)
{
rewrite ^(.*)$ /index.php last;
# break;
}


}

и так тоже не работет :(

как же его победить?!

78.47.121.190:80

HostCMS:
видимо NS еще не разошелся

пропишите в /etc/hosts

javadf:
Или вы в конфиге и пишите?

в правильно помните. там выше даже кусочек этого конфига есть :)

HostCMS:
а разве не так нужно:
location ~ \.php$ {

а что так что квак :(

HostCMS, у меня дома очень медленный инет и нет никаких мерялок под рукой. вот два урл выше дал для пробы. померяйте ... если не тяжело то опубликуйте результат.

HostCMS, никак не хочет. конфигурация сейчас такая:



server {
listen 78.47.121.190:80;
server_name www1.sat-expert.com;

#charset koi8-r;

access_log /usr/local/www/data/sab/log/host.access.log main;


location / {
root /usr/local/www/data/sab;
index index.php;


if (!-e $request_filename)
{
rewrite ^(.*)$ /index.php last;
}


location ~ .php$ {
fastcgi_pass unix:/tmp/php-fastcgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/data/sab$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

}
}

сейчас я отключу ЧПУ. работает все кроме главной страницы :)

удивительно.

http://www1.sat-expert.com

причем скорость работы по сравнению с http://www.sat-expert.com где стоит обычный апач + mod_php на глаз .... не поражает воображение.

2Ugnich Anton а втом то и дело что в логах никакого криминала нет. причем интерестно так работает, статика вся отдается, а вот те линки что ЧПУ должно отдавать нет. но и влоге я не вижу куда идет rewrite

Всего: 81