From 734819342 at qq.com Mon Sep 11 08:24:00 2017 From: 734819342 at qq.com (734819342 at qq.com) Date: Mon, 11 Sep 2017 16:24:00 +0800 Subject: what "nxt_port_s" means Message-ID: <201709111623594818285@qq.com>+B4E16B9E4F59E9A5 Hello: Could anyone help me figure out what "nxt_port_s" standing for ? How can it be used in rpc? And why port? Thanks. 734819342 at qq.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Mon Sep 11 08:56:00 2017 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 11 Sep 2017 11:56:00 +0300 Subject: what "nxt_port_s" means In-Reply-To: <201709111623594818285@qq.com>+B4E16B9E4F59E9A5 References: <201709111623594818285@qq.com>+B4E16B9E4F59E9A5 Message-ID: <33F6FCFB-7F4F-44B1-8F5C-790A875AE8F2@sysoev.ru> On 11 Sep 2017, at 11:24, 734819342 at qq.com wrote: > Could anyone help me figure out what "nxt_port_s" standing for ? How can it be used in rpc? And why port? The port is abstraction over Unix domain socket pair used for communication between unit processes. And yes, it can be used fro RPC between unit processes. -- Igor Sysoev http://nginx.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From 734819342 at qq.com Mon Sep 11 12:33:11 2017 From: 734819342 at qq.com (734819342 at qq.com) Date: Mon, 11 Sep 2017 20:33:11 +0800 Subject: processes in unitd Message-ID: <201709112033108630799@qq.com>+B28BFCE32E98E127 Hello: As look into source code, I found it's easy to get what main, controller, router, app do. But i'm wondering what worker, discovery for ? or what it would do. 734819342 at qq.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From igor at sysoev.ru Mon Sep 11 14:55:22 2017 From: igor at sysoev.ru (Igor Sysoev) Date: Mon, 11 Sep 2017 17:55:22 +0300 Subject: processes in unitd In-Reply-To: <201709112033108630799@qq.com>+B28BFCE32E98E127 References: <201709112033108630799@qq.com>+B28BFCE32E98E127 Message-ID: <3CE62841-5C75-46FE-A4AF-B0F56F9E9950@sysoev.ru> On 11 Sep 2017, at 15:33, 734819342 at qq.com wrote: > Hello: > > As look into source code, I found it's easy to get what main, controller, router, app do. But i'm wondering what worker, discovery for ? or what it would do. A worker is the same as an application process. It will be uniformed soon. The discovery process is used on start only, it examines application modules: it loads a module, tests the module's information, and then unloads it. -- Igor Sysoev http://nginx.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From 734819342 at qq.com Mon Sep 11 15:43:21 2017 From: 734819342 at qq.com (734819342 at qq.com) Date: Mon, 11 Sep 2017 23:43:21 +0800 Subject: processes in unitd References: <201709112033108630799@qq.com>+B28BFCE32E98E127, <3CE62841-5C75-46FE-A4AF-B0F56F9E9950@sysoev.ru> Message-ID: <201709112343207606243@qq.com>+764F586D0838553C Got it . Thanks. binnn From: Igor Sysoev Date: 2017-09-11 22:55 To: unit Subject: Re: processes in unitd On 11 Sep 2017, at 15:33, 734819342 at qq.com wrote: Hello: As look into source code, I found it's easy to get what main, controller, router, app do. But i'm wondering what worker, discovery for ? or what it would do. A worker is the same as an application process. It will be uniformed soon. The discovery process is used on start only, it examines application modules: it loads a module, tests the module's information, and then unloads it. -- Igor Sysoev http://nginx.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghartz at gehtz.com Tue Sep 12 19:58:51 2017 From: ghartz at gehtz.com (Geoffrey Hartz) Date: Tue, 12 Sep 2017 19:58:51 +0000 Subject: Workers and load balacning Message-ID: Hi all! while testing unit I noticed that for a little project in python (based on Django) the load balacing between workers are unexpected when setting "workers" > 1 I load benchmark with "wrk" and the following happens: - the very first seconds I see all workers reaching 30-40% of CPU usage - right after only one worker is at 100% CPU usage and the other ones are iddle The overall performance is equivalent to 1 CPU core. For example with nginx starting with version 1.9.1 the feature "REUSE_PORT" is available to load balance between workers, why not using this for Unit too? Regards, Geoffrey -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Tue Sep 12 20:34:04 2017 From: vbart at nginx.com (Valentin V. Bartenev) Date: Tue, 12 Sep 2017 23:34:04 +0300 Subject: Workers and load balacning In-Reply-To: References: Message-ID: <1614744.N8lbKGhZPs@vbart-laptop> On ???????, 12 ???????? 2017 ?. 22:58:51 MSK Geoffrey Hartz wrote: > Hi all! > > while testing unit I noticed that for a little project in python (based on > Django) the load balacing between workers are unexpected when setting > "workers" > 1 > > I load benchmark with "wrk" and the following happens: > - the very first seconds I see all workers reaching 30-40% of CPU usage > - right after only one worker is at 100% CPU usage and the other ones are > iddle > > The overall performance is equivalent to 1 CPU core. > > For example with nginx starting with version 1.9.1 the feature "REUSE_PORT" > is available to load balance between workers, why not using this for Unit > too? > Unit has a way more complex architecture than nginx. Application worker processes don't accept connections at all. They get requests from the router process using shared memory IPC and return responses back. The router process uses a number of asynchronous threads to accept connections (one per core). It most likely that you have experienced a bug. wbr, Valentin V. Bartenev From 734819342 at qq.com Sat Sep 30 08:38:14 2017 From: 734819342 at qq.com (734819342 at qq.com) Date: Sat, 30 Sep 2017 16:38:14 +0800 Subject: work queues in event engine References: <201709112033108630799@qq.com> Message-ID: <201709301629595499963@qq.com>+1C4004FE4474E5BA Hello: Why there are many work queues in event engine? And what for respectively? nxt_work_queue_cache_t work_queue_cache; nxt_work_queue_t *current_work_queue; nxt_work_queue_t fast_work_queue; nxt_work_queue_t accept_work_queue; nxt_work_queue_t read_work_queue; nxt_work_queue_t socket_work_queue; nxt_work_queue_t connect_work_queue; nxt_work_queue_t write_work_queue; nxt_work_queue_t shutdown_work_queue; nxt_work_queue_t close_work_queue; nxt_locked_work_queue_t locked_work_queue; binnn -------------- next part -------------- An HTML attachment was scrubbed... URL: