You really don't need to shake it up that much. I just put in a half-gallon or so, and twist the carboy around, making sure the liquid contacts every part of the interior. Then I pour it back into my Star San jug, and slap some foil over the mouth of the carboy until I'm ready to pump the wort in.
Like others have said...don't sweat it! Most of the foam will climb out...some of it will shinny up the tubing like a snake, and the rest will drip to floor and make a clean spot! Whatever remains in the carboy will help nourish your yeast.