I've never found perma-war to offset the costs unless the AI truly is pathetic (King and lower). It never seems to be worth it if I can't win in 50 turns or so. But I may not keep enough units on hand. Typically I've only got a core of 10 or so stationed around my borders. I can remember never losing units back on King, but I usually have to take some losses to immortal rushes and the AI's sheer numbers usually make me halt development in some way, be it spending all my gold on the war, not being able to work or improve in the war zone (worse if it has luxes and resources), or every other build being a soldier. Often they may even have a tech lead depending on how early it happens. I'm not a turtler though, so I generally am asking for it--expanding as much as possible, and not really picking defensible city-sites either.
It's been ages since I've had a war I couldn't force the AI to ask for peace in under 50 turns though. They will refuse for the first 10 turns generally, and continue to be recalcitrant if you are on the defensive.
The key is you need to do damage to home. Otherwise it will take years of successful defenses sometimes for them to consider peace (depends on AI). But if this is the case I've had success in changing their minds by mounting a successful defense, AND sending isolated units in to pillage the crap out of their territory and disband their workers. I always laugh at how bare early rushers leave home--enough to defend cities but not pillagers. It's pretty much always worth losing a horsemen on the main lines to send it up. Just ignore their units and cities, end on hills, and Target workers, then luxes, then resources. If nothing else you'll earn gold and often the penalties for them lacking the proper resources and often plunge them into unhappiness. If you opened commerce, tercios are awesome at this. Good defense and no pillage movement cost. Denmark is the master at this. This bumps up your threat and damage levels in the AI's eyes and they will often sue for peace long enough to produce new workers, repair, then target you again. This sets AI back after the war for a while too depending on how much damage you did, and the whole process often gives you many turns to prepare for the next attack, and if they attack again? Well, they get another diplo hit with everyone. Often by the second war other AI will hate them and join you for a low price. But if not? Pillage the crap out of them again. It's a good source of money and amusing.
Works on immortal for me most of the time. Exception being maybe zulu as they have that annoying extra movement and flanking to chase my pillagers down.
NOTE: some warlike AI will refuse peace point-blank for years if you take a good city or capital. I've had this happen which is annoying. Generally not a problem as weak AI are easy to keep fighting, but if you really want peace this means taking cities is often not your best chance. Pillaging and threatening cities, however is a sure thing. I've had AI sue for peace the turn before I took a city and refuse as soon as I took it. (Because they now want it back) Even if you don't intend to finish I city, just attacking it with a few units often brings the AI to the table. Even if there was no way you could've completed the job just having troops in territory, pillaging, etc. makes you look dangerous regardless of you pointy stick rating. Take this from a guy who keep a skeleton of troops most of the game.