soketi / soketi

Next-gen, Pusher-compatible, open-source WebSockets server. Simple, fast, and resilient. 📣
https://soketi.app/
GNU Affero General Public License v3.0
4.74k stars 258 forks source link

[BUG] error stopped soketi in large number coneccion and High CPU usage #1181

Open rawezhcode opened 2 months ago

rawezhcode commented 2 months ago

Description When the number of connections exceeds > 1000, the CPU increases at a strange rate and causes it to stop and restart. On an VPS ( 8core, 16GB RAM ) there is this problem

Screenshots If applicable, add screenshots to help explain your problem.

SCR-20240515-kukq SCR-20240515-kwaz ulimit -a : image

Environment

Configuration Run the server with SOKETI_DEBUG=1 and paste the nested object configuration that outputs:

{
    {
    "debug": false,
    "host": "0.0.0.0",
    "port": 6001,
    "metrics.enabled": false,
    "metrics.host": "0.0.0.0",
    "metrics.port": 9601,
    "webhooks.batching.enabled": true,
    "cache.driver": "redis",
    "queue.driver": "redis",
    "rateLimiter.driver": "redis",
    "appManager.driver": "mysql",
    "appManager.mysql.table": "applications",
    "appManager.cache.enabled": "true",
    "appManager.cache.ttl": 3600,
    "databasePooling.enabled": true,
    "database": {
        "mysql": {
            "host": "127.0.0.1",
            "port": "3306",
            "user": "appManage",
            "password": "6qBGJgyuCOHP",
            "database": "soketi_app_manager"
        },
        "redis": {
            "host": "127.0.0.1",
            "port": 6379,
            "db": 0,
            "username": null,
            "password": null,
            "keyPrefix": "soketi_",
            "sentinels": null,
            "sentinelPassword": null,
            "name": "mymaster",
            "clusterNodes": []
        }
    }
}

}
[program:socket_laravel]
process_name=%(program_name)s_%(process_num)02d
directory=/var/www/rawezhcode__usr/data/www/xxxxxx.xxx/soketimanager
command=soketi start --config=soketi.json
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=rawezhcode__usr
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/rawezhcode__usr/data/www/xxxxxx.xxx/soketimanager/soketi-supervisor.log
stopwaitsecs=60
stopsignal=sigint
minfds=10000

Additional context Add any other context about the problem here.

nw18rishabhjain commented 3 weeks ago

Yeah facing the same issue. Not able to move beyond 2K users on a single pod in GKE (using weave CNI in place of redis).