tastyigniter / TastyIgniter

:fire: Powerful, yet easy to use, open-source online ordering, table reservation and management system for restaurants
https://tastyigniter.com
MIT License
2.98k stars 976 forks source link

[Bug]: After update v3.5.4 extreme long loading time to /menus #1008

Closed diverds1992 closed 1 year ago

diverds1992 commented 2 years ago

What happened?

After the v3.5.4 there are extreme long loading time to the menus page. Like 20sec.

The rest of the pages are okay

There are no errors in the systems logs

What did you expect to happen?

load normally

Version

3.5.x

What browser are you seeing the problem on?

Chrome, Safari

Relevant log output

No response

sunjingup commented 2 years ago

me too

sampoyigi commented 2 years ago

Not something i've experience or can reproduce.. Have you tried a fresh installation of v3.5.4.

sunjingup commented 2 years ago

just updated, then the issue come out

diverds1992 commented 2 years ago

i didn't try a fresh install. Just a update from 3.5.3 to 3.5.4

josephlu2 commented 2 years ago

installed with softaculous on a subdomain and facing same issue

sunjingup commented 2 years ago

image

tried to a fresh installation of 3.5.4, It still takes long time for menus page loading(around 31s). I tried to delete all menus(90 items), then response time will be around 6s.

shelemiah commented 2 years ago

I am experience the same issue on version 3.5.4. The menus page takes about 14.87s to load and about the same time to add an item to the cart. From the debugbar the following queries I have noted with long load duration:

  1. select order_time from ti_orders where order_date = '2022-09-14' and location_id = 1 and status_id in ('1', '1', '2', '3', '5') 14.87ms /extensions/igniter/local/listeners/MaxOrderPerTimeslotReached.php:72

  2. select count() as aggregate from ti_menus where (exists (select from ti_locations inner join ti_locationables on ti_locations.location_id = ti_locationables.location_id where ti_menus.menu_id = ti_locationables.locationable_id and ti_locationables.locationable_type = 'menus' and ti_locationables.location_id in (1)) or not exists (select * from ti_locations inner join ti_locationables on ti_locations.location_id = ti_locationables.location_id where ti_menus.menu_id = ti_locationables.locationable_id and ti_locationables.locationable_type = 'menus')) and menu_status = 1 and (order_restriction is null or order_restriction like '%\"delivery\"%') 11.4ms /vendor/tastyigniter/flame/src/Database/Query/Builder.php:114

mrrosan commented 2 years ago

same here, installed with softaculous on a subdomain and facing slow menu page issue.

thecornercabinet commented 2 years ago

We are having this same issue, with server responses taking 30-40 seconds. I ran an optimize on the DB, but the DB does not support optimization. Checking errors on the server and it's giving these consistently: [Tue Sep 13 08:40:36.093329 2022] [proxy_fcgi:error] [pid 9315] [client <IP>] AH01071: Got error 'PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /public_html/deli/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 1441', referer: https://<domain>/deli/<location>/info [Tue Sep 13 08:39:48.147592 2022] [proxy_fcgi:error] [pid 6457] [client <IP>] AH01071: Got error 'PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /public_html/deli/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 600', referer: https://<domain>/deli/<location>/info [Tue Sep 13 08:29:13.674944 2022] [proxy_fcgi:error] [pid 9317] [client <IP>] AH01071: Got error 'PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /public_html/deli/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 1651', referer: https://<domain>/deli/account [Tue Sep 13 08:28:18.260185 2022] [proxy_fcgi:error] [pid 9303] [client <IP> AH01071: Got error 'PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /public_html/deli/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 2011', referer: https://<domain>/deli/account [Tue Sep 13 08:27:36.647469 2022] [proxy_fcgi:error] [pid 6457] [client <IP>] AH01071: Got error 'PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /public_html/deli/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 1440', referer: https://<domain>/deli/account [Tue Sep 13 08:27:25.425059 2022] [proxy_fcgi:error] [pid 9317] [client <IP>] AH01071: Got error 'PHP message: PHP Fatal error: Maximum execution time of 30 seconds exceeded in /public_html/deli/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 1750', referer: https://<domain>/deli/account [Tue Sep 13 08:23:56.825311 2022] [proxy_fcgi:error] [pid 22209] (70007)The timeout specified has expired: [client <IP>] AH01075: Error dispatching request to : (polling), referer: https://<domain>/deli/<location>/menus/menu [Tue Sep 13 08:23:56.301306 2022] [proxy_fcgi:error] [pid 6447] (70007)The timeout specified has expired: [client <IP>] AH01075: Error dispatching request to : (polling), referer: https://<domain>/deli/<location>/menus/menu [Tue Sep 13 08:23:55.908448 2022] [proxy_fcgi:error] [pid 6466] (70007)The timeout specified has expired: [client <IP>] AH01075: Error dispatching request to : (polling), referer: https://<domain>/deli/<location>/menus/menu [Tue Sep 13 08:23:54.505440 2022] [proxy_fcgi:error] [pid 9303] (70007)The timeout specified has expired: [client <IP>] AH01075: Error dispatching request to : (polling), referer: https://<domain>/deli/<location>/menus/menu [Tue Sep 13 08:23:42.111308 2022] [proxy_fcgi:error] [pid 22205] (70007)The timeout specified has expired: [client <IP>] AH01075: Error dispatching request to : (polling), referer: <domain>/deli/<location>/menus/menu

shelemiah commented 1 year ago

Rolling back Fix location list order type filter resolves the long loading time. I have not identified the exact cause of the problem but it is located in the changes made to HasLocationOptions.php ... possible the getOptionsAttribute function.

sampoyigi commented 1 year ago

Can someone confirm if the patch has resulted in any improvements https://github.com/tastyigniter/TastyIgniter/commit/cfe5f965503be400f3247af11230f7767710d425

shelemiah commented 1 year ago

Did a quick test and all look well. The load time to /menus has improved.

Will continue to evaluate it today. Thanks for patch Sam.

Much appreciated.

thecornercabinet commented 1 year ago

I replaced our HasLocationsOptions code with that of the update and it seems to be working much better now.

diverds1992 commented 1 year ago

The latest update is working!

zigcBenx commented 1 year ago

I updated to version v3.5.5 where above mentioned fix is included, but my request times are still long. For menus GET request takes around 4-5s to load, which makes really bad user experience.

FYI: I'm using API extension for gathering menu.

sampoyigi commented 1 year ago

This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider the Dedicated Support Service where a Service Level Agreement is offered.