How to keep many servers (5000+) up-to-date?
I don't think the proposed plan here makes much sense.  Tools like Ansible are free and designed to do this with good, central management and logging.


Put code in BitBucket.
Make a Jenkins server (open source / free / low on resources 
/ well documented and easy to use).
Make BitBucket call Jenkins with a hook on change.


Or, if you feel like it, Jenkins can poll bit-bucket, but this is less efficient.

Have Jenkins call ansible (also open source / free / low on resources 
/ well documented and easy to use) in its pipeline.
Ansible can target all 5000 servers with a dynamic inventory based on querying a database/file/API/whatever you have.
This way, bit-bucket has almost no load, ansible does everything from one location, runs are recorded in Jenkins with info on each host.


You won't have any API / rate limits here and you'll easily be able to target more hosts, with no effort on your end, with the dynamic inventory.

This is industry standard tooling.  You can also use Ansible to keep the servers up to date patch wise and all kinds of other stuff while you're at it, so it's a re-usable solution.