[OpenSIPS-Devel] [OpenSIPS/opensips] 5a6399: Improve the TCP conns balancing over the TCP workers

Bogdan Andrei IANCU noreply at github.com
Tue Apr 19 11:20:52 UTC 2022


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 5a6399b13861157b530862adcf7bee7b21c3ce87
      https://github.com/OpenSIPS/opensips/commit/5a6399b13861157b530862adcf7bee7b21c3ce87
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2022-04-19 (Tue, 19 Apr 2022)

  Changed paths:
    M net/net_tcp.c

  Log Message:
  -----------
  Improve the TCP conns balancing over the TCP workers

Instead of balancing as number of conns per worker, balance based on the internla load of the TCP workers.
At the end we want to avoid overloading some TCP workers, so to have a even load distribution. The number of TCP conns is irrelevant (as they may have different amount of traffic which may translate in different load values).


  Commit: 6412c0ae11924c1dc18a8fad00fecf8060631bba
      https://github.com/OpenSIPS/opensips/commit/6412c0ae11924c1dc18a8fad00fecf8060631bba
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2022-04-19 (Tue, 19 Apr 2022)

  Changed paths:
    M cfg.lex
    M cfg.y
    M globals.h
    M net/net_tcp.c
    M net/net_tcp_proc.c

  Log Message:
  -----------
  Added tcp_parallel_read_on_workers core parameter

This option will allow a TCP conn to perform read operations from different processes, not only from one.
So far, upon creation, a TCP conn was assigned to a TCP workers which was doing all the reading for that TCP conn. This may become a bootleneck.
With tcp_parallel_read_on_workers, after a read is completed, the TCP conn is passed back to the TCP Main processes, which will perform a re-balancing for the next read operations, passing the TCP conn potentially to another worker.
NOTE: at TCP conn level, the read ops are still performed in serial way, one at a time (even if from different processes)


  Commit: e08dce18a0195cea7805315fdef8d75680da98dc
      https://github.com/OpenSIPS/opensips/commit/e08dce18a0195cea7805315fdef8d75680da98dc
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2022-04-19 (Tue, 19 Apr 2022)

  Changed paths:
    M modules/proto_tls/proto_tls.c
    M net/net_tcp.h
    M net/net_tcp_proc.c
    M net/proto_tcp/doc/proto_tcp_admin.xml
    M net/proto_tcp/proto_tcp.c
    M net/proto_tcp/tcp_common.h

  Log Message:
  -----------
  Added support for parallel read/handle of messages via TCP conns

The NET TCP layer provides the proto modules the possibility to return the connection (for more reading) BEFORE actually handling the current message.

The proto_tcp exposes the new `tcp_parallel_handling` module parameter to control if read/handle for SIP messages should be done on TCP.


Compare: https://github.com/OpenSIPS/opensips/compare/5de4de2065e2...e08dce18a019



More information about the Devel mailing list