Forum OpenACS Q&A: Re: Incredible Performance Decrease - Please help!!!

Collapse
Posted by Nima Mazloumi on
Thank you all very much for the help. I turned on the PermissionCacheP. And it is true...the pages are served much faster.

But what about the note that is stated for the usage of PermissionCacheP:

Whether to cache permission_p calls. Use with extreme caution. Only direct permissions managed via the tcl api are properly handled and some packages modify permissions directly in the database and will not work properly when this is turned on. You must restart the server after changing this param. 
Don: Two short questions.
  1. Where do I
    allocate enough space to the pool the permissions code uses to cache them?
  2. Also where do I configure the
    buffer size I have set in PG

The next two things I will try to do is

  1. Enabling performance statistics in PG
  2. Usage of MRTG The Multi Router Traffic Grapher or something alike

Thanks to you all

Nima
Collapse
Posted by Dirk Gomez on
Regarding ext::auth - I was trying to make a point that we couldn't properly track down the root cause of the problem and if you are trying to find a performance problem (or bug) you shouldn't jump at a conclusion all too quickly.

I played a bit with psql trying to find a way to hardwire values into views and PL/PGSQL functions who have been looked up dynamically. Here is what I found to work:

create function inline_0 ()
returns integer as '
declare
        v_magic_object_id acs_magic_objects.object_id%TYPE;
begin
        select object_id
          into v_magic_object_id
          from acs_magic_objects
          where name = ''registered_users'';

        EXECUTE ''create or replace view cc_users '' ||
                '' as '' ||
                '' select o.*, pa.*, pe.*, u.*, mr.member_state, mr.rel_id '' ||
                '' from acs_objects o, parties pa, persons pe, users u, group_member_map m, membership_rels mr '' ||
                '' where o.object_id = pa.party_id '' ||
                ''  and pa.party_id = pe.person_id '' ||
                ''  and pe.person_id = u.user_id '' ||
                ''  and u.user_id = m.member_id '' ||
                ''  and m.group_id = '' || v_magic_object_id ||
                ''  and m.rel_id = mr.rel_id '' ||
                ''  and m.container_id = m.group_id '' ||
                ''  and m.rel_type = ''''membership_rel'''' '';
        return 0;
end;' language 'plpgsql';

select inline_0 ();

drop function inline_0 ();

There is no equivalent to sql*plus variables yet, so this is a bit klunky. (psql variables don't work here)

Should the most obvious invocations of acs_magic_objects be replaced?

(cc_users doesn't have pl/pgsql anymore anyway, I just meant to find a development query)