The default number of buckets is 101, and the max allowed is 10000. I've seen recommendations that the number of buckets be the expected number of items - divided by 78%. The rationale for this is to have a high chance that each item gets assigned to its own bucket. Having more buckets has the potential to speed up the lookups, since the idea is to have 50000 items divided into 100 buckets each having 500 items, so it's faster to find an item among the 500 items assigned to that bucket instead of hunting within 1 bucket where you have a size 50000 haystack hiding the needle you're looking for.
If the number of items increases over time, something you can have your script do during ON START is to estimate the number of items by checking $lines(hashtablefilename), then calculating the number of buckets while making sure that number doesnt exceed 10000.