<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<div>
<div>&#43;Shay</div>
<div>See question regarding clock synchronization&nbsp;</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="font-size:9px; color:#575757">Sent from my Samsung Galaxy smartphone.</div>
</div>
<div></div>
<br>
<br>
-------- Original message --------<br>
From: Eric Wittmann &lt;eric.wittmann@redhat.com&gt; <br>
Date:19/01/2016 21:53 (GMT&#43;02:00) <br>
To: &quot;Vax, Uri&quot; &lt;uvax@informatica.com&gt;, Jakub Čecháček &lt;jcechace@gmail.com&gt; <br>
Cc: apiman-user@lists.jboss.org <br>
Subject: Re: [Apiman-user] Rate-limit policy does not work in APIMan cluster <br>
<br>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi Uri.<br>
<br>
I just did some testing on a couple of machines and everything worked as <br>
expected for me.<br>
<br>
However, I wonder if perhaps you don't have your two servers <br>
time-sync'd?&nbsp; If the times aren't the same on all the servers, then the <br>
time-window logic in the rate limiting code will be inconsistent at best.<br>
<br>
I initially had some trouble with this, but once I installed ntp on both <br>
my machines then everything worked fine.<br>
<br>
-Eric<br>
<br>
On 1/19/2016 9:55 AM, Vax, Uri wrote:<br>
&gt; apiman.properties files attached .<br>
&gt;<br>
&gt; Talinux3 = Node1<br>
&gt; Talinux1 = Node2<br>
&gt;<br>
&gt; -----Original Message-----<br>
&gt; From: Eric Wittmann [<a href="mailto:eric.wittmann@redhat.com">mailto:eric.wittmann@redhat.com</a>]<br>
&gt; Sent: Tuesday, January 19, 2016 3:57 PM<br>
&gt; To: Vax, Uri; Jakub Čecháček<br>
&gt; Cc: apiman-user@lists.jboss.org<br>
&gt; Subject: Re: [Apiman-user] Rate-limit policy does not work in APIMan cluster<br>
&gt;<br>
&gt; Are you 100% sure that the Gateway on Node1 and Node2 are sharing the same Elasticsearch instance?&nbsp; From your description it sounds like perhaps they are not (e.g. the rateBucket being initialized after the request to Node2).<br>
&gt;<br>
&gt; Perhaps you could send us the apiman.properties files from *each* of your two nodes?<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Eric<br>
&gt;<br>
&gt; On 1/18/2016 9:03 AM, Vax, Uri wrote:<br>
&gt;&gt; The cluster:<br>
&gt;&gt;<br>
&gt;&gt; Two Linux machines<br>
&gt;&gt;<br>
&gt;&gt; *Node1*: Gateway &#43; Manager &#43; Elastic Search<br>
&gt;&gt;<br>
&gt;&gt; *Node2*: Gateway<br>
&gt;&gt;<br>
&gt;&gt; Node1 and Node2 share same Elastic Search.<br>
&gt;&gt;<br>
&gt;&gt; Maybe I missing something?<br>
&gt;&gt;<br>
&gt;&gt; By the way… not sure, but I noticed that the value of *rateBucket* has<br>
&gt;&gt; been initialized after the request to Node2<br>
&gt;&gt;<br>
&gt;&gt; {<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;_index&quot;: &quot;apiman_gateway&quot;,<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;_type&quot;: &quot;rateBucket&quot;,<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;_id&quot;: &quot;UFVCTElDfHx8fGxvY2FsfHxzfHwxLjA=&quot;,<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;_score&quot;: 1,<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;_source&quot;: {<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;count&quot;: 1,<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;last&quot;: 1453115651374<br>
&gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;<br>
&gt;&gt; *From:*Jakub Čecháček [<a href="mailto:jcechace@gmail.com">mailto:jcechace@gmail.com</a>]<br>
&gt;&gt; *Sent:* Monday, January 18, 2016 3:33 PM<br>
&gt;&gt; *To:* Vax, Uri<br>
&gt;&gt; *Cc:* apiman-user@lists.jboss.org<br>
&gt;&gt; *Subject:* Re: [Apiman-user] Rate-limit policy does not work in APIMan<br>
&gt;&gt; cluster<br>
&gt;&gt;<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; could you please describe the setup/topology of your &quot;cluster&quot;?&nbsp; The<br>
&gt;&gt; HA setup of apiman takes advantage of the fact that state is shared<br>
&gt;&gt; only inside ES -- so you should be good as long as you share one ES<br>
&gt;&gt; cluster among all gateways. Thus it is not really a cluster.<br>
&gt;&gt;<br>
&gt;&gt; Jakub.<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jan 18, 2016 at 1:10 PM, Vax, Uri &lt;uvax@informatica.com<br>
&gt;&gt; &lt;<a href="mailto:uvax@informatica.com">mailto:uvax@informatica.com</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi<br>
&gt;&gt;<br>
&gt;&gt; I’m using APIMan 1.1.9.<br>
&gt;&gt;<br>
&gt;&gt; It seems like Rate-limit policy does not work properly when there are<br>
&gt;&gt; several nodes (node1, node2).<br>
&gt;&gt;<br>
&gt;&gt; *_The scenario:_*<br>
&gt;&gt;<br>
&gt;&gt; ·Setup up an APIMan cluster with two nodes (node1 , node2).<br>
&gt;&gt;<br>
&gt;&gt; ·Create a service with a rate-limit policy of 5 request per minute<br>
&gt;&gt;<br>
&gt;&gt; ·Send requests to the service using postman (or any other http client):<br>
&gt;&gt;<br>
&gt;&gt; oSend requests to node1 until rate limit is exceeded<br>
&gt;&gt;<br>
&gt;&gt; oSend another request to node2 – APIMan will pass the request to the<br>
&gt;&gt; service end-point API instead of returning the “Rate limit exceeded”<br>
&gt;&gt; response<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt;<br>
&gt;&gt; Uri<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Apiman-user mailing list<br>
&gt;&gt; Apiman-user@lists.jboss.org &lt;<a href="mailto:Apiman-user@lists.jboss.org">mailto:Apiman-user@lists.jboss.org</a>&gt;<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/apiman-user">https://lists.jboss.org/mailman/listinfo/apiman-user</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Apiman-user mailing list<br>
&gt;&gt; Apiman-user@lists.jboss.org<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/apiman-user">https://lists.jboss.org/mailman/listinfo/apiman-user</a><br>
&gt;&gt;<br>
_______________________________________________<br>
Apiman-user mailing list<br>
Apiman-user@lists.jboss.org<br>
<a href="https://lists.jboss.org/mailman/listinfo/apiman-user">https://lists.jboss.org/mailman/listinfo/apiman-user</a><br>
</div>
</span></font>
</body>
</html>