Skip to content

Commit 454a9fc

Browse files
committed
Merge branch 'master' of https://github.com/guggemand/php-src
* 'master' of https://github.com/guggemand/php-src: Dont reset other counters when incrementing slow_rq
2 parents 41da537 + 3fd5a40 commit 454a9fc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

sapi/fpm/fpm/fpm_php_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC
138138
void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
139139
{
140140
TSRMLS_FETCH();
141-
fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard);
141+
fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, child->wp->scoreboard);
142142
FILE *slowlog;
143143

144144
zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid);

sapi/fpm/fpm/fpm_scoreboard.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
111111
scoreboard->max_children_reached = max_children_reached;
112112
}
113113
if (slow_rq > 0) {
114-
scoreboard->slow_rq += slow_rq;
114+
scoreboard->slow_rq = slow_rq;
115115
}
116116
} else {
117117
if (scoreboard->idle + idle > 0) {
@@ -137,6 +137,12 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
137137
} else {
138138
scoreboard->max_children_reached = 0;
139139
}
140+
141+
if (scoreboard->slow_rq + slow_rq > 0) {
142+
scoreboard->slow_rq += slow_rq;
143+
} else {
144+
scoreboard->slow_rq = 0;
145+
}
140146
}
141147

142148
if (scoreboard->active > scoreboard->active_max) {

0 commit comments

Comments
 (0)