dqy012345 2019-06-14 10:23
浏览 567

一段时间后,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 ?

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥50 树莓派安卓APK系统签名
    • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题
    • ¥20 求一个html代码,有偿
    • ¥100 关于使用MATLAB中copularnd函数的问题
    • ¥20 在虚拟机的pycharm上
    • ¥15 jupyterthemes 设置完毕后没有效果
    • ¥15 matlab图像高斯低通滤波
    • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗