Нестабильная работа сервера

A
На сайте с 23.08.2019
Offline
0
418

Добрый день. Нужна помощь с таким вопросом.

На сервере размещен портал с средней нагрузкой 6000 пользователей за час.

Параметры сервера:

мат.плата supermicro

проц. Intel xeon Gold с 8 ядрами и частотой 3.2

оперативка 256 Гб

диски ssd

ПО:

Debian 9.5

Apache 2.4

Ngnx

Varnish

Mysql

Портал крутиться на Drupal 7

Связка настроена таким образом

Nginx (SSL и переадресация) -> Varnish (64 Гб памяти выделено, кэширует статику), apache

В чем проблема:

проверяю в яндекс боте параметр 'проверка ответа сервера' и он изменяется в больших диапазонах. Так например делаю 30 запросов и получаю время ответа 27 мс 28 мс 28 мс 48мс 37мс 27мс 56мс 75мс 56 мс 82 мс 45мс 27мс 30 мс 109мс 14мс 16мс 28мс 19мс 51мс 37мс 62мс 21мс 19мс 55мс 109мс и опять снижается. Таких резких прыжков быть не должно при нормальной работе. Подскажите где можно глянуть в чем происходит затык. Я пока грешу на Varnish.

Конфиг Varnish -

backend drupal {

.host = "93.84.112.130";

.port = "8080";

}

sub vcl_init {

new bar = directors.fallback();

bar.add_backend(drupal);

}

sub vcl_recv {

set req.backend_hint = bar.backend();

# Do not cache these paths.

if (req.url ~ "^/status\.php$" ||

req.url ~ "^/update\.php" ||

req.url ~ "^/install\.php" ||

req.url ~ "^/apc\.php$" ||

req.url ~ "^/admin" ||

req.url ~ "^/admin/.*$" ||

req.url ~ "^/user" ||

req.url ~ "^/user/.*$" ||

req.url ~ "^/users/.*$" ||

req.url ~ "^/info/.*$" ||

req.url ~ "^/flag/.*$" ||

req.url ~ "^/yandex-dzen\.xml" ||

req.url ~ "^/sitemap\.xml" ||

req.url ~ "^/sitemap\.xml.*$" ||

req.url ~ "^/hybridauth/.*$" ||

req.url ~ "^/robots\.txt" ||

req.url ~ "^.*/ajax/.*$" ||

req.url ~ "^.*/ahah/.*$" ||

req.url ~ "^/system/files/.*$") {

return (pass);

}

# Always cache the following file types for all users. This list of extensions

# appears twice, once here and again in vcl_fetch so make sure you edit both

if (req.url ~ "(?i)\.(pdf|asc|dat|txt|doc|xls|ppt|tgz|csv|swf|css|js)(\?.*)?$") {

unset req.http.Cookie;

}

# Remove all cookies that Drupal doesn't need to know about. We explicitly

# list the ones that Drupal does need, the SESS and NO_CACHE. If, after

# running this code we find that either of these two cookies remains, we

# will pass as the page cannot be cached.

if (req.http.Cookie) {

# 1. Append a semi-colon to the front of the cookie string.

# 2. Remove all spaces that appear after semi-colons.

# 3. Match the cookies we want to keep, adding the space we removed

# previously back. (\1) is first matching group in the regsuball.

# 4. Remove all other cookies, identifying them by the fact that they have

# no space after the preceding semi-colon.

if (req.http.Cookie) {

# 1. Append a semi-colon to the front of the cookie string.

# 2. Remove all spaces that appear after semi-colons.

# 3. Match the cookies we want to keep, adding the space we removed

# previously back. (\1) is first matching group in the regsuball.

# 4. Remove all other cookies, identifying them by the fact that they have

# no space after the preceding semi-colon.

# 5. Remove all spaces and semi-colons from the beginning and end of the

# cookie string.

set req.http.Cookie = ";" + req.http.Cookie;

set req.http.Cookie = regsuball(req.http.Cookie, "; +", ";");

set req.http.Cookie = regsuball(req.http.Cookie, ";(SESS[a-z0-9]+|SSESS[a-z0-9]+|NO_CACHE)=", "; \1=");

set req.http.Cookie = regsuball(req.http.Cookie, ";[^ ][^;]*", "");

set req.http.Cookie = regsuball(req.http.Cookie, "^[; ]+|[; ]+$", "");

if (req.http.Cookie == "") {

# If there are no remaining cookies, remove the cookie header. If there

# aren't any cookie headers, Varnish's default behavior will be to cache

# the page.

unset req.http.Cookie;

}

else {

# If there is any cookies left (a session or NO_CACHE cookie), do not

# cache the page. Pass it on to Apache directly.

return (pass);

}

}

# Check the incoming request type is "PURGE", not "GET" or "POST".

if (req.method == "PURGE") {

# Check if the IP is allowed.

if (!client.ip ~ purge) {

# Return error code 405 (Forbidden) when not.

return (synth(405, "Not allowed."));

}

return (purge);

}

}

acl purge {

"localhost";

"127.0.0.1";

}

sub vcl_backend_response {

sub vcl_deliver {

unset resp.http.Cache-Tags;

}

AU
На сайте с 03.09.2009
Offline
88
#1

Не забывайте что в параметрах ответа единица измерения - миллисекунда, это одна тысячная секунды. Девиация, которую вы наблюдаете, ничтожно мала.

Кроме того что есть разброс во времени ответа, есть другие проблемы?

Unix в вопросах и ответах https://unixhow.com (https://unixhow.com)
Lazy Badger
На сайте с 14.06.2017
Offline
231
#2
anlionisa:
В чем проблема

Всем бы такие проблемы. Реально - это совершенно незначительные колебания при общем вполне достойном response time (для бота, браузерные визиты могут давать другое время, то это другая проблема)

Производство жести методом непрерывного отжига

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий