Skip to content
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

[FEATURE] tcp receiver distribution unbalanced #3482

Open
XNXSIL opened this issue Sep 30, 2024 · 1 comment
Open

[FEATURE] tcp receiver distribution unbalanced #3482

XNXSIL opened this issue Sep 30, 2024 · 1 comment

Comments

@XNXSIL
Copy link

XNXSIL commented Sep 30, 2024

Running environment.
version: opensips 3.4.7 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 79ebc9d
main.c compiled on with gcc 10

Describe the problem

After upgrading from 3.2 to 3.4, the tcp receiver distribution becomes unbalanced. proc_load will have spike
3.2 version
image

3.4 version
image

Describe alternatives you've considered

There may be a problem with the following commit
5a6399b

@XNXSIL
Copy link
Author

XNXSIL commented Oct 14, 2024

I made a mistake. There is no big problem with the allocation logic of tcp_receiver. However, the load calculation uses the pt_get_1m_proc_load function, which is not accurate enough and can easily cause CPU spikes. This problem can be solved by changing to pt_get_pt_proc_load

Stress Testing

pt_get_1m_proc_load
image
pt_get_rt_proc_load
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants