Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excessive usage of cpu #68

Open
meower1 opened this issue Aug 18, 2024 · 8 comments
Open

Excessive usage of cpu #68

meower1 opened this issue Aug 18, 2024 · 8 comments

Comments

@meower1
Copy link

meower1 commented Aug 18, 2024

Hi, so i've setup the project on my private server with the following specs

OS: Ubuntu 22.04.4 LTS x86_64
CPU: AMD Ryzen 9 7950X3D (2) @ 4.191GHz
Memory: 2133MiB / 5890MiB ddr5

and snidust seems to be consuming an unreasonable amount of resources specially cpu. it happens after a period of time has passed which im unsure of.

heres the output of docker stats

8b55bbbe447b   sniDust            160.70%   14.34MiB / 5.752GiB   0.24%     22.2GB / 22.1GB   28.6MB / 21.7MB   25

there is currently no user on the dns server other than myself

output of docker logs snidust

[INFO] [SniDust] Adding domain yallo.tv to list
[INFO] [SniDust] *** End of Domain List ***
[INFO] [SniDust] *** Complete! ***
Added downstream server 8.8.8.8:853
Added downstream server 8.8.4.4:853
Added downstream server 1.1.1.1:443
Added downstream server 1.0.0.1:443
Listening on 0.0.0.0:5300
ACL allowing queries from: 0.0.0.0/0
Console ACL allowing connections from: 127.0.0.0/8, ::1/128
Marking downstream cloudflare-dns (1.0.0.1:443) as 'up'
Marking downstream cloudflare-dns (1.1.1.1:443) as 'up'
Marking downstream dns.google (8.8.4.4:853) as 'up'
Marking downstream dns.google (8.8.8.8:853) as 'up'
===================================================================
[INFO] SniDust started => Using server_ip - Point your DNS settings to this address
===================================================================

my docker compose file:

version: '3.8'
services:
    seji64:
        container_name: sniDust
        environment:
            - 'ALLOWED_CLIENTS=0.0.0.0/0'
            - 'EXTERNAL_IP=server_ip'
            - 'SPOOF_ALL_DOMAINS=true' # Set to true (case sensitive!) if you want to spoof ALL domains.

            - TZ=Europe/Berlin
        ports:
            - '443:8443'
            - '80:8080'
            - '53:5300/udp'
            - '53:5300/tcp'
        image: 'ghcr.io/seji64/snidust:main'
        restart: on-failure:5

this has been the case for a while and had happened to me a bunch of time with this project i didn't have the time to report it tho.

thanks for the amazing project tho hoping to see this fixed in the future <3

@meower1 meower1 changed the title Exessive usage of cpu Excessive usage of cpu Aug 18, 2024
@Seji64
Copy link
Owner

Seji64 commented Aug 18, 2024

could you run htop or something to track down the procress?

@meower1
Copy link
Author

meower1 commented Aug 18, 2024

image

this is htop's results filtered to "snidust". the cpu pressure hasn't began yet as i've just started the process and it often starts a few hours after execution

@Seji64
Copy link
Owner

Seji64 commented Aug 21, 2024

okay sorry, instructions were a bit unclear....i meant to run htop or similar inside container when the cpu usage is that high

@meower1
Copy link
Author

meower1 commented Aug 30, 2024

yeah i'll try to replicate the behavior on a spare server

@meower1
Copy link
Author

meower1 commented Sep 7, 2024

image
this is the top results from within the container after about a week of having the container running

image
output of docker stats

image
and this is the top results from the first day i ran the container

image output of `htop` outside of the container on the host machine

so in short the first few days i've ran it i've had no issues with it whatsoever and it ran normally consuming a reasonable amount of resources and it gradually increases the resource usage after a while. restarting the container temporarily solves the issue

Seji64 added a commit that referenced this issue Sep 9, 2024
@Seji64
Copy link
Owner

Seji64 commented Sep 9, 2024

so it seems to be a nginx thing. i applied some changes....(no clue if it helps or make things worse to be honest)

However, i guess if my general use config is not working / scaling for your amout of traffic, you should link your own which optimized for your hardware

Seji64 added a commit that referenced this issue Sep 9, 2024
Seji64 added a commit that referenced this issue Sep 9, 2024
Seji64 added a commit that referenced this issue Sep 9, 2024
Seji64 added a commit that referenced this issue Sep 9, 2024
@meower1
Copy link
Author

meower1 commented Sep 10, 2024

no worries ill test the new update and post the results here.

you should link your own which optimized for your hardware

im not sure i understand could u clarify this

@Seji64
Copy link
Owner

Seji64 commented Sep 10, 2024

i mean for example you need to set the nginx workers from auto to 16

In this case you can just link your own optimized nginx config:

version: '3.3'
services:
    snidust:
        container_name: snidust
        environment:
            - 'ALLOWED_CLIENTS=127.0.0.1, 10.111.123.7'
            - EXTERNAL_IP=10.111.123.8
        ports:
            - '443:8443'
            - '80:8080'
            - '53:5300/udp'
        volumes:
            - '~/mysuperchargednginx.conf:/etc/nginx/nginx.conf:ro
        image: 'ghcr.io/seji64/snidust:1.0.14'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants