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.)