• awegerer

    (@awegerer)


    Hi Stephen!

    I am using your plugin since many month now and it worked great without issues. Now one of the recent updates slowed my webpage down extremely so I had to disable the plugin. It is even slow on pages were no chatbot exists. Disabling the plugin brings back good performance immediately. I am stuck here.

    What I tried is to raise php memory to 1G, disabling all other plugins, there are no caching plugins active, raising max_execution_time to 120, restarting the whole server – no luck.

    Do you have any hints for me? Where there any changes in the last couple of weeks or month that needed adoption of server configuration?

    Thanks for your efforts and the great plugin!

    Alex

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author kognetiks

    (@kognetiks)

    Hello awegerer (@awegerer) Alex,

    Thanks for reporting this. Since the slowdown happens on all pages, even those without the chatbot, it’s likely that something is being loaded or executed globally.

    To help diagnose this, could you try the following:

    1. Enable Query Monitor – This will help identify slow queries and excessive API calls, as well as a comprehensive view of your installation. You’ll find it here:
      https://www.ads-software.com/plugins/query-monitor/
    2. Check for AJAX Calls – Open the Network tab in your browser and see if what might be related to chatbot-chatgpt or other chatbot-related requests are running on non-chatbot pages.
    3. Temporarily Disable Chatbot Session Storage – If possible, test by disabling session storage or transients related to the chatbot.
    4. Monitor Memory Usage – Add this temporary function in functions.php:

      function debug_memory_usage() { error_log('Memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . ' MB'); } add_action('shutdown', 'debug_memory_usage');

      Then check wp-content/debug.log after loading pages.
    5. Turn On Debug Mode – If you haven’t turned on debug mode, you may need to do so in your wp-config.php file:

      define('WP_DEBUG', true);
      define('WP_DEBUG_LOG', true);
      define('WP_DEBUG_DISPLAY', false);

    I’m actively investigating this, and I’ll keep you updated on potential fixes. Let me know if you find anything in Query Monitor or the debug logs!

    Best,
    Stephen
    [email protected]

    Thread Starter awegerer

    (@awegerer)

    Thx for your suggestions. I installed Query Monitor, which shows “Slow Queries”, all related to wp_chatbot:

    This looks if I had to reinstall the plugin, do I?

    Plugin Author kognetiks

    (@kognetiks)

    Hello Alex,

    I noticed this “ALTER TABLE” call as well when I fired up a fresh version of the chatbot.

    Can you edit the main plugin file (chatbot-chatgpt.php)?

    Let’s try commenting out lines 932 and 935.

    You can put a “//” in from of the call to the create_chatbot_chatgpt_assistants_table() so that it reads

    // create_chatbot_chatgpt_assistants_table();

    Then do the same for the create_cvhatbot_azure_assistants_table() too

    // create_chatbot_azure_assistants_table();

    Then let’s see if responsiveness improved.

    I’m investigating this to see if there is a problem there.

    Best,
    Stephen

    Thread Starter awegerer

    (@awegerer)

    Yes, that helped! It is faster again. There are remaining slow queries, but with less impact.

    Seems as the script can not write to the table.

    Greetings, Alex

    • This reply was modified 1 week ago by awegerer.
    Plugin Author kognetiks

    (@kognetiks)

    Alex,

    What needs to happen here it table create needs to happen only on activation or upgrade.

    I was originally worried about making sure that the table was altered with the new layout.

    Most likely it’s an artifact left over from my development envirnoment.

    I’ll move it and release a version 2.2.7.

    As for the transients, these facilitate the asynchronous nature of the chatbot and UI/UX interactions.

    The transients keep track of key chatbot attributes so that you can leave the page and return to it later and the chatbot doesn’t loose it’s place.

    One optimization that I can do is see if I can load the data into an array and make one transient do all the work rather than have several, thus collapsing several DB calls into one DB.

    I’ll see what I can do in the next release. It depends on how complicated it gets to untangle this.

    You mentioned that “seems that the script cannot write to the table”. Can you expand on that?

    Best,

    Stephen

    Thread Starter awegerer

    (@awegerer)

    Hi Stephen!

    Thanks again for your help and the information provided. I can not expand the statemanet about the script not being able to write to the DB as it seems to be nonsense ?? Firstly I thought it can not write because it takes so long and happens over and over. But that seems not to be the case.

    Looking forward to the new verison!

    Thank you, Alex

    Plugin Author kognetiks

    (@kognetiks)

    Hello Alex,

    Thank you.

    I’ll leave this issue open until I can push out an update.

    If you find there is additional info you can share, send it along here or directly to me at support @ kognetiks dot com.

    Best,

    Stephen

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.