The fact that it is taking 5 minutes to deliver hot water to the shower rarely has anything to do with a tanked water heater and is instead because of the distance between the water heater and the shower. (Also depends on whether or not those pipes are exposed to the elements, as the hot water will have to first heat the cold pipes before it can deliver hot water to the shower. Raising the temperature setting would help heat the pipes faster, but that would nonetheless be a problem with the setting, not a problem with the water heater that would warrant replacement if it were the only problem.) That aside, either the water at the top of the tank is hot or the water heater simply isn't working. (Hot water, like hot air, rises. If there's one place that hot water should be at, it's the top of the tank, which is where the hot outlet draws from.)
Water heaters typically go bad for two reasons:
(1) Not changing the anode rod, leading to corrosion that eats through the tank. If you haven't had your water heater's anode rod replaced (typically about every 10 years), then this thing is a ticking time bomb, and it will fail very soon.
(2) Sediment covering the electric elements / gas burner, at which point performance will be reduced. This will often cause "popping" noises, as the elements get quite hot and then cause water trapped within the sediment to almost instantaneously boil, causing a tiny explosion as the water turns to vapor. In electric water heaters, this will pretty much cause the lower element to be completely useless, as it becomes buried under more and more sediment, either becoming thermally insulated from the water that it's supposed to be heating or outright failing due to excessive temperatures. The common symptom of this in electric water heaters is that the hot water will quickly run out, as only the top element is working, and the hot water stays near the top. I haven't worked with gas water heaters much, but the logic is pretty similar... sediment and scale is going to cover up the surfaces that are transferring heat from the burner to the water, and you're going to lose a lot of efficiency. (To make matters worse, your water heater probably only had about a 50% AFUE [annual fuel utilization efficiency] rating when it was new, and if it has any sediment problems, it's probably down to 25%. By contrast, a new gas water heater will have 75-90% AFUE. Ergo, I would say it's worth it to change the water heater on account of efficiency alone.)
Note: Some of this depends on location -- the harder the water, the worse these problems will be.
If you don't have a water softener, you should immediately replace the unit.
If you have a water softener, the unit might still have problems, and even if it doesn't, I would replace it on AFUE concerns alone. If you don't want to replace it, though, you MUST at least have a plumber come install a new anode rod and T&P relief valve if you have not had the water heater serviced recently. (If your T&P relief valve is scaled over or has otherwise failed, flooding should be the least of your concerns. A failed T&P valve can lead to a BLEVE [a type of explosion], which would pretty much flatten your entire house and possibly kill everyone in it. See below.)
![enter image description here](https://i.stack.imgur.com/uoI64.jpg)
PS: What you want to use as a temperature setting is up to you, but you should keep it at at least 120-125F, raising the temperature up to 140 degrees Fahrenheit once a month to ward off Legionnaires' disease, which carries a 30% fatality rate.
So I did it! And it turned out not to be the problem...
Things to note:
And of course, be sure to turn off your gas when working with it, drain your water heater if it is an older style model (like mine) and be careful putting everything back together.
My problem: My problem ended up being the thermocouple. The replacement pilot light assembly I had installed just 8 weeks ago ended up having a faulty thermocouple. Obviously I should have taken more time to test the thermocouple rather than spending all the time and money on a new valve. Ah well! I'll be putting in a new anode shortly and hopefully I will get another 3-5 years out of this water heater. Enough time to take care of the freon line when the budget allows...
Also worth mentioning, I found an identical gas control valve from a vendor on Amazon. Ever since I got the new pilot light assembly in place it has been working just fine.
Best Answer
I can't imagine a code that would prohibit flexible water lines, but all building codes are up to the local jurisdiction so it is possible. In earthquake country on the west coast, flexible water lines are required in some places and optional but recommended in others.
Looking at, for example, Daly City water heater requirements (http://www.dalycity.org/Page192.aspx) say flex lines are recommended but not mandatory. In either case, "A union or flared connection is required on hot and cold water lines to facilitate removal of the appliance (CPC 609.5)". Flex lines give you the flare connection.
There are two common types of flexible lines for water heaters: copper and rubber+steel. It could be that in your jurisdiction, one type is allowed but the other is prohibited.
![Rubber and steel flexible water line](https://i.stack.imgur.com/D79xx.jpg)
A union is a pipe joint with matching threads, made specifically for allowing disconnection of a hard connection. Whoever installed yours without a union didn't know what they were doing. You can easily add a PVC union to the existing setup if you want to avoid adding a flex line for any reason.
But personally, I would install the copper flex lines on both hot and cold, until a local inspector told me specifically it was not allowed.
And while you're at it, if this is a gas heater, make sure it is 18 inches off the floor too. :-)