To adding more 128 bit UUIDs, more services, and more characteristic.
vs_uuid_count is the number of 128 bit UUIDs.
But I figured out the attr_tab_size only by increasing the size until without no memory error.
Is there a formula to know exactly the size of the attribute table softdevice will need?
Unfortunately there is no such formula. The table size is calculated inside the Softdevice, and how it is done is not public information. The only way to figure out the size is by trial and error.