-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Major performance problems when product_sales_channels mapping table grows #10048
Comments
More information: From the zipkin tracer I can see that in the extreme case (and less extreme case too, just less visible) that the remoteQuery into sales_channels link is the performance killer. It appears that this middleware link filter: https://github.com/medusajs/medusa/blob/develop/packages/medusa/src/api/store/products/middlewares.ts#L34 in turn call this remote query https://github.com/medusajs/medusa/blob/develop/packages/core/framework/src/http/utils/maybe-apply-link-filter.ts#L43 |
@Edsparr, thanks for the report and for sharing the results of your load testing. It's always interesting to see such findings. We are aware of the performance issues related to cross-module filtering, such as when you filter products by sales channels and are working on a search engine aimed at solving it. We expect to be able to share more early next year. I'll close this issue for now, since this is a known limitation and we have a planned solution. Feel free to open this as a GitHub Discussion, if you want to open up a discussion around it. I'll make sure to ping here when we know more about the release date of the search engine :) |
Thank you for your detailed response Oliver! I am curious if v2 have any other known performance bottle necks at the moment? If so, what are them and when can we expect them to be resolved? I am currently evaluating Medusa v2 for my company (8M euro revenue for reference around size) and while I enjoy it personally I am worried about Medua V2's immaturity. From a business perspective it's hard to justify investing heavily into a completely new platform. It might have deep flaws that I won't discover until later. From a helicopter perspective, I am also worried about the linking api which I find restrictive. Are there any plans to allow for more flexibility? Would love to hear some of your thoughts around my concerns! |
Is this resolved ? |
I do not believe it is yet. Would love to hear some updates around it @olivermrbl |
Package.json file
Node.js version
22.9.0
Database and its version
Postgres 17
Operating system name and version
Windows 11 Pro - 10.0.22631 version 22631
Browser name
Chrome
What happended?
When populating the database for a benchmark on Medusa with these parameters I found severe performance degradation:
The response times were lightning fast when not using any sales channels mapping.
Worst case scenario I could get 10+ seconds load times for a normal product get. I pinpointed it to be related to sales channels. Response times were specifiaclly related to:
The gist contains my raw code. You can also just create the mappings by yourself to reproduce it.
Expected behavior
Load times should not be affected this significantly
Actual behavior
Load times was affected significantly
Link to reproduction repo
https://gist.github.com/Edsparr/7a914bfb5f50e93cc5e0608a5d1f76ef
The text was updated successfully, but these errors were encountered: