Sent in to bat by the touring side, South Africa posted 307 for six in their 50 overs before restricting Sri Lanka to 186 all out from 37.5 overs to take a 2-0 lead in the five-match series.
It was an eighth ODI victory in a row for South Africa and an 11th win in succession at home as they showed form in the build-up to the Champions Trophy in England in June.
Their innings was built around tons for Du Plessis (105 from 120 balls) and the more explosive Miller (117 not out from 98 balls) as the pair put on 117 for the fifth wicket having come together with the home side teetering at 108 for four.
Miller struck six sixes and was particularly severe on the Sri Lankan seamers as he blasted a second unbeaten ODI century in three innings and a fourth ton of his career.
Sri Lanka made a spirited start to their chase, but when they lost openers Niroshan Dickwella (25) and Upul Tharanga (26) to brilliant catches by Du Plessis and AB de Villiers respectively, both off the bowling of left-arm seamer Wayne Parnell, it became a procession of wickets.
Du Plessis leapt at cover to grab the ball one-handed well above his head while De Villiers sprinted towards the boundary and dived to grab the ball out of the warm Durban sky as it threatened to fall to safety.
Leg-spinner Imran Tahir (2-26 in 8.5 overs) was again the pick of the home bowlers.
The third one-dayer will be played at The Wanderers in Johannesburg on Saturday.