Added environment variable consideration for max queue size.