Basket Plugin Performance

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Basket Plugin Performance

Post by cjr » 19 Oct 2020, 15:36

After activating the Coupon plugin and release coupons to customers, the performance of our site plummeted. It takes about 60-120 seconds for the add coupon input to return. Log debugging on the back end, I see the addCoupon.after action is called about 12 times a coupon is added to the basket. This is the same with all actions. Why are these actions called so many times, and what can I do to lower that number?

User avatar
aimeos
Administrator
Posts: 7885
Joined: 01 Jan 1970, 00:00

Re: Basket Plugin Performance

Post by aimeos » 19 Oct 2020, 15:42

Which Aimeos version are you using?

By default, all basket plugins are protected by the "Singleton" decorator preventing event storms:
- https://github.com/aimeos/aimeos-core/b ... gleton.php
- https://github.com/aimeos/aimeos-core/b ... in.php#L13
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Re: Basket Plugin Performance

Post by cjr » 19 Oct 2020, 15:55

2020.04

My config/plugin.php file looks the same as your example.
All actions from addProduct.after to deleteCoupon.after are running around 12 times.

For some reason the performance only became an issue after introducing the Coupons. I looked into the coupons, and how my custom functions are working, and none of the individual queries are holding it up.

I set the loglevel to 3, which improved the performance time from about 30 minutes to 2 minutes.

User avatar
aimeos
Administrator
Posts: 7885
Joined: 01 Jan 1970, 00:00

Re: Basket Plugin Performance

Post by aimeos » 19 Oct 2020, 16:06

Did you enable debug logging (loglevel = 7)?
This may have a performance impact but usually not in the way you describe
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Re: Basket Plugin Performance

Post by cjr » 19 Oct 2020, 16:11

I have it set at 7 locally to troubleshoot, and I experience performance issues when I do that.

Production code has it set to 3. When production was set to 6 the issues were much worse, setting it to 3 helped a little.

User avatar
aimeos
Administrator
Posts: 7885
Joined: 01 Jan 1970, 00:00

Re: Basket Plugin Performance

Post by aimeos » 19 Oct 2020, 16:25

If logging takes so much time you should have a look at your server why write operations are so slow.

Additionally, can you please post the log lines from the basket plugin log decorator at loglevel 7 to see what is called and when?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Re: Basket Plugin Performance

Post by cjr » 19 Oct 2020, 17:39

Looking at the Logs made me realize I have the plugin activated for every site (I have the multi site package). Will it run it or every site? They each have a row in mshop_plugin. If that is the case, is having one row for the provider of Coupon enough? or do I need a version for each site because it will need to have the product to site relationship to run the plugin?

User avatar
aimeos
Administrator
Posts: 7885
Joined: 01 Jan 1970, 00:00

Re: Basket Plugin Performance

Post by aimeos » 19 Oct 2020, 17:44

Did you configure a multi-vendor setup using the built in Aimeos feature or did you buy the ai-sites extension from the Aimeos company? In the later case, did you configure it in market place place mode or for inheritance only?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cjr
Posts: 14
Joined: 08 Jul 2020, 16:58

Re: Basket Plugin Performance

Post by cjr » 19 Oct 2020, 17:47

We bought the extension ai-sites extension from Aimeos. I'm not sure about the second part.

What I'm wondering is say I have only 1 Coupon plugin active, will it run regardless of what siteid the product's selected belong to?

User avatar
aimeos
Administrator
Posts: 7885
Joined: 01 Jan 1970, 00:00

Re: Basket Plugin Performance

Post by aimeos » 20 Oct 2020, 07:03

If you configure it at the default site, then yes und you must not add the plugins to every site.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply