After enabling Content Access module the performance of views (based on solr) worsened considerably to a point that they were timing out.

We found multiple and always growing number of mysqld processes to a point where the server practically stopped running.

This in turn was caused by multiple never completing queries (hundreds of seconds!) such as
SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "node_field_data" "node_field_data" WHERE ("node_field_data"."type" IN ('strategy')) AND (EXISTS (SELECT "na"."nid" AS "nid" FROM "node_access" "na" WHERE ((("gid" IN ('0')) AND ("realm" = 'all')) OR (("gid" IN ('14')) AND ("realm" = 'content_access_author')) OR (("gid" IN ('2', '4')) AND ("realm" = 'content_access_roles'))) AND ("na"."grant_view" >= '1') AND (("node_field_data"."nid" = "na"."nid"))))) "subquery"

See attached screenshot as well:
slow query screenshot

Eventually had to switch off Content Access module, but we will gladly test it again if there is a solution to this problem.

CommentFileSizeAuthor
Screenshot 2022-06-09 235505.jpg91.13 KBvacilando

Comments

Vacilando created an issue. See original summary.

gisle’s picture

Maintainer here.

Unfortunately, I have limited time available to care for this baby. I have a single sponsor, and I need to focus on making it work for use cases that is important for the sponsor.

For everything else, it is in the hands of the community.

If you're a developer, patches and/or merge requests are most welcome. If you're not a developer, you can hire one to get your use case prioritized.

As maintainer, I can promise to commit fixes in timely fashion, but only after the community gets the issue resolved (i.e. gets it to RTBC).

anybody’s picture

Version: 8.x-1.0-alpha4 » 8.x-1.x-dev
gisle’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

All bug fixes go into the most recent branch.

steven jones’s picture

Status: Active » Closed (works as designed)

I think that this issue is basically describing the node access system. It will have poor performance if you have lots and lots of nodes, there's no real way around that.

That slow query that's noted in the OP is generated by the node access system rather than content access itself.

Content access returns the records, and defines the grants for a user, but we don't define how and when the actual SQL queries run, so while we play a part, we're not the main reason for the described slowness.

Sorry that it's been years, hope you got a response/resolution. Feel free to re-open with more information that we could use to track down the root cause of the slow queries.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.