Hi Folks, I need some help about ACL, I'm using *PostgreSql 9.1*, *cakephp 2.1.1*, Acos: 717 rows, Aros: 78, Aros Acos: 1083 Look the number of queries to render the action below:
/* * Check if the user exists in the ARO table */ $user_aro = $this->Acl->Aro->node($user); if (empty($user_aro)) { $display_user = $this->{$user_model_name}->find('first', array('conditions' => array($user_model_name . '.id' => $user_id, 'contain' => false, 'recursive' => -1))); $this->Session->setFlash(sprintf(__d('acl', "The user '%s' does not exist in the ARO table", true), $display_user[$user_model_name][$user_display_field]), 'flash_error', null, 'plugin_acl'); } else { $actions = $this->AclReflector->get_all_actions();
foreach ($actions as $full_action) { $arr = String::tokenize($full_action, '/');
1. Do you store sessions in database? If yes, is it the same database as the one with application data? If yes, why? And why not use other (memcache) storage for sessions?
2. Stop blaming core code for slowness, until you'll be able to write short example NOT using your own classes like SessionAcl etc in it, especially not after your example code "snippet" above. I do have advanced imagination and I'm more then just a bit scared of what and how does your other custom code, used in your last loop over $acoes, where I even don't know what $recursive you used and how many associations are queried along.
Set up clean CakePHP installation, connect it to the very same database like your ACL uses, and run some test code related to your doubts WITHOUT your own code.
I'm not expert in CakePHP, but its very clear that the ACL is slow if my tables database acos, aros and aros_acos over thousand rows.
Just a simple $this->Acl->check() runs over 500 queries and its clear that its not the acl generate that, it uses the Tree behavior to find the specific permission.
1. I'm not using database session. 2. There are many articles on the internet talking about that, and I'm not blaming, I'm just trying to figure out how fast my app can be.
On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
> 1. Do you store sessions in database? If yes, is it the same database as > the one with application data? If yes, why? And why not use other > (memcache) storage for sessions?
> 2. Stop blaming core code for slowness, until you'll be able to write > short example NOT using your own classes like SessionAcl etc in it, > especially not after your example code "snippet" above. I do have advanced > imagination and I'm more then just a bit scared of what and how does your > other custom code, used in your last loop over $acoes, where I even don't > know what $recursive you used and how many associations are queried along.
> Set up clean CakePHP installation, connect it to the very same database > like your ACL uses, and run some test code related to your doubts WITHOUT > your own code.
On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
> 1. Do you store sessions in database? If yes, is it the same database as > the one with application data? If yes, why? And why not use other > (memcache) storage for sessions?
> 2. Stop blaming core code for slowness, until you'll be able to write > short example NOT using your own classes like SessionAcl etc in it, > especially not after your example code "snippet" above. I do have advanced > imagination and I'm more then just a bit scared of what and how does your > other custom code, used in your last loop over $acoes, where I even don't > know what $recursive you used and how many associations are queried along.
> Set up clean CakePHP installation, connect it to the very same database > like your ACL uses, and run some test code related to your doubts WITHOUT > your own code.
On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
> 1. Do you store sessions in database? If yes, is it the same database as > the one with application data? If yes, why? And why not use other > (memcache) storage for sessions?
> 2. Stop blaming core code for slowness, until you'll be able to write > short example NOT using your own classes like SessionAcl etc in it, > especially not after your example code "snippet" above. I do have advanced > imagination and I'm more then just a bit scared of what and how does your > other custom code, used in your last loop over $acoes, where I even don't > know what $recursive you used and how many associations are queried along.
> Set up clean CakePHP installation, connect it to the very same database > like your ACL uses, and run some test code related to your doubts WITHOUT > your own code.
On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
> 1. Do you store sessions in database? If yes, is it the same database as > the one with application data? If yes, why? And why not use other > (memcache) storage for sessions?
> 2. Stop blaming core code for slowness, until you'll be able to write > short example NOT using your own classes like SessionAcl etc in it, > especially not after your example code "snippet" above. I do have advanced > imagination and I'm more then just a bit scared of what and how does your > other custom code, used in your last loop over $acoes, where I even don't > know what $recursive you used and how many associations are queried along.
> Set up clean CakePHP installation, connect it to the very same database > like your ACL uses, and run some test code related to your doubts WITHOUT > your own code.
On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
> I'm not expert in CakePHP, but its very clear that the ACL is slow if my > tables database acos, aros and aros_acos over thousand rows.
> Just a simple $this->Acl->check() runs over 500 queries and its clear that > its not the acl generate that, it uses the Tree behavior to find the > specific permission.
> 1. I'm not using database session. > 2. There are many articles on the internet talking about that, and I'm not > blaming, I'm just trying to figure out how fast my app can be.
> I'll create a component and helper to make this faster as soon as possible > and I'll post it here.
> Thanks for your attention =)
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>> 1. Do you store sessions in database? If yes, is it the same database as >> the one with application data? If yes, why? And why not use other >> (memcache) storage for sessions?
>> 2. Stop blaming core code for slowness, until you'll be able to write >> short example NOT using your own classes like SessionAcl etc in it, >> especially not after your example code "snippet" above. I do have advanced >> imagination and I'm more then just a bit scared of what and how does your >> other custom code, used in your last loop over $acoes, where I even don't >> know what $recursive you used and how many associations are queried along.
>> Set up clean CakePHP installation, connect it to the very same database >> like your ACL uses, and run some test code related to your doubts WITHOUT >> your own code.
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>> 1. Do you store sessions in database? If yes, is it the same database as >> the one with application data? If yes, why? And why not use other >> (memcache) storage for sessions?
>> 2. Stop blaming core code for slowness, until you'll be able to write >> short example NOT using your own classes like SessionAcl etc in it, >> especially not after your example code "snippet" above. I do have advanced >> imagination and I'm more then just a bit scared of what and how does your >> other custom code, used in your last loop over $acoes, where I even don't >> know what $recursive you used and how many associations are queried along.
>> Set up clean CakePHP installation, connect it to the very same database >> like your ACL uses, and run some test code related to your doubts WITHOUT >> your own code.
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>> 1. Do you store sessions in database? If yes, is it the same database as >> the one with application data? If yes, why? And why not use other >> (memcache) storage for sessions?
>> 2. Stop blaming core code for slowness, until you'll be able to write >> short example NOT using your own classes like SessionAcl etc in it, >> especially not after your example code "snippet" above. I do have advanced >> imagination and I'm more then just a bit scared of what and how does your >> other custom code, used in your last loop over $acoes, where I even don't >> know what $recursive you used and how many associations are queried along.
>> Set up clean CakePHP installation, connect it to the very same database >> like your ACL uses, and run some test code related to your doubts WITHOUT >> your own code.
> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>> 1. Do you store sessions in database? If yes, is it the same database as >> the one with application data? If yes, why? And why not use other >> (memcache) storage for sessions?
>> 2. Stop blaming core code for slowness, until you'll be able to write >> short example NOT using your own classes like SessionAcl etc in it, >> especially not after your example code "snippet" above. I do have advanced >> imagination and I'm more then just a bit scared of what and how does your >> other custom code, used in your last loop over $acoes, where I even don't >> know what $recursive you used and how many associations are queried along.
>> Set up clean CakePHP installation, connect it to the very same database >> like your ACL uses, and run some test code related to your doubts WITHOUT >> your own code.
> On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
>> I'm not expert in CakePHP, but its very clear that the ACL is slow if my >> tables database acos, aros and aros_acos over thousand rows.
>> Just a simple $this->Acl->check() runs over 500 queries and its clear >> that its not the acl generate that, it uses the Tree behavior to find the >> specific permission.
>> 1. I'm not using database session. >> 2. There are many articles on the internet talking about that, and I'm >> not blaming, I'm just trying to figure out how fast my app can be.
>> I'll create a component and helper to make this faster as soon as >> possible and I'll post it here.
>> Thanks for your attention =)
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>> 1. Do you store sessions in database? If yes, is it the same database as >>> the one with application data? If yes, why? And why not use other >>> (memcache) storage for sessions?
>>> 2. Stop blaming core code for slowness, until you'll be able to write >>> short example NOT using your own classes like SessionAcl etc in it, >>> especially not after your example code "snippet" above. I do have advanced >>> imagination and I'm more then just a bit scared of what and how does your >>> other custom code, used in your last loop over $acoes, where I even don't >>> know what $recursive you used and how many associations are queried along.
>>> Set up clean CakePHP installation, connect it to the very same database >>> like your ACL uses, and run some test code related to your doubts WITHOUT >>> your own code.
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>> 1. Do you store sessions in database? If yes, is it the same database as >>> the one with application data? If yes, why? And why not use other >>> (memcache) storage for sessions?
>>> 2. Stop blaming core code for slowness, until you'll be able to write >>> short example NOT using your own classes like SessionAcl etc in it, >>> especially not after your example code "snippet" above. I do have advanced >>> imagination and I'm more then just a bit scared of what and how does your >>> other custom code, used in your last loop over $acoes, where I even don't >>> know what $recursive you used and how many associations are queried along.
>>> Set up clean CakePHP installation, connect it to the very same database >>> like your ACL uses, and run some test code related to your doubts WITHOUT >>> your own code.
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>> 1. Do you store sessions in database? If yes, is it the same database as >>> the one with application data? If yes, why? And why not use other >>> (memcache) storage for sessions?
>>> 2. Stop blaming core code for slowness, until you'll be able to write >>> short example NOT using your own classes like SessionAcl etc in it, >>> especially not after your example code "snippet" above. I do have advanced >>> imagination and I'm more then just a bit scared of what and how does your >>> other custom code, used in your last loop over $acoes, where I even don't >>> know what $recursive you used and how many associations are queried along.
>>> Set up clean CakePHP installation, connect it to the very same database >>> like your ACL uses, and run some test code related to your doubts WITHOUT >>> your own code.
>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>> 1. Do you store sessions in database? If yes, is it the same database as >>> the one with application data? If yes, why? And why not use other >>> (memcache) storage for sessions?
>>> 2. Stop blaming core code for slowness, until you'll be able to write >>> short example NOT using your own classes like SessionAcl etc in it, >>> especially not after your example code "snippet" above. I do have advanced >>> imagination and I'm more then just a bit scared of what and how does your >>> other custom code, used in your last loop over $acoes, where I even don't >>> know what $recursive you used and how many associations are queried along.
>>> Set up clean CakePHP installation, connect it to the very same database >>> like your ACL uses, and run some test code related to your doubts WITHOUT >>> your own code.
>> On Tuesday, April 17, 2012 6:00:05 AM UTC-7, Farah wrote:
>>> I'm not expert in CakePHP, but its very clear that the ACL is slow if my >>> tables database acos, aros and aros_acos over thousand rows.
>>> Just a simple $this->Acl->check() runs over 500 queries and its clear >>> that its not the acl generate that, it uses the Tree behavior to find the >>> specific permission.
>>> 1. I'm not using database session. >>> 2. There are many articles on the internet talking about that, and I'm >>> not blaming, I'm just trying to figure out how fast my app can be.
>>> I'll create a component and helper to make this faster as soon as >>> possible and I'll post it here.
>>> Thanks for your attention =)
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>> 1. Do you store sessions in database? If yes, is it the same database >>>> as the one with application data? If yes, why? And why not use other >>>> (memcache) storage for sessions?
>>>> 2. Stop blaming core code for slowness, until you'll be able to write >>>> short example NOT using your own classes like SessionAcl etc in it, >>>> especially not after your example code "snippet" above. I do have advanced >>>> imagination and I'm more then just a bit scared of what and how does your >>>> other custom code, used in your last loop over $acoes, where I even don't >>>> know what $recursive you used and how many associations are queried along.
>>>> Set up clean CakePHP installation, connect it to the very same database >>>> like your ACL uses, and run some test code related to your doubts WITHOUT >>>> your own code.
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>> 1. Do you store sessions in database? If yes, is it the same database >>>> as the one with application data? If yes, why? And why not use other >>>> (memcache) storage for sessions?
>>>> 2. Stop blaming core code for slowness, until you'll be able to write >>>> short example NOT using your own classes like SessionAcl etc in it, >>>> especially not after your example code "snippet" above. I do have advanced >>>> imagination and I'm more then just a bit scared of what and how does your >>>> other custom code, used in your last loop over $acoes, where I even don't >>>> know what $recursive you used and how many associations are queried along.
>>>> Set up clean CakePHP installation, connect it to the very same database >>>> like your ACL uses, and run some test code related to your doubts WITHOUT >>>> your own code.
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>> 1. Do you store sessions in database? If yes, is it the same database >>>> as the one with application data? If yes, why? And why not use other >>>> (memcache) storage for sessions?
>>>> 2. Stop blaming core code for slowness, until you'll be able to write >>>> short example NOT using your own classes like SessionAcl etc in it, >>>> especially not after your example code "snippet" above. I do have advanced >>>> imagination and I'm more then just a bit scared of what and how does your >>>> other custom code, used in your last loop over $acoes, where I even don't >>>> know what $recursive you used and how many associations are queried along.
>>>> Set up clean CakePHP installation, connect it to the very same database >>>> like your ACL uses, and run some test code related to your doubts WITHOUT >>>> your own code.
>>> On Tuesday, April 17, 2012 9:13:21 AM UTC-3, stork wrote:
>>>> 1. Do you store sessions in database? If yes, is it the same database >>>> as the one with application data? If yes, why? And why not use other >>>> (memcache) storage for sessions?
>>>> 2. Stop blaming core code for slowness, until you'll be able to write >>>> short example NOT using your own classes like SessionAcl etc in it, >>>> especially not after your example code "snippet" above. I do have advanced >>>> imagination and I'm more then just a bit scared of what and how does your >>>> other custom code, used in your last loop over $acoes, where I even don't >>>> know what $recursive you used and how many associations are queried along.
>>>> Set up clean CakePHP installation, connect it to the very same database >>>> like your ACL uses, and run some test code related to your doubts WITHOUT >>>> your own code.