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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试,帮帮忙吧
    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建