[
https://issues.apache.org/jira/browse/BROOKLYN-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15681918#comment-15681918
]
ASF GitHub Bot commented on BROOKLYN-394:
-----------------------------------------
Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/448#discussion_r88812917
--- Diff:
locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/JcloudsRateLimitedRetryLiveTest.java
---
@@ -0,0 +1,131 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.location.jclouds;
+
+import java.util.List;
+import java.util.concurrent.Executors;
+
+import org.apache.brooklyn.util.collections.MutableMap;
+import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.common.collect.Lists;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+
+/**
+ * Tests provisioning machines, where it causes a lot of activity (in an
effort to be
+ * rate-limited!). We expect the retry to do suitable exponential backoff
that the retries
+ * eventually succeed, provisioning all the machines without error.
+ */
+public class JcloudsRateLimitedRetryLiveTest extends
AbstractJcloudsLiveTest {
+
+ private static final Logger LOG =
LoggerFactory.getLogger(JcloudsRateLimitedRetryLiveTest.class);
+
+ public static final String LOCATION_SPEC = "jclouds:" +
AWS_EC2_PROVIDER + ":" + AWS_EC2_USEAST_REGION_NAME;
+
+ // Image: {id=us-east-1/ami-7d7bfc14, providerId=ami-7d7bfc14,
name=RightImage_CentOS_6.3_x64_v5.8.8.5, location={scope=REGION, id=us-east-1,
description=us-east-1, parent=aws-ec2, iso3166Codes=[US-VA]},
os={family=centos, arch=paravirtual, version=6.0,
description=rightscale-us-east/RightImage_CentOS_6.3_x64_v5.8.8.5.manifest.xml,
is64Bit=true},
description=rightscale-us-east/RightImage_CentOS_6.3_x64_v5.8.8.5.manifest.xml,
version=5.8.8.5, status=AVAILABLE[available], loginUser=root,
userMetadata={owner=411009282317, rootDeviceType=instance-store,
virtualizationType=paravirtual, hypervisor=xen}}
+ public static final String AWS_EC2_CENTOS_IMAGE_ID =
"us-east-1/ami-7d7bfc14";
+
+ protected ListeningExecutorService executor;
+
+ @BeforeMethod(alwaysRun=true)
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ executor =
MoreExecutors.listeningDecorator(Executors.newCachedThreadPool());
+ }
+
+ @AfterMethod(alwaysRun=true)
+ @Override
+ public void tearDown() throws Exception {
+ try {
+ super.tearDown();
+ } finally {
+ if (executor != null) executor.shutdownNow();
+ }
+ }
+
+ @Test(groups = {"Live", "Acceptance"})
+ public void testCreateOne() throws Exception {
+ doMany(1);
+ }
+
+ @Test(groups = {"Live", "Acceptance"})
--- End diff --
I marked this as "Acceptance" as well because I really don't think we
should be running tests to induce rate-limiting very often, and should not be
provisioning 20 VMs in a single test often either.
We should revisit our testng groups/profiles to make these more useful
longer term.
> "Request limit exceeded" on Amazon
> ----------------------------------
>
> Key: BROOKLYN-394
> URL: https://issues.apache.org/jira/browse/BROOKLYN-394
> Project: Brooklyn
> Issue Type: Bug
> Reporter: Svetoslav Neykov
>
> Any moderately sized blueprint could trigger {{Request limit exceeded}} on
> Amazon (say kubernetes). The only way users have control over the request
> rate is by setting {{maxConcurrentMachineCreations}} with the current
> recommended value of 3 (see clocker.io).
> It's bad user experience if one needs to adapt the location based on the
> blueprint.
> Possible steps to improve:
> * Add to troubleshooting documentation
> * Make maxConcurrentMachineCreations default to 3
> * Check are we polling for machine creation too often.
> * Check how many requests are we hitting Amazon with (per created machine)
> * The number of requests per machine could vary from blueprint to blueprint
> (say if the blueprint is creating security networks, using other amazon
> services). Is there a way to throttle our requests to amazon and stay below a
> certain limit per second?
> * I've hit the error during machine tear down as well, so
> {{maxConcurrentMachineCreations}} is not enough to work around
> Some docs on rate limits at
> http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html.
> Related: https://github.com/jclouds/legacy-jclouds/issues/1214
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)