If more people from one router come to the site, the response time is exceeded and as a result they lose the connection.

What could be the problem? Error browser gives (timeout from server)

  • The site works fine, the problem appears only when more than 5-8 people start working with it.
    1. Written in PHP, all requests go through AJAX ...
    2. Tracert did (at the manifestation of this error), the delay is only at the beginning, ie when the button is pressed and the request is sent ... after which everything starts to work normally ...
    3. They were contacted with Tech Support ... the problem was not found there
    4. The ISP was contacted ... the problem was not found there either

Help please, I do not know where to dig ... Example JS-AJAX

$(document).on("change","#section select", function() {checkStreet();showCreatePeopleCardButton();}) function openPeopleSondaj(id){ $.ajax({ url: "api/opensondaj.php", type: "POST", data: ({ sondaj : id }), success: function(data){ $("#sondaj").css('top', ($(window).scrollTop()+100)+"px"); $("#sondaj").removeClass("hidden"); $("#sondaj").append(data); }, }); } function checkStreet(){ var section = $("#section select").val(); $.ajax({ url: "api/filter.php", type: "POST", data: ({ section : section }), success: function(data){ showStreet(data); }, }); } 

PHP example

  <?php session_start(); if(isset($_POST['section'])){ $section = $_POST['section']; $_SESSION['section'] = $section; require_once 'db/con.php'; // ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π°Π΅ΠΌ скрипт $link = mysqli_connect($host, $user, $password, $database)or die("Ошибка ".mysqli_error($link)); mysqli_set_charset($link, "utf8"); $sql = "SELECT * FROM section_street WHERE section = '{$section}' ORDER BY `street`"; $result = mysqli_query($link, $sql); $arr = "<option></option>"; while ($row = mysqli_fetch_array($result)) { $arr .= "<option street='{$row['street']}' house='{$row['house']}'>{$row['street']} {$row['house']}</option>"; } echo $arr; } else if(isset($_POST['street'])&&isset($_POST['house'])){ if(isset($_POST["tel_num"])&&$_POST["tel_num"]=="true"){$tel_num = "AND ((LENGTH(`mob_gsm`)>1) OR (LENGTH(`fix_gsm`)>1))";}else{$tel_num = "";} $street = $_POST['street']; $house = $_POST['house']; $_SESSION['street'] = $street; $_SESSION['house'] = $house; require_once 'db/con.php'; // ΠΏΠΎΠ΄ΠΊΠ»ΡŽΡ‡Π°Π΅ΠΌ скрипт $link = mysqli_connect($host, $user, $password, $database)or die("Ошибка ".mysqli_error($link)); mysqli_set_charset($link, "utf8"); $sql = "SELECT * FROM peoples WHERE street = '{$street}' AND house = '{$house}'".$tel_num." ORDER BY street,house,housing,apartment"; $result = mysqli_query($link, $sql); if($_SESSION["work"]=="bigboss"||$_SESSION["work"]=="boss"){ $arr = "<table id='2excel'><tr><td style='width: 200px;'>Adresa</td><td>Nume, Prenume</td><td>Atingeri</td><td style='width: 60px;'>Actiuni</td></tr>"; }elseif($_SESSION["work"]=="manager"||$_SESSION["work"]=="agitator"){ $arr = "<div id='export-btn'>Export</div><table id='2excel'><tr><td style='width: 200px;'>Adresa</td><td>Nume, Prenume</td><td class='hidden'>Social</td><td class='hidden'>Plecati</td><td class='hidden'>Indispusi</td><td style='width: 180px;' class='noExl'>Actiuni</td></tr>"; }else{ $arr = "<table id='2excel'><tr><td style='width: 200px;'>Adresa</td><td>Nume, Prenume</td><td style='width: 180px;'>Actiuni</td></tr>"; } $adress =""; $class=""; while ($row = mysqli_fetch_array($result)) { $adress = " casa: ".$row['house']; if($row['housing']!="")$adress.="/".$row['housing']; if($row['apartment']!="")$adress.=" ap. ".$row['apartment']; IF($row['mob_gsm']!=""||$row['fix_gsm']!=""){ $replace = array(' ','-'); $mob = $row['mob_gsm']==""?".":substr(str_replace($replace,'',str_replace('+373','0',$row['mob_gsm'])),0,9); $fix = $row['fix_gsm']==""?".":substr(str_replace($replace,'',str_replace('+373','0',$row['fix_gsm'])),0,9); $class = "green"; $sql_calls = "SELECT COUNT(`id`) FROM `calls` WHERE (`phone`='{$mob}' OR `phone`='{$fix}') AND `dialog_time_sec`>0"; $result_calls = mysqli_query($link, $sql_calls); $row_calls = mysqli_fetch_assoc($result_calls); if($row_calls['COUNT(`id`)']>0){ $calls = "<div class='calls'><div class='calls_text'>".$row_calls['COUNT(`id`)']."</div></div>"; } $sql_missed_calls = "SELECT COUNT(`id`) FROM `calls` WHERE (`phone`='{$mob}' OR `phone`='{$fix}') AND `dialog_time_sec`=0"; $result_missed_calls = mysqli_query($link, $sql_missed_calls); $row_missed_calls = mysqli_fetch_assoc($result_missed_calls); if($row_missed_calls['COUNT(`id`)']>0){ $calls .= "<div class='missed_calls'><div class='calls_text'>".$row_missed_calls['COUNT(`id`)']."</div></div>"; }else{ $calls .= ""; } $sql_sondaje = "SELECT COUNT(`id`) FROM `sondaj_peoples_results` WHERE `people_id`='{$row['id']}' AND `sondaj_item_id`!=0"; $result_sondaje = mysqli_query($link, $sql_sondaje); $row_sondaje = mysqli_fetch_assoc($result_sondaje); if($row_sondaje['COUNT(`id`)']>0){ $calls .= "<div class='done_sondaje'><div class='calls_text'>".$row_sondaje['COUNT(`id`)']."</div></div>"; }else{ $calls .= ""; } }else{ $class = "class='empty'"; $calls = ""; } if($row['bussy']=="da"){$class=" red";} if($row['plecat']=="da"){$class=" white";} if($_SESSION["work"]=="bigboss"||$_SESSION["work"]=="boss"){ $arr .= "<tr class='{$class}'><td>{$adress}</td><td>{$row['name']} {$row['surname']} </td><td>{$calls}</td><td><div class='inline view' id='{$row['id']}'></div></td></tr>"; }elseif($_SESSION["work"]=="manager"||$_SESSION["work"]=="agitator"){ $arr .= "<tr class=' {$class}'><td>{$adress}</td><td>{$row['name']} {$row['surname']} </td><td class='hidden'>{$row['social']}</td><td class='hidden'>{$row['plecat']}</td><td class='hidden'>{$row['bussy']}</td><td class='noExl'><div class='inline sondaj_action' id='{$row['id']}'></div><div class='inline action' id='{$row['id']}'></div></td></tr>"; }else{ $arr .= "<tr class=' {$class}'><td>{$adress}</td> <td>{$row['name']} {$row['surname']} </td><td><div class='inline sondaj_action' id='{$row['id']}'></div><div class='inline action' id='{$row['id']}'></div></td></tr>"; } $calls = ""; } $arr.="</table>"; echo $arr; } else{ echo "Access forbiden."; } ?> ΠŸΡ€ΠΎΡˆΡƒ Π½Π΅ судитС строго(ΡΡ‚ΠΈΠ»ΡŒ программирования), ΠΎΠΏΡ‹Ρ‚Π° Ρƒ мСня Π½Π΅ ΠΌΠ½ΠΎΠ³ΠΎ ... 
  • What do you mean by a router? Do you mean a program that issues a page depending on the URL, or a physical router? - ishidex2
  • + Show the code of your requests, and php too, otherwise it is not clear how they will help you. - ishidex2
  • Thanks for the responsiveness, made the edit - added 1 example and JS + AJAX and PHP - Adrian Golub
  • I have a physical router ... - Adrian Golub
  • requests in cycles is a very bad idea - teran

0