zoukankan      html  css  js  c++  java
  • web服务优化

    1、http远程请求报错

    Caused by: java.net.ConnectException: Cannot assign requested address (connect failed)
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
            at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
            at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
            at java.net.Socket.connect(Socket.java:589)
            at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
            at sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
            at sun.net.www.http.HttpClient.New(HttpClient.java:339)
            at sun.net.www.http.HttpClient.New(HttpClient.java:357)
            at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1220)
            at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1156)
            at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
            at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:984)
            at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
            at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
            at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
            at feign.Client$Default.convertResponse(Client.java:152)
            at feign.Client$Default.execute(Client.java:74)

    内核参数修改:

    sysctl -w net.ipv4.tcp_timestamps=1  开启对于TCP时间戳的支持,若该项设置为0,则下面一项设置不起作用
    sysctl -w net.ipv4.tcp_tw_recycle=1  表示开启TCP连接中TIME-WAIT sockets的快速回收
  • 相关阅读:
    难找的对象
    欺负10086客服小姐(超搞笑)
    左手,请握紧你的右手!
    Discuz! 6.x/7.x EXP
    【超搞视频】  另类乞讨让你笑掉大牙 !
    GNU/Linux平台的C程序开发及程序运行环境
    SICK LMS200激光数据采集程序说明
    郭云深划分武学境界
    Discuz XSS得webshell
    200条装修小常识(结婚,不结婚的都要看一下,很有用的)
  • 原文地址:https://www.cnblogs.com/duanxz/p/10731258.html
Copyright © 2011-2022 走看看