AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-341306

Sim's questions

Martin Hope
Sim
Asked: 2021-12-30 05:17:02 +0800 CST

Docker 在错误的 IP 范围内创建了额外的网桥

  • 1

我按照这里的答案并将 daemon.json 更改为:

{
  "bip": "10.200.0.1/24",
  "default-address-pools": [
      { "base":"10.201.0.0/16","size":24 },
      { "base":"10.202.0.0/16","size":24 }
  ]
}

因为我想更改 docker 网络使用的 IP 范围。但是,当我开始时,仍然创建了一个属于我想要离开的 IP 范围的网桥:

8: br-6c870af107ba: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:c0:ef:44:7e brd ff:ff:ff:ff:ff:ff
    inet 172.18.0.1/16 brd 172.18.255.255 scope global br-6c870af107ba
       valid_lft forever preferred_lft forever

如何防止 docker 创建此桥接接口?

networking docker docker-networking
  • 1 个回答
  • 189 Views
Martin Hope
Sim
Asked: 2017-09-16 05:36:15 +0800 CST

apache2 mpm_event 对配置更改没有反应

  • 0

我想增加并行打开连接的数量(阅读:服务器收到请求,但需要时间来处理,然后再回答,客户端正在等待)。我编写了一个测试 php 脚本来测试我是否实现了托管在 apache2 实例上的目标:

<?php
$time = new DateTime();
echo date_timestamp_get($time);
echo "<br>Hello World";
sleep(20);
echo "<br>bye world<br>";
$time = new DateTime();
echo date_timestamp_get($time);
?>

阿帕奇版本信息:

apachectl -V
Server version: Apache/2.4.23 (Unix)
Server built:   Oct 17 2016 11:09:09
Server's Module Magic Number: 20120211:61
Server loaded:  APR 1.5.2, APR-UTIL 1.5.4
Compiled using: APR 1.5.2, APR-UTIL 1.5.4
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_SYSVSEM_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="/bitnami/lampstack-linux-x64/output/apache2"
 -D SUEXEC_BIN="/bitnami/lampstack-linux-x64/output/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)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 socache_shmcb_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 substitute_module (shared)
 deflate_module (shared)
 mime_module (shared)
 log_config_module (shared)
 env_module (shared)
 headers_module (shared)
 unique_id_module (shared)
 setenvif_module (shared)
 version_module (shared)
 proxy_module (shared)
 proxy_connect_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_fcgi_module (shared)
 proxy_scgi_module (shared)
 proxy_wstunnel_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_express_module (shared)
 slotmem_shm_module (shared)
 ssl_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_bybusyness_module (shared)
 mpm_event_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 negotiation_module (shared)
 dir_module (shared)
 actions_module (shared)
 alias_module (shared)
 rewrite_module (shared)

与mpm模块相关的配置httpd.conf是:

LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
[...]
<IfModule mpm_prefork_module>
  StartServers    20
  MinSpareServers 20
  MaxSpareServers 20
  <IfVersion >= 2.3>
    MaxRequestWorkers       20
    MaxConnectionsPerChild  5000
  </IfVersion>
  <IfVersion < 2.3 >
    MaxClients              20
    MaxRequestsPerChild     5000
  </IfVersion>
  KeepAliveTimeout 1
</IfModule>

<IfModule mpm_event_module>
  ServerLimit               15
  StartServers              15
  MinSpareThreads         128
  MaxSpareThreads         192
  ThreadsPerChild          64
  MaxRequestWorkers       256
  MaxConnectionsPerChild 5000
  KeepAliveTimeout          2
</IfModule>

我正在(手动)在我的浏览器中运行 8 个请求来访问测试脚本,并希望access.log输出显示请求都在几秒钟内完成。但是日志的输出显示了不同的画面:

192.168.56.1 - - [16/Aug/2017:21:00:43 +0000] "GET /test.php HTTP/1.1" 200 58
192.168.56.1 - - [16/Aug/2017:21:01:03 +0000] "GET /test.php HTTP/1.1" 200 58
192.168.56.1 - - [16/Aug/2017:21:01:05 +0000] "GET /test.php HTTP/1.1" 200 58
192.168.56.1 - - [16/Aug/2017:21:01:05 +0000] "GET /test.php HTTP/1.1" 200 58
192.168.56.1 - - [16/Aug/2017:21:01:06 +0000] "GET /test.php HTTP/1.1" 200 58
192.168.56.1 - - [16/Aug/2017:21:01:07 +0000] "GET /test.php HTTP/1.1" 200 58
192.168.56.1 - - [16/Aug/2017:21:01:23 +0000] "GET /test.php HTTP/1.1" 200 59
192.168.56.1 - - [16/Aug/2017:21:01:25 +0000] "GET /test.php HTTP/1.1" 200 59

我浏览器中的输出与access.log输出匹配:

1.
1502917243
Hello World
bye world
1502917263

2.
1502917263
Hello World
bye world
1502917283

3.
1502917265
Hello World
bye world
1502917285

4.
1502917265
Hello World
bye world
1502917286

5.
1502917266
Hello World
bye world
1502917286

6.
1502917267
Hello World
bye world
1502917287

7.
1502917283
Hello World
bye world
1502917303

8.
1502917285
Hello World
bye world
1502917305

处理第一个请求,完成后处理接下来的五个请求,然后处理剩余的请求,很容易看出批处理之间的延迟是由于进程仍然被 sleep 命令保持打开状态。

更改配置后,我确实重新启动了 apache 服务。更改配置后,我确实重新启动了整台机器。两种操作都没有导致不同的结果,所以我的理论是我没有正确进行配置。

使用top列出活动进程和过滤使用COMMAND=httpd.bin显示下图:

 1298 root      20   0  136508   4624   2876 S  0.0  0.5   0:00.15 httpd.bin                                                                                                                                                                                                                                                                                                                                                           
 1347 daemon    20   0  876188   7192   2412 S  0.0  0.7   0:00.61 httpd.bin                                                                                                                                                                                                                                                                                                                                                           
 1348 daemon    20   0  876188   6956   2260 S  0.0  0.7   0:00.61 httpd.bin                                                                                                                                                                                                                                                                                                                                                           
 1349 daemon    20   0 1072796   7364   2416 S  0.0  0.7   0:00.62 httpd.bin  

我该如何解决这个问题/我的配置哪里出错了?

apache2
  • 1 个回答
  • 811 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve