View | Details | Raw Unified | Return to bug 44571
Collapse All | Expand All

(-)libapache-mod-jk-1.2.26~/native/common/jk_lb_worker.c (-2 / +4 lines)
Lines 40-47 Link Here
40
 * The load balancing code in this
40
 * The load balancing code in this
41
 */
41
 */
42
42
43
#define JK_WORKER_USABLE(w)   ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_PROBE && (w)->state != JK_LB_STATE_BUSY && (w)->activation != JK_LB_ACTIVATION_STOPPED && (w)->activation != JK_LB_ACTIVATION_DISABLED)
43
#define JK_WORKER_USABLE(w)   ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_PROBE && (w)->state != JK_LB_STATE_BUSY && (w)->activation != JK_LB_ACTIVATION_STOPPED && (w)->activation != JK_LB_ACTIVATION_DISABLED && ((w)->busylimit == 0 || (w)->busy < (w)->busylimit))
44
#define JK_WORKER_USABLE_STICKY(w)   ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_PROBE && (w)->activation != JK_LB_ACTIVATION_STOPPED)
44
#define JK_WORKER_USABLE_STICKY(w)   ((w)->state != JK_LB_STATE_ERROR && (w)->state != JK_LB_STATE_PROBE && (w)->activation != JK_LB_ACTIVATION_STOPPED && ((w)->busylimit == 0 || (w)->busy < (w)->busylimit))
45
45
46
static const char *lb_locking_type[] = {
46
static const char *lb_locking_type[] = {
47
    JK_LB_LOCK_TEXT_OPTIMISTIC,
47
    JK_LB_LOCK_TEXT_OPTIMISTIC,
Lines 1319-1324 Link Here
1319
                        JK_SHM_STR_SIZ);
1319
                        JK_SHM_STR_SIZ);
1320
                p->lb_workers[i].s->lb_factor =
1320
                p->lb_workers[i].s->lb_factor =
1321
                    jk_get_lb_factor(props, worker_names[i]);
1321
                    jk_get_lb_factor(props, worker_names[i]);
1322
                p->lb_workers[i].s->busylimit =
1323
				    jk_get_lb_worker_busylimit(props, worker_names[i]);
1322
                if (p->lb_workers[i].s->lb_factor < 1) {
1324
                if (p->lb_workers[i].s->lb_factor < 1) {
1323
                    p->lb_workers[i].s->lb_factor = 1;
1325
                    p->lb_workers[i].s->lb_factor = 1;
1324
                }
1326
                }
(-)libapache-mod-jk-1.2.26~/native/common/jk_shm.h (+1 lines)
Lines 85-90 Link Here
85
    volatile int state;
85
    volatile int state;
86
    /* Current lb factor */
86
    /* Current lb factor */
87
    volatile int lb_factor;
87
    volatile int lb_factor;
88
    volatile int busylimit;
88
    /* Current lb reciprocal factor */
89
    /* Current lb reciprocal factor */
89
    volatile jk_uint64_t lb_mult;
90
    volatile jk_uint64_t lb_mult;
90
    /* Current lb value  */
91
    /* Current lb value  */
(-)libapache-mod-jk-1.2.26~/native/common/jk_status.c (-1 / +7 lines)
Lines 210-216 Link Here
210
                                           "<th>&nbsp;</th><th>Name</th><th>Type</th>" \
210
                                           "<th>&nbsp;</th><th>Name</th><th>Type</th>" \
211
                                           "<th>Host</th><th>Addr</th>" \
211
                                           "<th>Host</th><th>Addr</th>" \
212
                                           "<th>Act</th><th>State</th>" \
212
                                           "<th>Act</th><th>State</th>" \
213
                                           "<th>D</th><th>F</th><th>M</th>" \
213
                                           "<th>D</th><th>F</th>" \
214
                                           "<th>BusyLimit</th><th>M</th>" \
214
                                           "<th>V</th><th>Acc</th>" \
215
                                           "<th>V</th><th>Acc</th>" \
215
                                           "<th>Err</th><th>CE</th><th>RE</th>" \
216
                                           "<th>Err</th><th>CE</th><th>RE</th>" \
216
                                           "<th>Wr</th><th>Rd</th><th>Busy</th><th>Max</th>" \
217
                                           "<th>Wr</th><th>Rd</th><th>Busy</th><th>Max</th>" \
Lines 225-230 Link Here
225
                                           "<td>%s</td>" \
226
                                           "<td>%s</td>" \
226
                                           "<td>%d</td>" \
227
                                           "<td>%d</td>" \
227
                                           "<td>%d</td>" \
228
                                           "<td>%d</td>" \
229
                                           "<td>%d</td>" \
228
                                           "<td>%" JK_UINT64_T_FMT "</td>" \
230
                                           "<td>%" JK_UINT64_T_FMT "</td>" \
229
                                           "<td>%" JK_UINT64_T_FMT "</td>" \
231
                                           "<td>%" JK_UINT64_T_FMT "</td>" \
230
                                           "<td>%" JK_UINT64_T_FMT "</td>" \
232
                                           "<td>%" JK_UINT64_T_FMT "</td>" \
Lines 1587-1592 Link Here
1587
                          jk_lb_get_state(wr, l),
1589
                          jk_lb_get_state(wr, l),
1588
                          wr->s->distance,
1590
                          wr->s->distance,
1589
                          wr->s->lb_factor,
1591
                          wr->s->lb_factor,
1592
                          wr->s->busylimit,
1590
                          wr->s->lb_mult,
1593
                          wr->s->lb_mult,
1591
                          wr->s->lb_value,
1594
                          wr->s->lb_value,
1592
                          wr->s->elected,
1595
                          wr->s->elected,
Lines 1619-1624 Link Here
1619
                jk_print_xml_att_string(s, 8, "domain", wr->s->domain);
1622
                jk_print_xml_att_string(s, 8, "domain", wr->s->domain);
1620
                jk_print_xml_att_int(s, 8, "distance", wr->s->distance);
1623
                jk_print_xml_att_int(s, 8, "distance", wr->s->distance);
1621
                jk_print_xml_att_string(s, 8, "state", jk_lb_get_state(wr, l));
1624
                jk_print_xml_att_string(s, 8, "state", jk_lb_get_state(wr, l));
1625
                jk_print_xml_att_uint32(s, 8, "busylimit", wr->s->busylimit);
1622
                jk_print_xml_att_uint64(s, 8, "lbmult", wr->s->lb_mult);
1626
                jk_print_xml_att_uint64(s, 8, "lbmult", wr->s->lb_mult);
1623
                jk_print_xml_att_uint64(s, 8, "lbvalue", wr->s->lb_value);
1627
                jk_print_xml_att_uint64(s, 8, "lbvalue", wr->s->lb_value);
1624
                jk_print_xml_att_uint64(s, 8, "elected", wr->s->elected);
1628
                jk_print_xml_att_uint64(s, 8, "elected", wr->s->elected);
Lines 1650-1655 Link Here
1650
                jk_printf(s, " domain=\"%s\"", wr->s->domain ? wr->s->domain : "");
1654
                jk_printf(s, " domain=\"%s\"", wr->s->domain ? wr->s->domain : "");
1651
                jk_printf(s, " distance=%d", wr->s->distance);
1655
                jk_printf(s, " distance=%d", wr->s->distance);
1652
                jk_printf(s, " state=%s", jk_lb_get_state(wr, l));
1656
                jk_printf(s, " state=%s", jk_lb_get_state(wr, l));
1657
                jk_printf(s, " busylimit=%" JK_UINT32_T_FMT, wr->s->busylimit);
1653
                jk_printf(s, " lbmult=%" JK_UINT64_T_FMT, wr->s->lb_mult);
1658
                jk_printf(s, " lbmult=%" JK_UINT64_T_FMT, wr->s->lb_mult);
1654
                jk_printf(s, " lbvalue=%" JK_UINT64_T_FMT, wr->s->lb_value);
1659
                jk_printf(s, " lbvalue=%" JK_UINT64_T_FMT, wr->s->lb_value);
1655
                jk_printf(s, " elected=%" JK_UINT64_T_FMT, wr->s->elected);
1660
                jk_printf(s, " elected=%" JK_UINT64_T_FMT, wr->s->elected);
Lines 1679-1684 Link Here
1679
                jk_print_prop_att_string(s, w, wr->s->name, "domain", wr->s->domain);
1684
                jk_print_prop_att_string(s, w, wr->s->name, "domain", wr->s->domain);
1680
                jk_print_prop_att_int(s, w, wr->s->name, "distance", wr->s->distance);
1685
                jk_print_prop_att_int(s, w, wr->s->name, "distance", wr->s->distance);
1681
                jk_print_prop_att_string(s, w, wr->s->name, "state", jk_lb_get_state(wr, l));
1686
                jk_print_prop_att_string(s, w, wr->s->name, "state", jk_lb_get_state(wr, l));
1687
                jk_print_prop_att_uint32(s, w, wr->s->name, "busylimit", wr->s->busylimit);
1682
                jk_print_prop_att_uint64(s, w, wr->s->name, "lbmult", wr->s->lb_mult);
1688
                jk_print_prop_att_uint64(s, w, wr->s->name, "lbmult", wr->s->lb_mult);
1683
                jk_print_prop_att_uint64(s, w, wr->s->name, "lbvalue", wr->s->lb_value);
1689
                jk_print_prop_att_uint64(s, w, wr->s->name, "lbvalue", wr->s->lb_value);
1684
                jk_print_prop_att_uint64(s, w, wr->s->name, "elected", wr->s->elected);
1690
                jk_print_prop_att_uint64(s, w, wr->s->name, "elected", wr->s->elected);
(-)libapache-mod-jk-1.2.26~/native/common/jk_util.c (+18 lines)
Lines 119-124 Link Here
119
119
120
#define SESSION_COOKIE              ("session_cookie")
120
#define SESSION_COOKIE              ("session_cookie")
121
121
122
#define MAXBUSY                     ("busylimit")
123
124
122
#define MAKE_WORKER_PARAM(P)     \
125
#define MAKE_WORKER_PARAM(P)     \
123
        strcpy(buf, "worker.");  \
126
        strcpy(buf, "worker.");  \
124
        strcat(buf, wname);      \
127
        strcat(buf, wname);      \
Lines 204-209 Link Here
204
    XML_DOCTYPE_OF_WORKER,
207
    XML_DOCTYPE_OF_WORKER,
205
    PROP_PREFIX_OF_WORKER,
208
    PROP_PREFIX_OF_WORKER,
206
    USER_CASE_OF_WORKER,
209
    USER_CASE_OF_WORKER,
210
    MAXBUSY,
207
    NULL
211
    NULL
208
};
212
};
209
213
Lines 297-302 Link Here
297
    STATUS_FAIL_OF_WORKER,
301
    STATUS_FAIL_OF_WORKER,
298
    LIST_PROPERTY_NAME,
302
    LIST_PROPERTY_NAME,
299
    SESSION_COOKIE,
303
    SESSION_COOKIE,
304
    MAXBUSY,
300
    MAINTAIN_PROPERTY_NAME
305
    MAINTAIN_PROPERTY_NAME
301
};
306
};
302
307
Lines 1437-1442 Link Here
1437
    return v;
1442
    return v;
1438
}
1443
}
1439
1444
1445
int jk_get_lb_worker_busylimit(jk_map_t *m, const char *wname)
1446
{
1447
    char buf[1024];
1448
1449
    if (!m || !wname) {
1450
        return -1;
1451
    }
1452
1453
    MAKE_WORKER_PARAM(MAXBUSY);
1454
1455
    return jk_map_get_int(m, buf, 0);
1456
}
1457
1440
int jk_get_worker_mount_list(jk_map_t *m,
1458
int jk_get_worker_mount_list(jk_map_t *m,
1441
                             const char *wname,
1459
                             const char *wname,
1442
                             char ***list, unsigned int *num_of_maps)
1460
                             char ***list, unsigned int *num_of_maps)
(-)libapache-mod-jk-1.2.26~/native/common/jk_util.h (+3 lines)
Lines 127-132 Link Here
127
const char *jk_get_lb_session_cookie(jk_map_t *m,
127
const char *jk_get_lb_session_cookie(jk_map_t *m,
128
				     const char *wname);
128
				     const char *wname);
129
129
130
int jk_get_lb_worker_busylimit(jk_map_t *m, const char *wname);
131
132
130
int jk_get_worker_mount_list(jk_map_t *m,
133
int jk_get_worker_mount_list(jk_map_t *m,
131
                             const char *wname,
134
                             const char *wname,
132
                             char ***list, unsigned int *num_of_maps);
135
                             char ***list, unsigned int *num_of_maps);

Return to bug 44571