Skip to content

slow requests resets FPM stats #286

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

Merged
merged 1 commit into from
Oct 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/fpm_php_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC
void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
{
TSRMLS_FETCH();
fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard);
fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard);
FILE *slowlog;

zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid);
Expand Down
8 changes: 7 additions & 1 deletion sapi/fpm/fpm/fpm_scoreboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
scoreboard->max_children_reached = max_children_reached;
}
if (slow_rq > 0) {
scoreboard->slow_rq += slow_rq;
scoreboard->slow_rq = slow_rq;
}
} else {
if (scoreboard->idle + idle > 0) {
Expand All @@ -137,6 +137,12 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
} else {
scoreboard->max_children_reached = 0;
}

if (scoreboard->slow_rq + slow_rq > 0) {
scoreboard->slow_rq += slow_rq;
} else {
scoreboard->slow_rq = 0;
}
}

if (scoreboard->active > scoreboard->active_max) {
Expand Down