Amazon, which has historically struggled with profitability while spending to expand beyond its core online marketplace offerings, reined in costs and was helped to profitability by growth at its Amazon Web Services (AWS) segment. Olsavsky said the company would continue to invest in areas that work with customers, adding that even though investments would “remain very high” Amazon would be looking for ways to cut costs. Net sales from Amazon Web Services, which has more than 1 million active customers in 190 countries, rose more than 78 percent in the quarter to $2.09 billion.