AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 1141176
Accepted
MeSo2
MeSo2
Asked: 2023-08-10 06:05:29 +0800 CST2023-08-10 06:05:29 +0800 CST 2023-08-10 06:05:29 +0800 CST

Apache 2.4 no Windows lento para responder à primeira solicitação inicial

  • 772

Comecei a servir arquivos Brotli pré-compactados em meu site https://www.filmfix.com/en/home/ . Eles trabalham; mas desde então, o Apache está tendo problemas de resposta em todas as configurações do VirtualHost (não apenas para os VirtualHostdedicados a servir esses arquivos HTML estáticos pré-compactados).

Se eu clicar logo após o carregamento inicial (muito lento), ele geralmente permanece responsivo (ou se eu apenas reiniciei o Apache) - mas se eu esperar um pouco, ele para de responder. E pode levar de 7 a 45 segundos para reconectar. Ocasionalmente, o navegador expirava, aguardando a conexão.

O que poderia estar causando isso; e como faço para corrigir isso?

Meus resultados https://www.webpagetest.org são assim. resultado webpagetest.org

Espero que não esteja relacionado à minha pergunta de há pouco tempo: Internal Network drops connection .

Encontrei uma pergunta semelhante em stackoverflow.com que me deu mais algumas ideias, mas nada resolveu.

Ou poderia ser culpa minha? Estou processando lotes de 18 chamadas assíncronas de três nomes de domínio diferentes, gerando páginas HTML que são minimizadas, pré-compactadas e enviadas para outros servidores. A CPU gira em torno de 80% com isso. Será que estou sobrecarregando o Apache? Estamos lidando com cerca de 5.000 páginas.

utilização do CPU

Do meu arquivo httpd-default.conf

Timeout 300
KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 40

# reqtimeout module is disabled
#<IfModule reqtimeout_module>
#  RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
#</IfModule>

Estes são os diferentes sintomas do navegador que observo:

Conexão inicial/SSL do Chrome Timing

... e o que li quando a conexão está interrompida:

(sem informações)

Tempo do Chrome


Cachoeira Microsoft Edge

... e o que li quando a conexão está interrompida:

Estabelecendo conexão segura...

Microsoft borda


Tempos do FireFox bloqueados

... e o que li quando a conexão está interrompida:

Executando handshake TLS com (meu nome de subdomínio estático)

ou

Transferindo dados de connect.facebook.net

Tempo do FireFox bloqueado

E descobri que às vezes o tempo de bloqueio é quase tão longo quanto o tempo de configuração do TLS:

Tempo de configuração do TLS


Minha configuração

Servidor: Apache/2.4.39 (Win64) OpenSSL/1.1.1c PHP/8.1.10, tenho 48 GB de RAM disponíveis e a CPU é um i7-8700 a 3,20 GHz.

Meu DNS TTL está definido para 3 horas, pois estou prestes a realocar arquivos em servidores diferentes.

Meu arquivo httpd-ssl.conf

SSLSessionCacheTimeout  300
SSLUseStapling Off
HostnameLookups Off
EnableSendfile Off 
EnableMMAP Off

<VirtualHost *:443>
    Protocols h2 h2c http/1.1
    ...
    SSLEngine on
    ...
    SSLHonorCipherOrder on
    SSLProtocol ALL -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 
    SSLCipherSuite ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:ECDH+AES256:DH+AES256:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
</VirtualHost>

Tentei configurar <VirtualHost *:443>para <VirtualHost 0.0.0.0:443>(estou usando apenas IPv4), mas não ajudou.

Desliguei meu Firewall para ver se é relacionado ao Firewall, não é.

executando isso

openssl s_client -connect www.filmfix.com:443 -status -servername www.filmfix.com

retorna isso

CONNECTED(000001B8)
depth=2 C = US, O = Internet Security Research Group, CN = ISRG Root X1
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=1 C = US, O = Let's Encrypt, CN = R3
verify return:1
depth=0 CN = *.my_domainname_dot_com
verify return:1
OCSP response: no response sent
---
Certificate chain
 0 s:CN = *.my_domainname_dot_com
   i:C = US, O = Let's Encrypt, CN = R3
 1 s:C = US, O = Let's Encrypt, CN = R3
   i:C = US, O = Internet Security Research Group, CN = ISRG Root X1
 2 s:C = US, O = Internet Security Research Group, CN = ISRG Root X1
   i:O = Digital Signature Trust Co., CN = DST Root CA X3
---
Server certificate
-----BEGIN CERTIFICATE-----
  ...
-----END CERTIFICATE-----
subject=CN = *.my_domainname_dot_com

issuer=C = US, O = Let's Encrypt, CN = R3

---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 5026 bytes and written 406 bytes
Verification error: unable to get local issuer certificate
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 4096 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 20 (unable to get local issuer certificate)
---
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
    Protocol  : TLSv1.3
    Cipher    : TLS_AES_256_GCM_SHA384
    Session-ID: 3D6884662...
    Session-ID-ctx:
    Resumption PSK: 5EA6E2B7D...
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 ... 3i.

    Start Time: 1691621025
    Timeout   : 7200 (sec)
    Verify return code: 20 (unable to get local issuer certificate)
    Extended master secret: no
    Max Early Data: 0
---
read R BLOCK
---
Post-Handshake New Session Ticket arrived:
SSL-Session:
    Protocol  : TLSv1.3
    Cipher    : TLS_AES_256_GCM_SHA384
    Session-ID: 9BFE3...
    Session-ID-ctx:
    Resumption PSK: 38FFBF004D...
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 300 (seconds)
    TLS session ticket:
    0000 - a9 01 cb ...   a2 40   ....)..d...!.4.@

    Start Time: 1691621025
    Timeout   : 7200 (sec)
    Verify return code: 20 (unable to get local issuer certificate)
    Extended master secret: no
    Max Early Data: 0
---
read R BLOCK 

httpd -D DUMP_RUN_CFG

C:\64bit\Apache24\bin>httpd -D DUMP_RUN_CFG
ServerRoot: "C:/64bit/Apache24"
Main DocumentRoot: "C:/64bit/htdocs"
Main ErrorLog: "E:/log-files/apache/error_.log"
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="C:/64bit/Apache24/logs/" mechanism=default
PidFile: "C:/64bit/Apache24/logs/httpd.pid"
Define: DUMP_RUN_CFG

qualquer ajuda seria muito bem vinda.

Obrigado.

ssl
  • 1 1 respostas
  • 211 Views

1 respostas

  • Voted
  1. Best Answer
    MeSo2
    2023-08-13T04:20:00+08:002023-08-13T04:20:00+08:00

    Eu estou mantendo meus dedos cruzados.

    I updated Apache -- going from 2.4.39 to 2.4.57.

    In order to do that I had to first make sure Visual C++ Redistributable is updated:

    You must first install the Visual C++ Redistributable for Visual Studio 2015-2022 x64.

    Download and Install, if you have not done so already, see:

    https://www.apachelounge.com/download/

    Running the update I did a repair, followed by updating Apache.

    The website looks and acts a bit different using the same Apache configuration files as before, and hopefully my initial connection speed issue resolved itself.

    I also added default index files

    DirectoryIndex static_html/com___en___home.min.html.br
    

    And if all ends up to work well the update allows me to consider using HTTP/3. ChatGTP suggest:

    As of my last update in September 2021, enabling HTTP/3 support in Apache on Windows requires a bit more manual effort compared to some other platforms due to the lack of precompiled packages. Here's a general guideline on how to install and enable the mod_http3 module for Apache on Windows:

    1. Download Required Software:

      • Download and install Visual Studio Build Tools (https://visualstudio.microsoft.com/visual-cpp-build-tools/).
      • Download and install CMake (https://cmake.org/download/).
      • Download and install OpenSSL (https://slproweb.com/products/Win32OpenSSL.html).
    2. Download and Build libnghttp2:

      • Download the latest stable release of libnghttp2 from https://github.com/nghttp2/nghttp2/releases.
      • Extract the downloaded archive to a directory.
      • Open the "Command Prompt for Visual Studio" from the Start menu.
      • Navigate to the directory where you extracted libnghttp2.
      • Run the following commands to build libnghttp2:
        mkdir build
        cd build
        cmake -G "NMake Makefiles" ..
        nmake
        nmake install
        
    3. Download and Build Apache with HTTP/3 Support:

      • Download the Apache source code from https://httpd.apache.org/download.cgi.
      • Extract the downloaded archive to a directory.
      • Navigate to the srclib directory within the extracted Apache source directory.
      • Clone the quiche repository using Git:
        git clone --recursive https://github.com/cloudflare/quiche
        
      • Rename the quiche directory to quic:
        move quiche quic
        
      • Navigate to the root directory of the Apache source code.
      • Run the following commands to build Apache with HTTP/3 support:
        configure --enable-ssl --enable-http2 --with-openssl=path\to\openssl
        nmake
        
    4. Configure and Enable mod_http3:

      • Once Apache is built, navigate to the modules directory within the Apache source directory.
      • Copy the mod_http3 module file (mod_http3.so) to your Apache modules directory.
      • Open your Apache configuration file (httpd.conf) in a text editor.
      • Add the following lines to enable and configure mod_http3:
        LoadModule http3_module modules/mod_http3.so
        
        # Enable HTTP/3
        <IfModule http3_module>
            AddHttp3Protocol h3-23
        </IfModule>
        
    5. Start Apache with HTTP/3 Support:

      • Start Apache by running httpd.exe from the bin directory of the built Apache.
      • You might need to adjust your firewall settings to allow Apache to listen on the required ports.

    Observe que este processo envolve a construção do Apache e suas dependências a partir do código-fonte, o que pode ser complexo e exigir familiaridade com ferramentas de desenvolvimento de software. Como o software e os procedimentos podem mudar com o tempo, recomendo consultar a documentação oficial do Apache e quaisquer recursos on-line relevantes para obter instruções e orientações mais atualizadas.

    • 1

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

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

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve