Skip to content

Commit 1f74cef

Browse files
committed
Revert "H2O: Track connection load across the worker threads (TechEmpower#9520)"
This reverts commit 0516670.
1 parent 43edfc1 commit 1f74cef

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

frameworks/C/h2o/src/event_loop.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@
3232
#include <netinet/tcp.h>
3333
#include <openssl/ssl.h>
3434
#include <sys/socket.h>
35-
#include <sys/syscall.h>
3635
#include <sys/types.h>
3736

3837
#include "error.h"
3938
#include "event_loop.h"
4039
#include "global_data.h"
4140
#include "thread.h"
42-
#include "utility.h"
4341

44-
#define CONN_NUM_SAMPLE_PERIOD 2500
4542
#define DEFAULT_TCP_FASTOPEN_QUEUE_LEN 4096
4643

4744
static void accept_connection(h2o_socket_t *listener, const char *err);
@@ -80,7 +77,6 @@ static void accept_connection(h2o_socket_t *listener, const char *err)
8077
if (!sock)
8178
break;
8279

83-
ctx->event_loop.accepted_conn_num++;
8480
ctx->event_loop.conn_num++;
8581
sock->on_close.cb = on_close_connection;
8682
sock->on_close.data = &ctx->event_loop.conn_num;
@@ -299,36 +295,11 @@ static void start_accept_polling(bool is_main_thread,
299295

300296
void event_loop(struct thread_context_t *ctx)
301297
{
302-
uint64_t last_sample = 0;
303-
304298
while (!ctx->shutdown || ctx->event_loop.conn_num) {
305299
h2o_evloop_run(ctx->event_loop.h2o_ctx.loop, INT32_MAX);
306300
process_messages(&ctx->global_thread_data->h2o_receiver,
307301
&ctx->event_loop.local_messages);
308-
309-
const uint64_t now = h2o_now(ctx->event_loop.h2o_ctx.loop);
310-
311-
if (now - last_sample > CONN_NUM_SAMPLE_PERIOD || last_sample > now) {
312-
const size_t i = ctx->event_loop.conn_num_sample_idx;
313-
314-
ctx->event_loop.conn_num_sample[i] = ctx->event_loop.conn_num;
315-
ctx->event_loop.conn_num_sample_idx =
316-
(i + 1) % ARRAY_SIZE(ctx->event_loop.conn_num_sample);
317-
last_sample = now;
318-
}
319302
}
320-
321-
flockfile(stdout);
322-
printf("Thread %ld statistics:\nAccepted connections: %zu\nConnection number samples: %zu",
323-
syscall(SYS_gettid),
324-
ctx->event_loop.accepted_conn_num,
325-
*ctx->event_loop.conn_num_sample);
326-
327-
for (size_t i = 1; i < ARRAY_SIZE(ctx->event_loop.conn_num_sample); i++)
328-
printf(",%zu", ctx->event_loop.conn_num_sample[i]);
329-
330-
putc_unlocked('\n', stdout);
331-
funlockfile(stdout);
332303
}
333304

334305
void free_event_loop(event_loop_t *event_loop, h2o_multithread_receiver_t *h2o_receiver)

frameworks/C/h2o/src/event_loop.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727

2828
#include "global_data.h"
2929

30-
#define CONN_NUM_SAMPLES 512
31-
3230
typedef enum {
3331
SHUTDOWN,
3432
TASK
@@ -43,9 +41,6 @@ typedef struct {
4341
h2o_accept_ctx_t h2o_accept_ctx;
4442
h2o_context_t h2o_ctx;
4543
h2o_linklist_t local_messages;
46-
size_t accepted_conn_num;
47-
size_t conn_num_sample[CONN_NUM_SAMPLES];
48-
size_t conn_num_sample_idx;
4944
} event_loop_t;
5045

5146
typedef struct {

0 commit comments

Comments
 (0)