Investors desperately seeking diversification amid all the volatility in stocks both in the U.S. and abroad found some salvation in commodities last month as 15 of 19 constituents in the Dow Jones-UBS Commodity Index gained ground.

The paralyzing combination of the U.S. debt ceiling debate, compromise and subsequent debt rating downgrade and prolonged uncertainty surrounding Europe's own debt crisis conspired to drive stocks down throughout the month, giving institutional investors every reason to move money into commodities-based funds and indices.

"Commodities posted broad-based gains in July, outperforming equities due to a combination of demand for hard assets and generally tight supply conditions, Nelson Louie, Global Head of Commodities at Credit Suisse Asset Management, said in a statement. "However, prolonged uncertainty surrounding the European debt crisis and U.S. monetary and fiscal policy has contributed to increased volatility in commodities markets and widespread risk aversion."

Not surprisingly, precious metals led the charge last month, rallying up 10.1% as investors snapped up gold as a reserve currency alternative. Industrial metals, buoyed by strong demand from China, moved higher while livestock and agriculture moved up 3.1% and 2.8%, respectively, for the month.

Energy was the only sector to post a loss for the month, losing 0.83%. Crude oil was relatively unchanged, despite gasoline and heating oil posting gains of 4.39% and 4.66%, respectively. Strong U.S. onshore production and increasing Canadian imports amid a constrained infrastructure system depressed West Texas Intermediate (WTI) crude despite tight supply in global markets, contributing to increasingly strong margins for refined products in the U.S.

Lumped together, the Dow Jones-UBS Commodity Index Total Return rose 2.96% for the month.

"In the long term, we believe commodities will continue to offer value for investors despite risk aversion and potential volatility across capital and commodity markets," said Christopher Burton, senior portfolio manager for the Credit Suisse Total Commodity Return Strategy. "Political disagreements and elevated government debt levels in Europe and the U.S. pose risks to derailing the global economic recovery."

"The uncertainty surrounding this can impact traditional asset classes and commodities differently," he added. "Therefore, we believe investors will continue to benefit from the diversification benefits that commodities provide."