New York (CNN Business) Walmart CEO Doug McMillon's total compensation reached nearly $24 million during the last year as the company continued to hold its ground against Amazon and other rival retailers.

McMillon's salary was about $1.3 million and he was eligible for stock awards based on performance and values at $15.6 million. He is also eligible for about $6.7 million in incentives and other forms of compensation.

That's about 3.5% more than McMillon's total compensation in the prior fiscal year. It's also 1,076 times more than what Walmart's median worker made. Workers got a raise, too: The median worker made nearly $22,000 last year, a 14.5% increase. That means the ratio between McMillon's pay and the median Walmart worker was actually about 9% smaller than a year prior.

"We are a pay-for-performance company and heavily link our executive compensation program to the company's operating performance and our strategic priorities," said Walmart spokesperson Randy Hargrove. He noted that 76% of McMillon's compensation is contingent on performance goals that have not been met yet. McMillon has been CEO since 2014.

The company's stock dropped about 10% during the last fiscal year. But Walmart's overall sales grew 3%, and digital sales ballooned 40%. Walmart's all-important holiday sales blew past expectations, too.

Read More