Limit id to queue size.