WvW is a good place to learn how to run away from large mobs. Or at least, to learn which areas of the mob is dangerous, and which areas is safer to attack from.
If you want to live, then as melee your job is to separate foes from the herd and take them out. You can generate enough threat and confusion that they run in the wrong direction, then your pack can make an easy kill of it. Or you can stick to ranged to pick them off from a safer distance.
If you decide to play frontline, then keep a close eye on your health. If you decide to AoE in the middle of a mob, then good luck.