unit icon indicating copy to clipboard operation
unit copied to clipboard

How to manually set the number of router threads

Open pbromb opened this issue 2 years ago • 1 comments

Hello, I am running an application using Nginx Unit in Kubernetes environment. The unit: router process automatically runs in the number of threads, which equals the number of CPU cores on the physical server.

src/nxt_router.c

if (rtcf->threads == 0) {
    rtcf->threads = nxt_ncpu;
}

in the code I also found

src/nxt_router.c

static nxt_conf_map_t  nxt_router_conf[] = {
    {
        nxt_string("listeners_threads"),
        NXT_CONF_MAP_INT32,
        offsetof(nxt_router_conf_t, threads),
    },
};

but I was not able to set this from the configuration file

Is it possible to set this value ?

pbromb avatar Dec 30 '23 14:12 pbromb

On Sat, 30 Dec 2023 06:46:06 -0800 Paweł B @.***> wrote:

Hello, I am running an application using Nginx Unit in Kubernetes environment. The unit: router process automatically runs in the number of threads, which equals the number of CPU cores on the physical server.

src/nxt_router.c

if (rtcf->threads == 0) {
    rtcf->threads = nxt_ncpu;
}

in the code I also found

src/nxt_router.c

static nxt_conf_map_t  nxt_router_conf[] = {
    {
        nxt_string("listeners_threads"),
        NXT_CONF_MAP_INT32,
        offsetof(nxt_router_conf_t, threads),
    },
};

but I was not able to set this from the configuration file

Is it possible to set this value ?

Looks like it isn't currently hooked up to the configuration system...

ac000 avatar Jan 03 '24 16:01 ac000