Optimize packet I/O and timeouts

- Introduce per-thread I/O statistics for packet I/O to reduce performance overhead.
- Implement packet_io_yield() for better thread management during I/O operations.
- Refactor time wheel management:
  - Replace timeouts-based cron tasks with (now_ts - last_ts > timeout) for scheduled tasks.
  - Update the time wheel every 5 ms for improved time management.
This commit is contained in:
luwenpeng
2024-04-18 14:20:28 +08:00
parent 892842c61b
commit 5508454a1b
32 changed files with 377 additions and 540 deletions

View File

@@ -14,6 +14,7 @@ extern "C"
struct thread_stat
{
struct io_stat *io;
struct ip_reassembly_stat *ip_rea;
struct session_manager_stat *sess_mgr;
};
@@ -22,9 +23,7 @@ struct stellar_stat;
struct stellar_stat *stellar_stat_new(uint16_t nr_thread);
void stellar_stat_free(struct stellar_stat *stat);
void stellar_stat_output(struct stellar_stat *stat);
void stellar_peek_io_stat(struct stellar_stat *stat, const struct io_stat *io_stat);
void stellar_peek_thr_stat(struct stellar_stat *stat, const struct thread_stat *thr_stat, uint16_t thr_idx);
void stellar_stat_merge(struct stellar_stat *stat, const struct thread_stat *thr_stat, uint16_t thr_idx);
#ifdef __cpluscplus
}