The GAN_Server loop is most efficient when the number of merchants / advertisers with at least one compatible ad exceeds the number of ads specified for an ad unit. The GAN_Server loop will loop though the merchants / advertisers just once. If the number of ad requested for the ad unit is greater than the number of merchants / advertisers with compatible ads, it will loop though the merchants / advertisers ad many times as needed to fill the ad unit. Thus if you only have two merchants / advertisers and have an ad unit with 6 ads, it will loop though the merchant / advertiser list 3 times, with two inner loop cycles per outer loop cycle.
Note: if you have merchants / advertisers who don't have compatible ads (compatible: banner size or banner vs. text) it will still do lookups (possibly multiple lookups) with those merchants / advertisers -- this will take time. If you have a 468x60 banner ad unit calling for 4 banners and if you have 10 merchants / advertisers, but only 2 have 468x60 banner ads, the ad server (GAN_Server.php) will loop through all 10 merchants / advertisers twice, that is it will make 20 MySQL lookups, 16 of which will return in empty results. You would either need to reduce the number of ads displayed in this ad unit or get 468x60 banner ads for more of the merchants / advertisers.
It is possible that you have set the number of ads in one or more of your ad units too high (too many ads per unit). You can try reducing the number of ads per ad unit.