According to a recent Wells Fargo survey, nearly half of all U.S. investors are concerned about running out of money in retirement.

Source: 401kcalculator.org via Flickr.

Some people worry that they don't have enough savings, while others are simply afraid to invest in the stock market and are earning little or no returns on their nest eggs.

Should you be worried about going broke during retirement? It depends on your savings and expectations. But with some solid planning, you should be able to put many of your retirement-finance fears at ease. Here's how to make sure you outlive your retirement nest egg.

Have realistic income and lifestyle expectations
If you have $1 million in savings, expecting to draw an annual income of $100,000 from your investments in perpetuity is unrealistic. Many experts advocate following the "4% rule," which essentially says that if you withdraw 4% of your assets during your first year of retirement, and then adjust for cost-of-living increases after that, your savings have a good chance of lasting for your entire retirement.

While I agree that this is generally an effective strategy, the problem is that this rule assumes your expenses will stay relatively constant. Unfortunately, the opposite is generally true in retirement. In a given year, you could have a lot of unforeseen medical expenses, which could require a larger withdrawal. Rather than following a particular rule to the letter, be flexible. If the market performs poorly one year, it may be a good idea to cut down on your expenses and give your portfolio a chance to rebound. And if your investments have a particularly good year, maybe you can treat yourself to a little more.

Don't be afraid of stocks, but avoid overpriced bonds
This holds true even as you approach retirement, but it's especially true for younger investors (those with 20 years or more until retirement). Conventional wisdom says you should start with most of your money in stocks and then shift to lower-risk assets like bonds as you get older. Generally, this is true, with a couple of small modifications.

First, you should never completely exit stocks, which are your primary growth engine. The aforementioned survey found that the average investor has just 38% of their retirement savings invested in stocks. This is far too low.

One traditional guideline is to take your age and subtract it from 100 to find out what percentage of your investments should be in stocks. But with retirees living longer and longer, a better guideline may be 110 minus your age. For example, if you're 30, you should have about 80% of your retirement savings in stocks. If you're 70, then 40% is a sensible allocation to stocks. But bear in mind that your risk tolerance should play a role in your decision. If having nearly half your retirement funds in stocks will give you ulcers, then feel free to reduce your exposure for your own peace of mind.

History has shown that, over any economic cycle, stocks outperform every other asset class. So retirees and investors nearing retirement shouldn't have too much exposure to stocks; but for those with a substantial amount of time to ride out market highs and lows, stocks are the best place for the majority of your retirement investments.

Second, shifting some of your money to bonds and other fixed-income instruments should be a deliberate and timed process; you shouldn't start buying them simply because you've reached a certain age. There are good and bad times for buying fixed-income investments, and they have nothing to do with your age. A better idea is to buy bonds when interest rates are high and avoid them when interest rates are low (like they are now).

As of this writing, the average yield for 30-year Treasuries is 3.28%. While this is definitely higher than the record lows seen in 2012-2013, it's still low on a historical basis, as you can see in the chart below.

30 Year Treasury Rate Chart

As rates rise, the value of bonds drops. It's not a one-to-one formula, but longer-expiration bonds are affected more. For instance, if 30-year rates were to rise to 4%, the market value of existing Treasuries would fall in order to produce the 4% yield that investors now expect.

Once the Fed starts raising rates and bond yields rise substantially, it may be a good idea to shift some money to bonds in order to lock in high rates. However, in the meantime, there's too much potential to see your principal erode.

Boost your savings
Of course, the most surefire way to make sure you have enough money to last through your retirement is to save up as much as possible before you leave the workforce. Even if you're having a tough time finding extra money to set aside, something as simple as increasing your 401(k) contributions at work could make an enormous difference. And it's a good idea to start thinking about your current expenses and where you could possibly cut back to find some more money to set aside. (Here, for example, are 15 things you could stop wasting money on).

The bottom line is that you shouldn't underestimate small increases in your retirement savings. Let's say that, as a cost-cutting measure, you decide to go out for dinner two fewer times per month, saving you $50 per month (or $600 per year). Over the course of 20 years, this small sacrifice alone would result in an extra $30,000 in retirement savings, assuming 8% average annual returns (the S&P has averaged 9.8% during the past 20 years).

So save a little more and set your investment portfolio up for success. This should produce a nice nest egg for your retirement. In addition, some smart budgeting should ensure that your money lasts at least as long as you do, if not longer.