A simile is a figure of speech that directly compares two unlike things using the words "like" or "as." In this case, the speaker is comparing the size of the tonsils to the size of rocks, using the word "as" to make the connection.
This simile effectively paints a picture of how large and uncomfortable the tonsils are, adding to the humorous exaggeration of the poem.