In this work the service performance of magnesium sacrificial anodes used to protect urban gas pipelines from corrosion were investigated by both field tests and laboratory measurements. It was found that the consumption of magnesium sacrificial anode increases with increasing service time and the poorer coating performance. Moreover the more negative the open circuit potential of magnesium sacrificial anode the larger the consumption will be. And it is worth noting that the positive shift of pipeline open circuit potential(Vopc-pp) leads to the decrease of consumption whenVopc-p is more negative than -1.2V CSE. When Vopc-p is nobler than -1.2V CSE the positive shift of Vopc-p however will result in the increase of consumption. Based on the field tests and laboratory experiments results the mechanisms were explored which are of great value for the maintenance and lifetime prediction of sacrificial anode in urbangas pipelines CP system.