zoukankan      html  css  js  c++  java
  • 016_nginx运维问题总结

    一、关于nginx请求包过大的解决思路

    message-api.jyall.me.conf
    nginx报错问题问题定位,经分析跟接入navigator后关联不大,可参考一下结论连接超时抓包分析了一下每次请求过来的数据过大,需要在location增加以下参数upstream timed out (110: Connection timed out)
    proxy_connect_timeout
    proxy_read_timeout
    proxy_send_timeout
    upstream请求连接方式,目前是短连接可配置keepalive保持连接资源复用增加keepalive 参数对比
    [root@xyz-proxy-12 ~]# netstat -na |grep :8856 | wc -l
    7547
    增加keepalive后
    [root@xyz-proxy-12 ~]# netstat -na |grep :8856 | wc -l
    767
    过早断开连接这个问题,跟业务场景有关系,如果对业务没有影响可忽略upstream prematurely closed connection

    二、proxy_pass、set和rewrite的相互影响。

    正常的用户请求: https://www.jyall.me/feedback-webapi/quality_control/statistics

    最好的配置是这样滴=>

    为了支持动态upstream,现在改成这样了

    但是后端的upstream都是没有变的。

    但是原来的请求变成这样了,一直404

    nginx的日志:/feedback-webapi/quality_control/statistics-----10.0.32.153 - - [14/Sep/2017:20:18:14 +0800] "GET /feedback-webapi/quality_control/statistics HTTP/1.1" 200 48 "-" "curl/7.43.0" 0.006 - - - - - - - - application/json;charset=UTF-8 4341360345404689BDA29A906BA77F47 www.jyall.me - 0.006 10.20.96.148:8060 -

    后端upstream的日志: - 10.0.38.160 - - [14/Sep/2017:20:03:32 +0800] "GET /quality-web-svr/feedback-webapi/ HTTP/1.0" 404 992

    -------------------------------------------------------------------------------------------------------------

    这种的后端的原始请求的nginx设置是ok的,如下:

    这个可能set和proxy改写路径有关系,但是set是生效的

    于是,添加了一条rewrite语句"rewrite /feedback-webapi/(.*)  /quality-web-svr/feedback-webapi/$1 break;"

    然后正常的用户请求 https://www.jyall.me/feedback-webapi/quality_control/statistics就可以了。

    三、

     

  • 相关阅读:
    Software Solutions CACHE COHERENCE AND THE MESI PROTOCOL
    CACHE COHERENCE AND THE MESI PROTOCOL
    Multiprocessor Operating System Design Considerations SYMMETRIC MULTIPROCESSORS
    Organization SYMMETRIC MULTIPROCESSORS
    PARALLEL PROCESSING
    1分钟内发送差评邮件
    Secure Digital
    SYMMETRIC MULTIPROCESSORS
    A Taxonomy of Parallel Processor Architectures
    parallelism
  • 原文地址:https://www.cnblogs.com/itcomputer/p/7498962.html
Copyright © 2011-2022 走看看