By setting the maximum number of external LSAs in the LSDB, you can restrict the number of routes within a proper range.
The configuration must be consistent in the entire AS.
system-view
ospf [ process-id ]
lsdb-overflow-limit number