With the stock market nearing all-time highs and the up 5.4 percent year to date, some retirement savers are feeling pretty good about their nest eggs. And rightfully so: The number of Fidelity 401(k) plans with a balance of $1 million or more jumped to a record 168,000 in the second quarter, up from 119,000 a year earlier. That's a 41 percent surge.

"The stock market's performance over the past several years has definitely helped retirement savers, but now would be a good time for investors to take a moment and make sure they are doing their part to meet their retirement goals," Kevin Barry, president of workplace investing at Fidelity Investments, said in a statement. About 3 in 10 savers increased their contribution rate during the last year, Fidelity found. The average 401(k) contribution rate is now 8.6 percent as of the second quarter, the highest percentage in almost 10 years and up from 8.5 percent last year — not including the employer match.

More employees are putting enough away to get the company match, Fidelity said, particularly millennials, who know they likely will not be eligible for pensions or other types of guaranteed benefits many current retirees enjoy. In addition, the number of 18-to-34 year-olds making contributions to an individual retirement account increased 19 percent from a year ago. Average retirement savings balances are now in the six figures, according to Fidelity. The average 401(k) balance is $104,000, just shy of the all-time high balance of $104,300 from the end of 2017, while the average IRA balance is $106,900 as of the second quarter, Fidelity found.