首页 > 解决方案 > apachectl -k 优雅时,Apache 2.4.41 将 L 连接变为 G 连接

问题描述

运行 Apache 2.4.41(使用 OpenSSL/1.0.2r 和 mod_jk/1.2.41)的 Linux 机器有一些奇怪的问题。

在该框中运行的 100 个 Java 应用程序中,两个类似应用程序的 URL 一段时间前开始无响应。它在自己的重定向后没有响应:

# wget https://myapp.mydomain.com

--2021-04-27 08:31:07--  https://myapp.mydomain.com/
Resolving myapp.mydomain.com... 10.152.140.13
Connecting to myapp.mydomain.com|10.152.140.13|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://myapp.mydomain.com/myapp/ [following]
--2021-04-27 08:31:07--  https://myapp.mydomain.com/myapp/
Reusing existing connection to myapp.mydomain.com:443.
HTTP request sent, awaiting response...

它只发生在 HTTPs 上,而不发生在 HTTP 上

重新启动 Java 应用程序并不能解决问题。唯一的方法是重新加载/优雅化 apache:

/opt/apache2/bin/apachectl -k graceful

这使得该 Java 应用程序 URL 再次响应。

这个问题很奇怪,因为有一个双 Linux 机器,运行相同的 Java 应用程序、相同的 Apache 版本和配置,它不会遇到这个问题。

此外,我注意到,当应用程序开始挂起时,处于 Logging 状态的 apache 连接数会增加;而当优雅完成时,那些会变成G种族,并且永远不会消失。

_____L___________LL___L___________L________________LLLL___LL_L_L
L_L____L__LWLL_LL____R_L_LL__L__L_L_LLLLLLLLLLLLLLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLLLLLLLLL_LL__LL_L__WLLR____L__LL_LL____L_L_L__L__
_L_LL___........................................................

.....G...........GG...G...........G................GGGG...GG.G.G
G.G....G..G.GG.GG......G.GG..G..G.G.GGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGG.GG..GG.G...GG.....G..GG.GG....G.G.G..G..
.G.GG...___W____________________________________________________
___RR_______________________________________W___________________
______________________________..................................

然后唯一的解决方案是重新启动apache。

任何人都对这种行为有任何解释并且可以阐明它吗?

此致

阿帕奇信息

Server version: Apache/2.4.41 (Unix)
Server built:   Oct  2 2019 19:42:08
Server's Module Magic Number: 20120211:88
Server loaded:  APR 1.7.0, APR-UTIL 1.6.1
Compiled using: APR 1.7.0, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     event
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_PROC_PTHREAD_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/opt/apache2"
 -D SUEXEC_BIN="/opt/apache2/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_event_module (static)
 info_module (shared)
 status_module (shared)
 socache_shmcb_module (shared)
 rewrite_module (shared)
 headers_module (shared)
 proxy_module (shared)
 proxy_balancer_module (shared)
 slotmem_shm_module (shared)
 lbmethod_byrequests_module (shared)
 proxy_http_module (shared)
 allowmethods_module (shared)
 ext_filter_module (shared)
 substitute_module (shared)
 dtagent_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 log_config_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 alias_module (shared)
 filter_module (shared)
 unixd_module (shared)
 security2_module (shared)
 unique_id_module (shared)
 jk_module (shared)

标签: apachesslhttpsconnection

解决方案


推荐阅读