I would take the time to research this somewhere besides this board. You will get many opinions here, few of which are based on much fact. I would suggest http://www.high-altitude-medicine.com/ as a starting point.
Side effects: Yes, ranging from very minor to death. One of the worst is that it makes beer taste like crap.
When to take: I don't know. I personally have only used it once, after symptoms started. It seemed to help. (But that is hardly proof of anything.)
I don't use it personally (used once) but would advise you to try it two weeks or so before traveling so you get to know the symptoms and side effects before getting up high. Then you won't confuse them with other things that will be going on with your body at that point. Cheers William