Rotherham romped to a three-goal lead in 35 minutes as they ran Gillingham ragged, notching up nine corners.
Kieran Agard's goal-bound shot was blocked after eight minutes, but a minute later Rotherham were in front. Alex Revell headed on and on-loan Nouha Dicko controlled in the area before firing home.
Fourteen minutes later the Millers doubled their lead. Revell headed down Ben Pringle's cross and Agard blocked Gillingham's attempted clearance before firing home.
And in the 35th minute a fine solo run by Pringle produced Rotherham's third. He picked the ball up in the centre circle and with everyone expecting a pass he went straight through the Gillingham defence and fired beyond Gillingham keeper Stuart Nelson.
Gillingham did not manage an effort on target in the first half, but Rotherham were not so shot-shy and an effort by on-loan debutant James Tavernier was well saved by Nelson after 52 minutes.
But Adebayo Akinfenwa's introduction after 65 minutes brought some relief for Gillingham. He sent Cody McDonald away and the latter went through the heart of the home defence and beat home keeper Adam Collin.
But 10 minutes later Rotherham restored their three-goal advantage. A clever pass over the defence picked out Tavernier just inside the box and this time the Newcastle defender made no mistake.