Sahih Muslim , Book 6, Hadith 2592 (USC-MSA)

Abdullah b. Amr (Allah be pleased with both of them) reported: The Messenger of Allah said to me: 'Abdullah b. Amr, you fast continuously and stand in prayer for the whole of night. If you do like that, your eyes would be highly strained and would sink and lose sight. There is no (reward for) fasting (for him) who fasts perpetually. Fasting for three days during the month is like fasting, the whole of the month. I said: I am capable of doing more than this, whereupon he said: Observe the fast of David. He used to fast one day and break (the other) day. And he did not turn back in the encounter.

وَحَدَّثَنَا عُبَيْدُ اللَّهِ بْنُ مُعَاذٍ، حَدَّثَنِي أَبِي، حَدَّثَنَا شُعْبَةُ، عَنْ حَبِيبٍ، سَمِعَ أَبَا الْعَبَّاسِ، سَمِعَ عَبْدَ اللَّهِ بْنَ عَمْرٍو، - رضى الله عنهما - قَالَ قَالَ لِي رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ يَا عَبْدَ اللَّهِ بْنَ عَمْرٍو إِنَّكَ لَتَصُومُ الدَّهْرَ وَتَقُومُ اللَّيْلَ وَإِنَّكَ إِذَا فَعَلْتَ ذَلِكَ هَجَمَتْ لَهُ الْعَيْنُ وَنَهِكَتْ لاَ صَامَ مَنْ صَامَ الأَبَدَ صَوْمُ ثَلاَثَةِ أَيَّامٍ مِنَ الشَّهْرِ صَوْمُ الشَّهْرِ كُلِّهِ ‏"‏ ‏.‏ قُلْتُ فَإِنِّي أُطِيقُ أَكْثَرَ مِنْ ذَلِكَ ‏.‏ قَالَ ‏"‏ فَصُمْ صَوْمَ دَاوُدَ كَانَ يَصُومُ يَوْمًا وَيُفْطِرُ يَوْمًا وَلاَ يَفِرُّ إِذَا لاَقَى ‏"‏ ‏.‏

sunnah.com