Routing protocols can decide for data packets which route is reachable and co-optimal, and may cause data packets to swarm into certain links, thus causing congestion on those links. General traffic engineering (GTE) technology provides ER-LSP/CR-LSP in MPLS networks to avoid this kind of congestion. However, GTE takes only the current data flow into account and establishes an ER-LSP/CR-LSP for this current data flow in order to guarantee QoS. Although this could resolve the issue raised by routing protocols, it may also waste some resource. In this article we focus on optimization of traffic engineering and propose an automatic traffic balance algorithm based on GTE technology.