一段时间后,XAMPP变得非常缓慢

Does anyone ever encounter the MYSQL in XAMPP being super slow after sometime?

I have a unity application that asking a string to be downloaded with this php script.

<?php
include 'Config.php'; // Just a normal mysqli connection setup


    //the post from Unity.
    $var_uniqueID       = $_POST['uniqueID_Post'];

    $conn = OpenCon(); // open connection

    //create a query
    $sql = "SELECT 
                var_name,
                var_value
            FROM variable_current_values
            WHERE uniqueID = '".$var_uniqueID."' ";

    $result = mysqli_query($conn, $sql);



    if( mysqli_num_rows($result) > 0)
    {
        //show data for each row
        while($row = mysqli_fetch_assoc($result))
        {
            echo "".$row['var_name'] . 
                 "|".$row['var_value'] . "";
        }
    }

    CloseCon($conn); // close the connection
?>

This PHP script is being called with c# script of UnityWebRequest

    //www variable
    private UnityWebRequest unityWebRequest;

    void Update ()
    {
        if (unityWebRequest == null)
        {
            //fetch The data Widget
            StartCoroutine(RealDataFetchWhere(this.name)); 
        }
    }

    private IEnumerator RealDataFetchWhere(string _uniqueIDPost)
    {
        //gives the unique key
        WWWForm fetchingForm = new WWWForm();
        fetchingForm.AddField("uniqueID_Post", _uniqueIDPost);


        //load and wait until the data is downloaded
        unityWebRequest = UnityWebRequest.Post(**thePHPLink**, fetchingForm);
        yield return unityWebRequest.SendWebRequest();

        string data = unityWebRequest.downloadHandler.text;
        print("the Data is : " + data); 

    }

At first everything seems to be fine. Data is downloaded perfectly(almost in realtime speed).

However after like more than 10 minutes, the XAMPP mySQL starting to slow down considerably.
I try to modified the data manually in XAMPP and it takes about 5 - 8 seconds until the "row is affected"
If i leave them longer without closing my unity program, XAMPP start to freeze and disconnected.

Does anyone know the solutions to counter this problem ?

douya7309
douya7309 您是否在没有Unity作为端点的情况下进行了测试你能用curl这样的东西连接到那个端点吗?如果是这样,减速仍然会发生吗?
大约一年之前 回复
dousuize3082
dousuize3082 ..除了查询中可能的SQL注入...
大约一年之前 回复
doulu5717
doulu5717 也许这有助于dba.stackexchange.com/questions/53229/...
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问