-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
VNSWRR reduces memory usage with GCD #1668
Conversation
|
We are best to move the logic of caculating g, ngx_http_upstream_gcd function () and definition of g variable into modules/ngx_http_upstream_vnswrr_module/*.[c or h]. Otherwise you will added too many T_NGX_XXXX macro into nginx core to include your code, which is hard to maintain. Caculating g may be here as following :
|
Thanks, I will fix that :) |
Hello @chobits , I tried to move this calculation logic, but I found it difficult, because of the same control flow I have to make a new copy (guard statement, filter condition, etc.), and |
gcd can be calculted firstly as a local variable in ngx_http_upstream_init_vnswrr. |
Hello @chobits , this has been fixed. But when I try to test my submit, I get this error
I'm new to perl, so I don't know how to fix it, could you help me? |
added as following:
|
modules/ngx_http_upstream_vnswrr_module/ngx_http_upstream_vnswrr_module.c
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
Hello, @chobits . I carefully read the README, and repeatedly confirmed to configure, compile and install according to the installation chapters. But when I use gdb to debug, it always prompts me that the corresponding functions and symbols cannot be found. Later, I checked the generated object and found that the When I searched for I think there should be a corresponding prompt or accessible Contribute documentation in the README to tell newbies that they need to add configuration options to compile their own modified modules (and the default Now my modification can be tested normally, thanks :) |
with updated my changes. cases passed
|
Hello, @wangfakang. I refactored my code to make calculating gcd and backup gcd in single loop, PLAT. |
If no other changes, you need to squash all commits into one. Then merged commit log will be clean. (may git rebase -i .. && git push --force ) |
Hello, @chobits. All commits in this PR have already been squashed, PLAT |
merged. ty for ur contribution! |
#1667