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
    • 最新
    • 标签
主页 / server / 问题 / 768823
Accepted
Janning
Janning
Asked: 2016-04-08 07:11:19 +0800 CST2016-04-08 07:11:19 +0800 CST 2016-04-08 07:11:19 +0800 CST

Nginx 与 http2 和 ios WKWebView

  • 772

我们在 debian 系统上运行 nginx 作为负载均衡器

nginx version: nginx/1.9.10
built with OpenSSL 1.0.2e 3 Dec 2015 (running with OpenSSL 1.0.2g  1 Mar 2016)

我们在服务器中激活了 http2,如下所示:

server {
   listen 443 ssl http2;
   ....
}

所有请求都代理到我们的应用程序服务器。我们正在从 nginx记录request_time和。upstream_time

我们最近在第 13 周将我们的 iOS 混合应用从 UIWebView 切换到了 WKWebView,看看发生了什么:

在此处输入图像描述

upstream_time 保持不变,但随着越来越多的用户将他们的应用程序更新到新版本,我们的请求时间突然增加。

今天我们决定试一试并停用http2。我们只从服务器配置中删除了“http2”这个词:

server {
   listen 443 ssl;
   ....
}

看看发生了什么:

在此处输入图像描述

似乎 http2 还没有准备好生产。我不知道它是服务器端还是客户端。也许甚至 request_time 也没有在 nginx 中正确记录。

有人有更多关于在 nginx 和/或 WKWebView 中使用 http2 的信息吗?

nginx
  • 3 3 个回答
  • 933 Views

3 个回答

  • Voted
  1. Best Answer
    Anubioz
    2016-08-15T01:29:02+08:002016-08-15T01:29:02+08:00

    研究表明Ubuntu/Debian nginx 软件包中存在导致 http2 性能低下的错误,您需要使用替代发行版/自己从源代码编译 nginx(这真的很容易,大约需要 5 分钟的时间)。

    对于 debian,您可能必须将该构建指南中的配置行替换为以下内容:

     ./configure --with-cc-opt='-march=native -O2 -pipe' --prefix=/usr --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-pcre-jit --with-ipv6 --with-file-aio --with-ipv6 --with-http_v2_module --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module -with-http_v2_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --user=www-data --group=www-data --with-openssl=../openssl-1.0.2h --add-module=../nginx-http-auth-digest --add-module=../ngx_cache_purge --add-module=../ngx_pagespeed-release-1.11.33.2-beta
    

    或者只是使用互联网上的任何最新指南。它必须使用 OpenSSL 1.0.2h 或更高版本进行构建,或者它不够新。这是应该做的: https ://ethitter.com/2016/06/nginx-openssl-1-0-2-http-2-alpn/

    • 3
  2. VBart
    2016-08-15T01:08:26+08:002016-08-15T01:08:26+08:00

    HTTP/2 的平均响应时间预计会更长,因为由于另一层多路复用,它具有更大的开销。

    • 0
  3. Ryan R Sundberg
    2016-06-16T13:02:58+08:002016-06-16T13:02:58+08:00

    IETF 团队在此处跟踪客户端和服务器支持:https ://github.com/http2/http2-spec/wiki/Implementations

    WKWebView 尚未标记为受支持。不过,它在其他移动浏览器上运行良好。

    • -1

相关问题

  • Gzip 与反向代理缓存

  • nginx 作为代理的行为

  • Nginx 学习资源 [关闭]

  • 提供 70,000 个静态文件 (jpg) 的最佳方式?

  • 在 Apache、LightTPD 和 Nginx Web 服务器上提供 PHP 5.x 应用程序的现状?

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