We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40045
    • 534 Posts
    I have a site which normally loads under 1 second but has occasional slowness attacks (seemed completely random) where the site loads in over 30s or even an error like server capacity reached is thrown after waiting (probably php max execution time)...I'm still not quite sure, but I just had such an attack when working in a migxDB grid with around 1600 records (trying the filter/csv export improvement from MIGX 2.5.2), so the question came up, if these slowness attacks could have something to do with MIGX working (or hanging) on something and completely blocking the servers resources (2 cores, 4GB ram)?

    it actually happened, while trying to only export the subset of records that I pull in a specific resource, so from the 1600 records only 23 are shown in that grid (and only 23 should be exported), but when I export (without touching the dbfilter field), all 1600 get exported (no speed problems so far) and not only the 23 which are displayed in the grid.

    I modified the filter JSON to

    {"songcharts:=":"1","AND:songid:LIKE":"%[[+search]]%","OR:artistname:LIKE":"%[[+search]]%","OR:songtitle:LIKE":"%[[+search]]%"}
    


    where "songcharts:=":"1" is the important part (I only want records exported, that have a 1 in that field...)

    so the idea was, if I press enter without typing anything in the filter field, it would give back a filtered result with only the records that have songcharts=1, when I then (after "empty" search) hit export, the loading bar continued endlessly and the frondend of the site was completely dead (slowness attack) and soon after that the manager too, when trying to get rid of the loading bar by reloading the manager...

    any idea what could be the cause for this?

    I'll try to reproduce tonight, not now in visitors-primetime =D....
      • 4172
      • 5,888 Posts
      does this only happen, when trying to export?

      you can try to get the generated sql and play with it in phpmyadmin.
      May be you will need to optimize the indexes of your table for this query.

      do you have json-array-fields in your table?
      maybe this part slows it down:
      https://github.com/Bruno17/MIGX/commit/471a47e26dc6f3fe78100705c8542655f23a0260#L3R135
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 40045
        • 534 Posts
        Actually I didn't play around a lot with exporting till yesterday, and it happened before, so I guess IF it's related to that component/table there is something wrong in general...I had cache_db and cache_db_session active in the system settings, disabled this yesterday and have to see if I get new server timeouts...actually there are no used json fields (only the extended field, but it's not used till now...

        how would I optimize the indexes of a table, it has the id, which is needed by migxdb, should there be something else?