Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Scalability Issues - Too Many Active Sessions?

tdsacilowskiFeb 16 2013 — edited Mar 4 2013
Hello,

I'm having an issue with an application I built for one of the campuses at the college I work at. The application is a queuing system where there are stations for students to check in, admin stations where staff can see these students and "call" them, and displays outside each employees office that shows the student that was called. There are about 20 of these last type of display panels. I have the following code in my page footer to poll the DB for the most recent called student for a specific room:
<script type="text/javascript">
<!--
var refresh_region = function( workstation_in, div_in ) {
    $.get(
        'wwv_flow.show', 
        {"p_request"      : 'APPLICATION_PROCESS=F_NEXT_STUDENT',
         "p_flow_id"      : $v('pFlowId'),      //app id
         "p_flow_step_id" : $v('pFlowStepId'),  //page id
         "p_instance"     : $v('pInstance'),    //session id
         "x01"            : workstation_in
        },
        function(data) {
            $(div_in).html(data);
        }
    );
    setTimeout(function() { refresh_region( workstation_in, div_in ) }, 5000);
}

refresh_region( '&P7_WORKSTATION_IN.', '#next_student_div' );
//-->
</script>
The OnDemand process, F_NEXT_STUDENT runs the following query and returns the result:
select a.FIRST_NAME || ' ' || a.LAST_NAME
into   full_name
from   ONESTOP_QUEUE a
where  a.WORKSTATION_ID_CALLED = in_workstation_id
and    a.STATUS = 'CALLED'
and    a.QUEUE_ID = (
   select min( c.QUEUE_ID )
   from   ONESTOP_QUEUE c
   where  c.WORKSTATION_ID_CALLED = in_workstation_id
 and    c.STATUS = 'CALLED');
However, when all of these display panels are turned on (and I use code like this in other pages for similar purposes) the application becomes sluggish and eventually unresponsive. At first we had the application running off a box with Oracle XE. We eventually migrated to a full blown 11g install with APEX Listener and GlassFish. My DBA says everything looks ok on the DB side so I've been trying to dig in other areas to see where the bottleneck may be. After inspecting the Active Sessions report in APEX, I saw that there's a ton of connections being generated (> 30,000). This doesn't seem like a good thing to me and I'm trying to figure out what I'm doing wrong.

At first I was using $.post() instead of $.()get. I was also using setInterval() instead of a setTimeout() loop. However, none of these changes seemed to really help the situation much. I'm at a loss for how else to improve the performance of this application. Any suggestions on what I can try?

Most of the app's functionality is on apex.oracle.com
WORKSPACE: SCCC_TEST
USER/PASS: TEST/test
Direct URL to the page (I pass in the worksation ID): http://apex.oracle.com/pls/apex/f?p=65890:7:0::::P7_WORKSTATION_IN:ADMISSIONS_1

Thanks in advance for any help.
This post has been answered by Patrick Wolf-Oracle on Feb 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2013
Added on Feb 16 2013
21 comments
3,574 views