我知道 OPTIONS 调用是正常的,并且我已经阅读了如何将它们从日志中排除,但是它们的数量似乎异常多,例如,在过去的 10k 个请求中,有 1525 个是 OPTION 调用,很多时候在一秒钟内就会出现大量的 OPTION 调用:
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
::1 - - [21/Feb/2017:18:22:02 +0000] "OPTIONS * HTTP/1.0" 200 - "-" "Apache/2.4.7 (Ubuntu) OpenSSL/1.0.1f (internal dummy connection)"
这是 WPEngine 专用服务器,但它是完全托管的,所以我没有 root 访问权限。我只是想确认这些实际上不是导致我们遇到的性能问题的原因。我尝试使用 curl 模拟调用,如下所示:
curl -i -v -X OPTIONS http://www.oursite.com/*
但是这会导致 404 错误,由于性能问题,生成该错误需要 30 秒。有没有办法发送与内部连接调用相同的请求,以确保它不会消耗资源?
问题 2:我理解这些调用是 Apache 轮询子进程。根据 apache.org 的说法,在某些配置中,这些调用曾经导致问题,他们说如果是这样,你可以重定向它们:
https://wiki.apache.org/httpd/InternalDummyConnection
在 2.2.6 及更早版本中,在某些配置下,这些请求可能会命中重量级的动态网页,从而导致服务器负载过大。您可以使用 mod_rewrite 在使用该特定 User-Agent 或 IP 地址访问时以重定向进行响应,从而避免这种情况。
我知道这是 2.4.7,但我正在考虑测试重定向这些,只是为了看看它是否能提高性能。假设它有效,这样做会产生什么影响?