Welcome! Log In Create A New Profile

Advanced

[njs] Modules: removed extra VMs creation when it is not needed.

Anonymous User
October 14, 2024 07:54PM
details: https://github.com/nginx/njs/commit/685b64f0326ac63a1deda3c9bdad61ad521990a7
branches: master
commit: 685b64f0326ac63a1deda3c9bdad61ad521990a7
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Fri, 11 Oct 2024 17:23:42 -0700
description:
Modules: removed extra VMs creation when it is not needed.

Previously, a new VM instance was created for every location. This is
not needed and consumes a lot of memory for large configurations.
Instead, if no new js_import is introduced on the location level server
level VM should be used.

The issue was introduced in 9b674412 (0.8.6).

This fixes #795 issue on Github.

---
nginx/ngx_js.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nginx/ngx_js.c b/nginx/ngx_js.c
index 98e48dc2..152045f0 100644
--- a/nginx/ngx_js.c
+++ b/nginx/ngx_js.c
@@ -3360,7 +3360,7 @@ ngx_js_merge_vm(ngx_conf_t *cf, ngx_js_loc_conf_t *conf,
ngx_js_named_path_t *import, *pi, *pij, *preload;

if (conf->imports == NGX_CONF_UNSET_PTR
- && conf->type == NGX_CONF_UNSET_UINT
+ && conf->type == prev->type
&& conf->paths == NGX_CONF_UNSET_PTR
&& conf->preload_objects == NGX_CONF_UNSET_PTR)
{
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Modules: removed extra VMs creation when it is not needed.

Anonymous User 167 October 14, 2024 07:54PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 253
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready