Site Network: Home | About

For the last couple of weeks we've been facing 750 performance issue in our project. 75o application takes customer's response and stores them in DB. (740 application offers products to the customers). Today, Devyani and Ajoy from GECF America's DBA team have asked us to run a performance test so that they can monitor it. I started with 100K requests which caused router to get down. Router is mediator b/w our database and java TestHarness application. As load is more(100K), TestHarness creates more threads(>120), which router couldn't handle. We've decided to go with 5K offers. DBA suggested us to change cache value of SEQUENCE from 20 to 1500. Pankaj did that. He also sent me the SQL stmt to do that. ALTER SEQUENCE RESPONSE_SEQ CACHE 1500 We also set the DEBUBBING MODE ON in our oracle scripts. Oracle scripts were developed in such a way that if debug mode is ON, only then every activity in DB level is logged. I started test with 5K with these settings. This time performance is good. % of response time that crossed 100ms has come down from 98% to 12%. Very good change. Then Ajoy said, "In RAC environment, when multiple instances try to access the same sequence, there could be a contention". Then Pankaj suggested another round of test with 100K with DEBUG MODE OFF. This time, again performance has gone down to 98%!!!!!!!!. Unable to guess the route cause. I left the office after sharing test procedure with Pankaj, as it is already 9.00 PM. Will come back with a post on the same thread, once this performance issue is resolved. I think, here, all the possible usages of SEQUENCE is explained http://www.psoug.org/reference/sequences.html Interesting point that I found on this page is, "How to reset a sequence to particular number?(or Reset sequence to zero)". For this, if the current value of sequence is 12, then alter the sequence to increment by -12 and execute seq.nextval stmt. That's it, current value of sequence would become zero. CREATE SEQUENCE seq; SELECT seq.NEXTVAL FROM dual; SELECT seq.NEXTVAL FROM dual; SELECT seq.NEXTVAL FROM dual; COLUMN S new_val inc; -- latest value in "S" column will be placed in "inc" variable(here inc = 3) . To put the same in other way, this stmt will create a substitution variable "inc", whose value will be automatically replaced by the new value of column "S". SELECT seq.NEXTVAL S FROM dual; -- value of S is 4, therefore inc = 4 ALTER SEQUENCE seq INCREMENT BY -&inc MINVALUE 0; -- inc will be automatically replaced with 4 SELECT seq.NEXTVAL S FROM dual; -- returns zero ALTER SEQUENCE seq increment by 1; -- reverting the seq increment value SELECT seq.NEXTVAL FROM dual; Earlier, I was thinking that is there any option to reset the sequence val directly. I think NO. No problem, above method is pretty well, I think. Get back to U - Karteeek

0 Comments:

Post a Comment