Yeah - gotta agree with sibling... 10 years' salary on a mortgage is friggin' insane, doubly so when you get a nice place outside of California for only 2 years' salary.
Not to mention that the figure also changes depending on how close you are to retirement. If you're younger and doing well, maybe get one priced at 3-5x annual salary, but once you get past 40, you may want to lower the sights a bit and be realistic.. that 30-year fixed is (barring early payoff) still going to be there demanding cash out of you for another decade when you turn 60.
Example? No problem - my wife and I just bought our new we're-retiring-here-dammit log cabin on six acres, in a gorgeous part of the Oregon Coastal Range. I paid exactly 2 years' salary to get it from the previous owner. Glopping a bit of extra principal on the mortgage payments will have the place entirely paid off in 10 years, leaving me a nice cushion of time before I retire for good... and by the way, the missus no longer has to work. Meanwhile, I still have a decent amount of extra dosh each month after the bills to put towards, well, anything. That's why you get realistic about it (besides, what the hell was I going to do with a 4-bdrm Victorian-style monster, what with the kids all grown up?)
You can say that I'm in no particular hurry to go get a $1.3m house that would cost me a mint in taxes, upkeep, labor, etc... the Joneses can go fsck themselves. YMMV, though.