Am I gaining too much?

So yesterday I went to the doctor and of course being pregnant I gained weight(only time in my life I've ever been able to gain because of high metabolism). At 17 weeks I've gained a total of 9 lbs. the doctor got a little rude and didn't ask me anything just told me to lay off the pop and junk food because I'm gaining too much weight. Now I was a little under weight to begin with and I do limit myself a lot of certain drinks and food that I know aren't healthy. I don't just sit around and eat potato chips and chocolate all day. My question is this, is that really too much weight to have gained so far? Or was she just being rude?