title: Mysql returns same rows when sending fast request
body: <p>I discerned that sometimes Mysql returns totally same data (occasionally). i.g: <a href="https://prnt.sc/10ppiyf" rel="nofollow noreferrer">https://prnt.sc/10ppiyf</a></p>
  <p>I have a basic Php pdo query to get Mysql rows for my pagination:</p>
  <pre><code>$pdo-&gt;query(&quot;SELECT * from posts order by id desc LIMIT {$limit} OFFSET {$offset}&quot;);
  </code></pre>
  <p>I send total 1000 pagination requests in a loop, every 500 ms (to test system). My test url is, localhost/test.php?page=1 (page increasingly goes on in a loop up to 1000). App server and db server run on diffirent server. In this secenerio, the answer of request returns returns same rows/results (sometimes).</p>
  <p><strong>If app and db run on the same Vps</strong>, each request's answer is unique (as it should be). or <strong>if i raised the ms (500 to 1500)</strong>, again each request's answer is unique.</p>
  <p>how can i understand datas are duplicate or not?
  Php saves answer of request datas a file and I check it (<a href="https://prnt.sc/10ppiyf" rel="nofollow noreferrer">https://prnt.sc/10ppiyf</a>).</p>
  <p>System details;</p>
  <ul>
  <li>Mysql posts table (innodb) have +10K rows.</li>
  <li>DB and script run on diffrent Vps.</li>
  <li>Vps are Ubuntu and, Mysql is a default installed db ( there is no any private conf).</li>
  <li>This DB and app are not used by anyone. Just I, use for reading data (no inserting),</li>
  <li>When test script was running, I control the machine Cpu and Ram was okay (%1).</li>
  </ul>
  <p>How works my test case;</p>
  <ul>
  <li>A node script sends a request to app server like localhost.com/test.php?page=1  (<a href="https://prnt.sc/10ps4ey" rel="nofollow noreferrer">https://prnt.sc/10ps4ey</a>)</li>
  <li>App server gets page param and, sends a</li>
  <li>query to db server, db server sends answer and, app server saves data</li>
  <li>answer a file. then, i check the file.</li>
  </ul>
  <p>If you want to see my php codes;</p>
  <pre><code>// request is sent by me automatically each 500 ms order by order 1,2,3,4
  $page = (int) $_GET['page'];
  if(!$page or $page == 0)
      $page   = 1;
  
  $perPage        = 10;
  $limit          = 10;
  
  $offset         = ($page * $perPage) - $perPage;
      
  $pdo            = new PDO('mysql:host=HOST;dbname=db', &quot;user&quot;, &quot;userp&quot;);
  $pdo-&gt;query(&quot;SELECT * from posts  order by id DESC LIMIT {$limit} OFFSET {$offset}&quot;);
  $posts          = $stm-&gt;fetchAll(PDO::FETCH_ASSOC);
  </code></pre>
  <p>What is your solution dear experienced friends?</p>
  <p><strong>UPDATE:</strong></p>
  <p>I use CloudFlare proxy (protection) front of my web site. If I disable CloudFlare Proxy, the number of duplicate data is decreasing.</p>