Re: Slow Page Load due to 100's of ACL Queries

2010-08-25 Thread Jon Bennett
 When a user is logged in, there are 100's of queries that are run
 against the database.  They come from a $this-Aro-Permission-find
 call in /cake/libs/controller/api-check().

 The function, and corresponding DB calls, are executed once per row in
 the AROS table.  There are 1374 items in that table, most are links to
 users.

 I inherited this site and I am just starting to learn CakePHP.  Can
 anyone explain why this is happening and what I need to change to stop
 it?

try http://bakery.cakephp.org/articles/view/acl-caching-using-session

hth

Jon

-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Slow Page Load due to 100's of ACL Queries

2010-08-25 Thread Jon Bennett
 When a user is logged in, there are 100's of queries that are run
 against the database.  They come from a $this-Aro-Permission-find
 call in /cake/libs/controller/api-check().

 The function, and corresponding DB calls, are executed once per row in
 the AROS table.  There are 1374 items in that table, most are links to
 users.

 I inherited this site and I am just starting to learn CakePHP.  Can
 anyone explain why this is happening and what I need to change to stop
 it?

What version of cake is it running?

J


-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Slow Page Load due to 100's of ACL Queries

2010-08-25 Thread miller
It is version 1.2.4.8284.


On Aug 25, 6:41 am, Jon Bennett jmbenn...@gmail.com wrote:
  When a user is logged in, there are 100's of queries that are run
  against the database.  They come from a $this-Aro-Permission-find
  call in /cake/libs/controller/api-check().

  The function, and corresponding DB calls, are executed once per row in
  the AROS table.  There are 1374 items in that table, most are links to
  users.

  I inherited this site and I am just starting to learn CakePHP.  Can
  anyone explain why this is happening and what I need to change to stop
  it?

 What version of cake is it running?

 J

 --
 jon bennett -www.jben.net- blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Slow Page Load due to 100's of ACL Queries

2010-08-25 Thread miller
Our authentication setup is simple.  We have three groups: User,
Supplier, Admin.  Why would we need a record per user/admin/supplier
in the Aros table?

-mike


On Aug 25, 6:41 am, Jon Bennett jmbenn...@gmail.com wrote:
  When a user is logged in, there are 100's of queries that are run
  against the database.  They come from a $this-Aro-Permission-find
  call in /cake/libs/controller/api-check().

  The function, and corresponding DB calls, are executed once per row in
  the AROS table.  There are 1374 items in that table, most are links to
  users.

  I inherited this site and I am just starting to learn CakePHP.  Can
  anyone explain why this is happening and what I need to change to stop
  it?

 What version of cake is it running?

 J

 --
 jon bennett -www.jben.net- blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Slow Page Load due to 100's of ACL Queries

2010-08-25 Thread Jon Bennett
 Our authentication setup is simple.  We have three groups: User,
 Supplier, Admin.  Why would we need a record per user/admin/supplier
 in the Aros table?

It _could_ be the previous developer/team wanted more granular
permissions than just group level, which is why you have a record per
user rather than one per group.

Is it feasible to refactor your ACL so it fits the simpler group based
set up in the cakephp book? It could be as simple as:

* empty acos, aros, acos_aros
* run the init_acl function from the book
* add your group based permissions

make sure you take a back up first!

nb, this is the SQL cake runs (first time in the session with
SessionAcl) to determine access to a particular controller method
http://pastie.org/1115224

Also, make sure you have indexes on your tables, eg http://pastie.org/823086

Hth,

j


 -mike


 On Aug 25, 6:41 am, Jon Bennett jmbenn...@gmail.com wrote:
  When a user is logged in, there are 100's of queries that are run
  against the database.  They come from a $this-Aro-Permission-find
  call in /cake/libs/controller/api-check().

  The function, and corresponding DB calls, are executed once per row in
  the AROS table.  There are 1374 items in that table, most are links to
  users.

  I inherited this site and I am just starting to learn CakePHP.  Can
  anyone explain why this is happening and what I need to change to stop
  it?

 What version of cake is it running?

 J

 --
 jon bennett -www.jben.net- blog.jben.net

 Check out the new CakePHP Questions site http://cakeqs.org and help others 
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
 http://groups.google.com/group/cake-php?hl=en




-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en