From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1757229499; bh=lO5HlDkYKLbrRmdCmpKRFrcZBDGSIg8kPhEPyvma06U=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=VR1WhYZ5/uP3BEfflngzJVLVH/iD1DWs4bWmkDfSeuAXp0ZpymJEKJuEwxnZBZj4N oWARgxvCaNZydDj6ezp68tAtAQHpPXiyUX7OkfCs+SGczyefkhkvGh4ixWkTfWvu/4 OxCegSsyzTqmhUnIQvy5SUZLj3YuX5c4zUL2u1ZXZjq5B6ViEXVFjOtWLKPDpmXUZw 8c7Nt877EYeZnqYumtMTGm0I+eCRxT39t3A2MZoBL0dZNdHAuXeK4mrhus+yWr782M Tfv4/IVqeILFAagwVKpf+GYqpmg9fQ8PxXhdR3Jm/uw/yGiSlxXWBAnyZonN9SIDn/ WZFBnHIUMJ5jQ== Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id DC58A3127930 for ; Sun, 7 Sep 2025 07:18:19 +0000 (UTC) Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-336af6356a5so27071481fa.3 for ; Sun, 07 Sep 2025 00:18:19 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXQe9C6+3koRTJ/gAVz8KjQshcWZyuSw2yz0P4P6L7zUQMQnTTSH2tLmR32rTnAxHeUcdRV@vger.gnuweeb.org X-Gm-Message-State: AOJu0YyoefXtd+PeA9MnPgQP9opgjDRUhfA4V4bFuZZmevt8UND/gTEf EqNr9SGSPpRVmv8AfHPSuN9FcgkNsK652tlk3ufyebtBCwdh8uKmKCpgtwgX3TFXTFDL2SARL6y H4nAEpzip0lR8qsO/v4vmiKDmjK6kc1M= X-Google-Smtp-Source: AGHT+IHnTUixQFuiaO0zvk8Ch4AmOo9NplcBlqpbVnqnef0kMuTVn8v8yEQPIQ8r2Rw7B/Lae8F8z6ymsOvfO6ghHNY= X-Received: by 2002:a2e:a58c:0:b0:337:e4cd:b2df with SMTP id 38308e7fff4ca-33b54ee8c76mr12021481fa.20.1757229499250; Sun, 07 Sep 2025 00:18:19 -0700 (PDT) MIME-Version: 1.0 References: <20250829075557.598176-1-reyuki@gnuweeb.org> <20250829075557.598176-3-reyuki@gnuweeb.org> <20250907070613.GC3438918-ammarfaizi2@gnuweeb.org> In-Reply-To: <20250907070613.GC3438918-ammarfaizi2@gnuweeb.org> From: Ahmad Gani Date: Sun, 7 Sep 2025 14:17:42 +0700 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXz58H1TdCR8XJXZwEYQkDFb9QD8QtBnNiMUGQu9GLCbRkj1RDhe6RsmYIo Message-ID: Subject: Re: [PATCH gwproxy v8 2/2] gwproxy: refactor code base to add experimental raw DNS backend To: Ammar Faizi Cc: Alviro Iskandar Setiawan , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: On Sun, Sep 7, 2025 at 2:06=E2=80=AFPM Ammar Faizi wrote: > On Sun, Sep 07, 2025 at 01:39:05PM +0700, Ahmad Gani wrote: > > I think 65536 is a pretty low memory footprint in modern systems; as Si= r > > Alviro noted, it's around 0.25 or 0.5 MB. > > > > Maybe it's more beneficial to allocate at once in the stack rather than > > add instructions for growing/shrinking the allocated memory? > > Yes, it's small. But I prefer to save the space for it. The memory > saving is very beneficial for a small Linux device like Raspberry Pi, > 4G modems, or even your lovely home routers. Unfortunately I can't install gwproxy on my lovely fiberhome HG6243C router= s :( > Also, when you have 65536 clients in a single thread, that doesn't > necessarily mean your DNS mapping are fully used from index 0 to 65535. > A DNS query is a short-lived object. You only need to keep it until the > DNS query receives a response. > > Having 65536 outstanding DNS queries is very unlikely even with 100K > concurrent connections. Especially given the cache feature, you will > skip the DNS resolution if identical names are accessed very often. I > believe allocating it lazily is a good way for this design. > > If the initial size, 16, feels too low for you. You may consider adding > an option to customize the initial size via CLI args. Fair enough, I will try to adopt this proposal as well. Thanks for the idea= ! -- Ahmad Gani