Skip to content

optimise dyups module mutex compete#1691

Merged
chobits merged 3 commits into
alibaba:masterfrom
zjd87:dyups_timer_start
Nov 20, 2022
Merged

optimise dyups module mutex compete#1691
chobits merged 3 commits into
alibaba:masterfrom
zjd87:dyups_timer_start

Conversation

@zjd87

@zjd87 zjd87 commented Nov 18, 2022

Copy link
Copy Markdown
Contributor

No description provided.


ngx_add_timer(timer, dmcf->read_msg_timeout);
/*
* when init process, break up timer, in case of shpool->mutex compete

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe in detail the problem you encountered?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if every worker process start timer at the same time, ngx_shmtx_lock (in timer's handler) may mutex compete in all processes , there ere hang in the process of not getting mutex. When break up the start time of timer , avoid mutex compete in all processes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

srandom(seed) has removed

Comment thread modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c Outdated

@zjd87 zjd87 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

srandom(seed) has removed

Comment thread modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c Outdated

ngx_add_timer(timer, dmcf->read_msg_timeout);
/*
* when init process, break up timer, in case of shpool->mutex compete

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

srandom(seed) has removed

Comment thread modules/ngx_http_upstream_dyups_module/ngx_http_dyups_module.c Outdated
@chobits chobits added this to the 2.3.5 milestone Nov 20, 2022
@chobits
chobits self-requested a review November 20, 2022 02:38
@chobits
chobits merged commit c1e9560 into alibaba:master Nov 20, 2022
@chobits

chobits commented Nov 20, 2022

Copy link
Copy Markdown
Member

Thanks, have merged with minor fix on the commit message

@chobits chobits modified the milestones: 2.3.5, 2.4.0 Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants