The US trade deficit rose to its third-highest level on record in August, with imports of Chinese goods including textiles reaching new levels, according to a government report.