q2a / question2answer

Question2Answer is a free and open source platform for Q&A sites, running on PHP/MySQL.
http://www.question2answer.org/
GNU General Public License v3.0
1.63k stars 628 forks source link

Performance issues when switching from plugin to general tab #847

Open rklec opened 3 years ago

rklec commented 3 years ago

I've seen several performance issues pointed out, but my one is special:

STR

  1. When loading the /admin/general tab, everything works flawlessly.
  2. Then sswitch to /admin/plugins, i.e. the plugins tab.
  3. And switch to /admin/general back.

What happens: It loads for a very long time and finally does a 504 Gateway Time-out of nginx

Reducing the numbeer of plugins seems to fix this,l but even with only q2apro/q2apro-warn-on-leave and NoahY/q2a-badges installed (both from GitHub), it cannot finish loading even after several seconds.

This is a dockerized test instance and no one else accesses it, so there should be plenty of hardware resources for performance.

v1.8.5 PHP 7.4.11 10.4.10-MariaDB-1:10.4.10+maria~bionic nginx/1.18.0

Edit: The plugin options also load very long or timeout.

svivian commented 3 years ago

It may be due to the plugin update checks. If you have a lot of plugins it will fire off many AJAX requests to check for updates.

Try commenting out this line in admin-plugins.php and see if it solves the issue. If so, we are working on making this better for the next version.

rklec commented 3 years ago

Indeed thanks. Indeed the issue happens when your network connection is slow or no outgoing network requests happen. Maybe set a timeout for network requests, so they can at least fail and not block the whole application. (curl CURLOPT_CONNECTTIMEOUT)

For me this issue is closed, so you may close it, if you want.