5000 IUs is definitely high enough that it can be poisonous. Don't do that unless you get regular serum level checks as well.
It may be safe to take 5000 IU a day, some even suggest 8000 to 10000 IU per day. But studies still vary on this and discussions are being held. Don't be the lab mouse.
Take max. 4000, otherwise get blood work done and take over 4000 long term only on supervision until this is really clarified. You DO NOT want hypervitaminosis D.
The overflow of your body stores goes straight out of your body. That's why vitamin D hypervitaminosis is causing kidney stones.