Abdullah bin Amr bin As reported,

The Prophet ﷺ was informed that I was fasting continuously and praying through the night. He either sent for me or met me, and he said, "Have I not been told that you fast without breaking your fast and pray all night? Do not do that, for your eye has a right over you, your body has a right over you, and your family has a right over you. So fast and break your fast, pray and sleep. Fast one day out of every ten, and you will have the reward of nine."I said, "I find myself stronger than that, Prophet of Allah."He said, "Then fast the fast of Dawud عليه السلام."I asked, "How did Dawud fast, Prophet of Allah?"He replied, "He would fast one day and break his fast the next, and he would not flee when he met the enemy."Then he mentioned the rest of the hadith, which will appear in the chapter on the prohibition of fasting perpetually.

Azami 4467

Sahih

عن عبد الله بن عمرو قال

بلغ النبي ﷺ أني أسرد الصوم، وأصلي الليل، فإما أرسل إلي وإما لقيته، فقال: ألم أخبر أنك تصوم ولا تفطر، وتصلي الليل؟ فلا تفعل؛ فإن لعينك حظا، ولنفسك حظا، ولأهلك حظا، فصم وأفطر، وصل ونم، وصم من كل عشرة أيام يوما، ولك أجر تسعة. قال: إني أجدني أقوى من ذلك يا نبي الله. قال: فصم صيام داود عليه السلام. قال: وكيف كان داود يصوم يا نبي الله؟ قال: كان يصوم يوما ويفطر يوما، ولا يفر إذا لاقى ثم ذكر بقية الحديث وسيأتي في باب النهيي عن صوم الدهر.

الأعظمي 4467صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Voluntary fasting and encouragement to do it
Section
Most virtuous fasting is the fasting of Dawud عليه السلام
Numbering
Jami al-Kamil 4467 (2nd edition)
Azami 4467