1. "Fabrik 4" helpers needed!

    You are invited to join other community members active in coding, maintaining and improving Fabrik. Please visit https://fabrik.help for more information!
    Dismiss Notice

database has become really slow

Discussion in 'Community Help (users helping users)' started by cap, Sep 18, 2023.

  1. cap

    cap Member

    Level: Community
    hello, my site with a fabrik db has become really slow..lots of cpu and I/O resources consumptions
    I have a questionnaire with say 60 answer yes/no/NA and there are now around 100 record
    So i don't think the db is too big
    May be there are other issue related (joomla?) which i haven't found yet, meanwhile i would like to knowo if fabrik can give similar issue and what i should check to make sure fabrik is ok
    Thank you
     
    Last edited: Sep 18, 2023
  2. henk

    henk Super Moderator Staff Member

    Level: Community
    Probably there are many queries in your fabrik that makes the communication with the database slow. Consider to create one or more (nested) views in the database instead. A view is a query, written in SQL, that resides and runs on the database and is always more efficient and a lot faster than a query created in fabrik. You can create views in phpMyAdmin. See https://www.w3schools.com/mysql/mysql_view.asp for more info. A view can then be used in fabrik as a normal table.
     
  3. cap

    cap Member

    Level: Community
    for now the db it is only used in insert data..so there are calc plugin that check the first answer Y/N and assign a value accordingly
    Really this can hit the resources so that the host make restriction resulting in very slow access? it is slow even opening the home page

    today that resources are again normal the site is fine
    So it is like there are period that resourcers that the site use, go over the limit and the provider apply a restriction.Once the restriction is over everyhting is fine again..for how much i don't know..as that was the first time it happened

    anyway..the view should replace the search i do in the db if i understand?or it is useful also for inserting data?
    the area "visualization" in Fabrik..has nothing to do with it?
    So i create a VIEW (if i will ever be able to.. :)) , this should be done in phpmyadmin right? then how i use it in fabrik?
     
    Last edited: Sep 19, 2023 at 2:35 PM
  4. henk

    henk Super Moderator Staff Member

    Level: Community
    A view can not be used to insert data. There is much to find online how to create a view. SQL code is easy to learn and more simple than PHP. You can even do calculations in a view instead of doing that in a calc. You use a view in fabrik like a normal table, so you can create a list and select your view as the table. Also see the fabrik wiki for more info.
     
  5. cap

    cap Member

    Level: Community
    ok and what i was thinking then..as for now the db is used only to insert data...so 1) the view don't help 2) probably it is not this the issue?
     
  6. cap

    cap Member

    Level: Community
    i m interested anyway in doing calculation in view instead of calc. Can you exaplin me more? of course i need it for inputting data though
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    MySQL views are readonly (so only useful for list views or record display, not forms).

    It's not clear where you have the difficulties: list view? form view?
    You have some other thread about a slow form.
     
  8. cap

    cap Member

    Level: Community
    this it is not slow form as i "complain" before, but it is totally different thing
    It is like the whole site use too many resources (disk access and I/o) so it get limited from provider,: results is that for 12 hourse the site works really slow
    Even opening the home page it is slow..so anything else is slow..but because provider limits because of too many resources used earlier
    So there must be something going on that uses a lots of host's resources
    It could be something from Joomla..but i have none other than fabrik in Joomla
    It could be somehting that caused by Fabrik. These days fabrik is used only to insert data..it is unlikely that inserting datas would cause too muche resources consumption. is it?
    Doing lots of search may be..but inserting datas?
    So now my need is to trying to understand if Fabrik in some way can use too many resources while entry datas?

    p.s.
    so list view it is not good to have some query already done..for example a query that show all answer yes at question n°10
     
  9. juuser

    juuser Well-Known Member

    Level: Community
    If you can't see the server logs yourself, ask your service provider which processes are causing the high resource usage. Otherwise you're just guessing. May not be Fabrik related at all.
     
  10. cap

    cap Member

    Level: Community
    i agree..
    but provider don't tell me anything but the usage hit the limit..and told me to check what script were coing on when the limit was hit
    So i don't know much about..i don't even know exactly when the limit was hit..IN the site for what i know there is nothing running, a part of fabrik
    And fabrik is used only to insert data now..and there are no 10 persons inserting data..but one that slowly inseert data after readind a question to a patient and having the answer..so it is not a machine-fast insert

    all they can say is that the report indicate this
    /private_html/index.php

    as source if problem

    but it seems really unuseful
    p.s. private_html is just a shortcut to public_html
    don't know why the log indicate the private instead the public
     
    Last edited: Sep 20, 2023 at 11:21 AM
  11. cap

    cap Member

    Level: Community
    for example i have tried now to use the filter option in the list view
    I have a field yes/no so i have first used filter for yes, and the answer was quick, then i searched for no..and it hang for a while, and i could see the fault in cpu usage..hitting the 100% limit
    One question, about all..does fabrik need a very good performinc host may be? may one is a cheap one and may be i don't have so much resources available

    or may be fabrik 4 is not yet well optimized?

    edit
    my host, for testing pourposes has upgrade the account to 2 cpu and 2gb ram , the double of what i have now
    Well..did 3,4 search with the filter again and i hit 100%
    how is it possible?why the simple operation of filtering a yes/no option it is so resource hungy?
     
    Last edited: Sep 20, 2023 at 11:44 AM
  12. juuser

    juuser Well-Known Member

    Level: Community
    Is the limit hit only with that one list?
    Does it do the same when you disable all your calc elements in that list (totally disable, not just hide from list view)?

    In my experience server optimization is very important for things to run smoothly. I remember once having a Windows Server based service which has very good technical parameters "on paper", but Joomla / Fabrik was running really slow. After switching to another service, which has similar technical parameters, things started to fly.
     
  13. cap

    cap Member

    Level: Community
    i am going to try to disable all calc
    When i use the form to insert data, and i choose YES or NO, the calc take a little while before outputting the answer D or N..i can see for 1,2 seconds the thing spinning
    But when i use th efilter on yes/no component calc is not used...It happen that i select YES..and it anser suddendly, then i seacrh for NO..and it is very slow..like if two consecutive seacrh give troubles
    I am working now with a test site, with only 10 records..and it is still very slow at times (well i suddendly hit resources here as well so i already have some limit
    It might be the server..yes..but not sure
    what server should i search for then?
     
  14. cap

    cap Member

    Level: Community
    anyway
    i disable all calc elements (147)
    and tried the filter on yes/No
    first search ok..second one site hang for ever ( i repeat that now i am under resources limitation..but still it is very easy task)
    i specify..this happen when the search are close one to anotehr..if i wait a while they both works well

    anyway..i see that this calc are not so nice..even when inserting data they are somehow slow
    but what to use instead?

    my usage of calc is just to return th raw value of the radiobutton /radiobutton has LABEL S and RAWVALUE E for example)
    Very simple...that's why is so strange that calc cause so much problems...but what to do instead?
     
    Last edited: Sep 20, 2023 at 3:12 PM
  15. cap

    cap Member

    Level: Community
    update:
    the provider give me 4 cpu for test
    Now i dont see anymore hang, or delay and for th etime i am testing no hit of resource limit of course
    So...of course 4 cpu is good, but where is the problem:is fabrik really demanding or a better configuration could sort the problem anyway?

    edit
    i did more teest..and the next test again slow..first seacrh quick..then the next slow
    so behaviuour is the same also with 4cpu
    just to clarify..i can see "com_fabrik_loading" text in the screen for few seconds..at times 2 seconds..other 3 or 4
     
    Last edited: Sep 20, 2023 at 7:42 PM
  16. achartier

    achartier Super Moderator Staff Member

    Level: Community
    Have you tried enabling joomla debug and check the profile information? That may help narrow it down. Also, the sql queries, maybe something is causing a specific query to run more often than it should.
     
  17. cap

    cap Member

    Level: Community
    i don't understand the query part you are saying.
    They don't run on their own..when there is no activity on site there is no traffic
    The problem is that there is an excess of resources usage when i do certain things. If i use the filtering options that i have on the list view (like search yes or no in a yesno component), i have trouble. The first search is fine, the second search (if close to the first) system hangs a while and i can see that resources usage hits the limit. So the provider limit my resources for 24 hours
    So i have at least one issue which i have identified, which i can replicate.
    The filtering action on that yesno component!
     
  18. achartier

    achartier Super Moderator Staff Member

    Level: Community
    Please do a search on Joomla debug. The info you need re profiling and sql queries will be there.
     
  19. cap

    cap Member

    Level: Community
    i have found in the system debug plugin, some optionto check..relatives to profiles and qeris
    is that what you mean?

    i have enable also fabrik debug
    it says
    "If yes then appending &fabrikdebug=1 to your page urls will output debug code - handy to spot any issues. Debug JS will force always loading uncompressed JS files."
    what odo i habe to do?append &fabrikdebug=1? but where exacly?
     
    Last edited: Sep 21, 2023 at 1:14 PM
  20. cap

    cap Member

    Level: Community
    does it give some info?
    [​IMG]


    [​IMG]
     

Share This Page