[OpenSIPS-Users] Rate Limit Pipes Replication Issue

Andre Jordaan abjordaan at gmail.com
Wed Dec 20 10:46:01 UTC 2023


Hi,

Facing an issue with RATELIMIT replication where I want to rate limit a customer throughout the entire cluster. I have 2 standalone OpenSIPs nodes, node_id=1 and node_id=3 and rate limit pipes do not seem to replicate.

Cluster is up, ratelimit-pipe-repl enabled and OK. When I make a call via node1 the rate limit shows correctly however this information is not replicated to node3

[root at node1 ~]# opensips-cli -x mi rl_list
{
    "Pipes": [
        {
            "id": "TEST",
            "algorithm": "RED",
            "limit": 1,
            "counter": 1
        }
    ],
    "drop_rate": 0
}

[root at node3 ~]# opensips-cli -x mi rl_list
{
    "Pipes": [],
    "drop_rate": 0
}

Config of Node 1:

#### PROTO_BIN Module
loadmodule "proto_bin.so"
modparam("proto_bin", "bin_port", 5555)
modparam("proto_bin", "bin_send_timeout", 200)

modparam("proto_bin", "bin_max_msg_chunks", 8)
modparam("proto_bin", "bin_async", 0)
modparam("proto_bin", "bin_async_max_postponed_chunks", 16)

#### CLUSTERER Module
loadmodule "clusterer.so"
modparam("clusterer", "my_node_id", 1)
modparam("clusterer", "db_mode", 1)
modparam("clusterer", "db_url","mysql://opensips:opensipsrw@localhost/opensips")

#### RATELIMIT  Module
loadmodule "ratelimit.so"
modparam("ratelimit", "pipe_replication_cluster", 1)
modparam("ratelimit", "limit_per_interval", 0) # limit per-second

Config of Node 3:
#### PROTO_BIN Module
loadmodule "proto_bin.so"
modparam("proto_bin", "bin_port", 5555)
modparam("proto_bin", "bin_send_timeout", 200)
modparam("proto_bin", "bin_max_msg_chunks", 8)
modparam("proto_bin", "bin_async", 0)
modparam("proto_bin", "bin_async_max_postponed_chunks", 16)

#### CLUSTERER Module
loadmodule "clusterer.so"
modparam("clusterer", "my_node_id", 3)
modparam("clusterer", "db_mode", 1)
modparam("clusterer", "db_url","mysql://opensips:opensipsrw@localhost/opensips")

#### ratelimit Module
loadmodule "ratelimit.so"
modparam("ratelimit", "pipe_replication_cluster", 1)
modparam("ratelimit", "limit_per_interval", 0) # limit per-second


mysql> select * from clusterer;
+----+------------+---------+----------------------+-------+-----------------+----------+----------+-------+---------------------+
| id | cluster_id | node_id | url                  | state | no_ping_retries | priority | sip_addr | flags | description         |
+----+------------+---------+----------------------+-------+-----------------+----------+----------+-------+---------------------+
|  1 |          1 |       1 | bin:10.0.208.20:5555 |     1 |               3 |       50 | NULL     | seed  | PKL OpenSIPS Node 1 |
|  3 |          1 |       3 | bin:10.0.210.20:5555 |     1 |               3 |       50 | NULL     | NULL  | CPT OpenSIPS Node 1 |
+----+------------+---------+----------------------+-------+-----------------+----------+----------+-------+---------------------+

Below is the details of the cluster state:

Cluster Topology:

opensips-cli -x mi clusterer_list_topology
{
    "Clusters": [
        {
            "cluster_id": 1,
            "Nodes": [
                {
                    "node_id": 1,
                    "Neighbours": [
                        3
                    ]
                },
                {
                    "node_id": 3,
                    "Neighbours": [
                        1
                    ]
                }
            ]
        }
    ]
}

Cluster List:

[root at node1~]# opensips-cli -x mi clusterer_list
{
    "Clusters": [
        {
            "cluster_id": 1,
            "Nodes": [
                {
                    "node_id": 3,
                    "db_id": 3,
                    "url": "bin:10.0.210.20:5555",
                    "link_state": "Up",
                    "state": "enabled",
                    "next_hop": "3",
                    "description": "CPT OpenSIPS Node 1"
                }
            ]
        }
    ]
}

[root at node3 ~]# opensips-cli -x mi clusterer_list
{
    "Clusters": [
        {
            "cluster_id": 1,
            "Nodes": [
                {
                    "node_id": 1,
                    "db_id": 1,
                    "url": "bin:10.0.208.20:5555",
                    "link_state": "Up",
                    "state": "enabled",
                    "next_hop": "1",
                    "description": "PKL OpenSIPS Node 1"
                }
            ]
        }
    ]
}

Cluster Capability:
opensips-cli -x mi clusterer_list_cap
{
    "Clusters": [
        {
            "cluster_id": 1,
            "Capabilities": [
                {
                    "name": "ratelimit-pipe-repl",
                    "state": "Ok",
                    "enabled": "yes"
                }
            ]
        }
    ]
}

Any samples or previous posts that I can reference?

Andre


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20231220/a026fa73/attachment-0001.html>


More information about the Users mailing list