I have been through this several times and it never gets easier. If you think he is suffering in any way, you have to do the right thing. Your vet will now if it's time. 17 years is a nice long life for a family pet. 2 years ago we adopted a 10 year old Westie from a shelter. We suspected that he had cancer. 6 months later he started to get worse. the meds he was on made him drink water constantly. Then he peed all over the house. When we put him down, I cried like a baby even though we only had him a short while. Cherish his memory and know that you gave him a great life.
After Ninja was gone, we got another dog from the shelter and I can't imagine life without her. So yeah, some day I'll be in your shoes again.