Skip to content

Adding multiple (~100000) routes via NDB is slow #1470

@synclpz

Description

@synclpz

Using pyroute2==0.9.5 trying to add multiple routes:

with ndb.begin() as tx:
        for p in px.getCidrs():
            tx.push(ndb.routes.create(dst=p, gateway="192.168.191.1", table=101)) 

I end up this loop adding like ~1000 routes in 12 minutes (I see them hitting ip route show table 101 despite transaction is not yet committed).
I need to set up ~100 000 routes, thus it might take ~20 hours, which is unacceptable.

Is it something I miss in config/code or it's just intended to be this slow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions