I would suggest buying it at least 3 or 4 weeks ahead of your vacation. Set it up and let it run so you can adjust how much it dispenses and make sure it is working properly. When you do leave, only set it to feed about 1/4 to 1/2 of what you normally feed. That way if something does go wrong, hopefully, it will be minimal.
As already stated though, they can make it 3 weeks without food.