v2ray / v2ray-core

A platform for building proxies to bypass network restrictions.
https://www.v2ray.com/
MIT License
45.29k stars 8.94k forks source link

cpu负载过高 #694

Closed RoFatNya closed 6 years ago

RoFatNya commented 6 years ago

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。 Please read the instruction and answer the following questions before submitting your issue. Thank you.

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明) What version of V2Ray are you using (If you deploy different version on server and client, please explicitly point out)? 2.46 2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。 What's your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy. PC中使用v2rayN与手机v2rayNG 3) 你看到的不正常的现象是什么? What did you see? cpu没过多久之后就会满载 4) 你期待看到的正确表现是怎样的? What's your expectation?

5) 请附上你的配置文件(提交 Issue 前请隐藏服务器端IP地址)。 Please attach your configuration file (Mask IP addresses before submit this issue).

Server Configuration File(服务器端配置文件):
    // 在这里附上服务器端配置文件
    // Please attach your server configuration file here.
    {
        "log": {
            "access": "/var/log/v2ray/access.log",
            "error": "/var/log/v2ray/error.log",
            "loglevel": "warning"
        },
        "routing": {
            "strategy": "rules",
            "settings": {
                "rules": [{
                        "type": "field",
                        "ip": [
                            "0.0.0.0/8",
                            "10.0.0.0/8",
                            "100.64.0.0/10",
                            "127.0.0.0/8",
                            "169.254.0.0/16",
                            "172.16.0.0/12",
                            "192.0.0.0/24",
                            "192.0.2.0/24",
                            "192.168.0.0/16",
                            "198.18.0.0/15",
                            "198.51.100.0/24",
                            "203.0.113.0/24",
                            "::1/128",
                            "fc00::/7",
                            "fe80::/10"
                        ],
                        "outboundTag": "blocked"
                    }
                ]
            }
        },
        "inbound": {
            "port": 840,
            "protocol": "vmess",
            "tag": "vmess-tcp-inbound",
            "settings": {
                "clients": [{
                        "id": "aaa",
                        "level": 1,
                        "alterId": 100,
                        "email": "aaaa"
                    }, {
                        "id": "bbb",
                        "level": 1,
                        "alterId": 64,
                        "email": "bbbb"
                    }, {
                        "id": "ccc",
                        "level": 1,
                        "alterId": 100,
                        "email": "cccc"
                    }
                ],
                "detour": {
                    "to": "vmess-tcp-detour"
                }
            },
            "streamSettings": {
                "network": "tcp"
            }
        },
        "inboundDetour": [{
                "port": 850,
                "protocol": "vmess",
                "tag": "vmess-kcp-inbound",
                "settings": {
                    "clients": [{
                            "id": "aaa",
                            "level": 1,
                            "alterId": 100,
                            "email": "aaaa"
                        }, {
                            "id": "bbb",
                            "level": 1,
                            "alterId": 64,
                            "email": "bbbb"
                        }
                    ],
                    "detour": {
                        "to": "direct"
                    }
                },
                "streamSettings": {
                    "network": "kcp"
                }
            }, {
                "port": "801-810",
                "protocol": "vmess",
                "tag": "vmess-tcp-detour",
                "allocate": {
                    "strategy": "random",
                    "refresh": 5,
                    "concurrency": 5
                },
                "settings": {},
                "streamSettings": {
                    "network": "tcp"
                }
            }
        ],
        "outbound": {
            "protocol": "freedom",
            "settings": {},
            "mux": {
                "enable": true
            }
        },
        "outboundDetour": [{
                "protocol": "blackhole",
                "settings": {},
                "tag": "blocked"
            }, {
                "protocol": "freedom",
                "settings": {},
                "tag": "direct",
                "mux": {
                    "enable": true
                }
            }
        ],
        "transport": {
            "tcpSettings": {
                "connectionReuse": true,
                "header": {
                    "type": "none"
                }
            },
            "kcpSettings": {
                "mtu": 1350,
                "tti": 50,
                "uplinkCapacity": 80,
                "downlinkCapacity": 130,
                "congestion": true,
                "readBufferSize": 1,
                "writeBufferSize": 1,
                "header": {
                    "type": "none"
                }
            }
        }
    }
Client Configuration File(客户端配置文件):
    // 在这里附上客户端配置文件
    // Please attach your client configuration file here.
    {
        "log": {
            "access": "",
            "error": "",
            "loglevel": ""
        },
        "inbound": {
            "port": 1080,
            "listen": "0.0.0.0",
            "protocol": "http",
            "settings": {
                "auth": "noauth",
                "udp": false,
                "ip": "127.0.0.1",
                "clients": null
            },
            "streamSettings": null
        },
        "outbound": {
            "tag": "agentout",
            "protocol": "vmess",
            "settings": {
                "vnext": [{
                        "address": "vps",
                        "port": 840,
                        "users": [{
                                "id": "aaa",
                                "alterId": 100,
                                "security": "aes-128-gcm"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "tcp",
                "security": "",
                "tcpSettings": null,
                "kcpSettings": null,
                "wsSettings": null
            },
            "mux": {
                "enabled": true
            }
        },
        "inboundDetour": null,
        "outboundDetour": [{
                "protocol": "freedom",
                "settings": {
                    "response": null
                },
                "tag": "direct"
            }, {
                "protocol": "blackhole",
                "settings": {
                    "response": {
                        "type": "http"
                    }
                },
                "tag": "blockout"
            }
        ],
        "dns": {
            "servers": [
                "8.8.8.8",
                "8.8.4.4",
                "localhost"
            ]
        },
        "routing": {
            "strategy": "rules",
            "settings": {
                "domainStrategy": "IPIfNonMatch",
                "rules": [{
                        "type": "field",
                        "port": null,
                        "outboundTag": "direct",
                        "ip": [
                            "0.0.0.0/8",
                            "10.0.0.0/8",
                            "100.64.0.0/10",
                            "127.0.0.0/8",
                            "169.254.0.0/16",
                            "172.16.0.0/12",
                            "192.0.0.0/24",
                            "192.0.2.0/24",
                            "192.168.0.0/16",
                            "198.18.0.0/15",
                            "198.51.100.0/24",
                            "203.0.113.0/24",
                            "::1/128",
                            "fc00::/7",
                            "fe80::/10"
                        ],
                        "domain": null
                    }, {
                        "type": "field",
                        "port": null,
                        "outboundTag": "direct",
                        "domain": null
                    }
                ]
            }
        }
    }

6) 请附上出错时软件输出的日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。 Please attach the log file, especially the bottom lines if the file is large. Log file is usually /var/log/v2ray/error.log on Linux.

Server Log File(服务器端日志):
    // 在这里附上服务器端日志
    // Please attach your server log here.
Client Log File(客户端日志):
    // 在这里附上客户端日志
    // Please attach your client log here.

服务器一直都是没过多久cpu就卡到99左右,这个是什么问题呢?

RoFatNya commented 6 years ago

我把传出链接之前换成了direct走freedom就不存在这个问题,但是速度好像变慢了的样子 USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
root 20 0 33928 26456 3792 S 99.0 2.6 1:22.60 v2ray

DarienRaymond commented 6 years ago

CPU 100%是因为你的动态端口不够多,推荐端口范围是concurrency的三倍以上

RoFatNya commented 6 years ago

行,我去试试如果没问题的话我就把issue关了