BGP does not establish more than 256 peers

Hello community. I have faced problem with BGP protocol on Mikrotik CCR1036:

I have 500+ sstp active sessions on that box. All of them trying to establish BGP session with CCR1036. It is possible to establish only 256 bgp-sessions. 257th and next will receive message “Connection refused”. Quntity of ipv4 prefixes and another parameters does not matter: only 256 active bgp peers.

Has anyone encountered this problem? How to solve it?

model: CCR1036-8G-2S+
revision: r3

MikroTik RouterOS 7.18.2

License level: 6


                uptime: 1h10m39s           
                  version: 7.18.2 (stable)    
               build-time: 2025-03-11 11:59:04
         factory-software: 6.45.9             
              free-memory: 2905.8MiB          
             total-memory: 4096.0MiB          
                      cpu: tilegx             
                cpu-count: 36                 
            cpu-frequency: 1200MHz            
                 cpu-load: 3%                 
           free-hdd-space: 855.3MiB           
          total-hdd-space: 1024.0MiB          
  write-sect-since-reboot: 448                
         write-sect-total: 731935             
               bad-blocks: 0%                 
        architecture-name: tile               
               board-name: CCR1036-8G-2S+     
                 platform: MikroTik           



> routing bgp connection/print

1   name="Customers" 
     remote.address=100.64.0.0/21 .as=64999 
     local.address=100.64.0.1 .role=ebgp 
     listen=yes routing-table=main router-id=100.64.0.1 templates=Customers-TPL as=65444 nexthop-choice=force-self multihop=yes hold-time=1m keepalive-time=20s 
     output.as-override=no .redistribute=static,bgp .filter-chain=customers-output .default-originate=never .no-client-to-client-reflection=yes 
     input.filter=customers-input 
     
 >routing bgp template/print

 1    name="Customers-TPL" routing-table=main as=65444 nexthop-choice=force-self multihop=yes hold-time=2m keepalive-time=30s 
      output.redistribute=static,bgp .filter-chain=customers-output .default-originate=never 
      input.filter=customers-input