High cpu usage during JSF lifecycle phase execution
In our performance test we encountered a high cpu usage (100%) and the thread dumps indicated that most of the times the threads are either executing restore view or render response phase of the JSF lifecycle or they are blocked while accessing the jar files which containing the xhtml pages.
One of the thread dump of a runnable thread is
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:317)
at javax.faces.component.ComponentStateHelper.get(ComponentStateHelper.java:174)
at javax.faces.component.ComponentStateHelper.add(ComponentStateHelper.java:216)
at javax.faces.component.UIComponent.setValueExpression(UIComponent.java:436)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler$CompositeComponentRule$CompositeExpressionMetadata.applyMetadata(CompositeComponentTagHandler.java:631)
at com.sun.faces.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:81)
at javax.faces.view.facelets.MetaTagHandler.setAttributes(MetaTagHandler.java:129)
at javax.faces.view.facelets.DelegatingMetaTagHandler.setAttributes(DelegatingMetaTagHandler.java:102)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.setAttributes(CompositeComponentTagHandler.java:246)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyNextHandler(CompositeComponentTagHandler.java:184)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)while a thread trace for a blocked thread is
java.lang.Thread.State: BLOCKED (on object monitor)
at java.util.zip.ZipFile.getEntry(ZipFile.java:302)
- waiting to lock <0x00000000c0f678f8> (a java.util.jar.JarFile)
at java.util.jar.JarFile.getEntry(JarFile.java:225)
at java.util.jar.JarFile.getJarEntry(JarFile.java:208)
at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:817)
at sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:795)
at sun.misc.URLClassPath.findResource(URLClassPath.java:172)
at java.net.URLClassLoader$2.run(URLClassLoader.java:551)
at java.net.URLClassLoader$2.run(URLClassLoader.java:549)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findResource(URLClassLoader.java:548)
at java.lang.ClassLoader.getResource(ClassLoader.java:1138)
at java.lang.ClassLoader.getResource(ClassLoader.java:1133)
at org.glassfish.web.loader.WebappClassLoader.getResource(WebappClassLoader.java:1156)
at org.glassfish.web.loader.WebappClassLoader.getResourceFromJars(WebappClassLoader.java:1111)
at org.apache.catalina.core.StandardContext.getMetaInfResource(StandardContext.java:7586)
at org.apache.catalina.core.StandardContext.getResource(StandardContext.java:6979)
at org.apache.catalina.core.ApplicationContext.getResource(ApplicationContext.java:382)
at org.apache.catalina.core.ApplicationContextFacade.getResource(ApplicationContextFacade.java:260)
at com.sun.faces.context.ExternalContextImpl.getResource(ExternalContextImpl.java:502)
at com.sun.faces.application.resource.WebappResourceHelper.getURL(WebappResourceHelper.java:119)
at com.sun.faces.application.resource.ResourceImpl.getURL(ResourceImpl.java:190)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyCompositeComponent(CompositeComponentTagHandler.java:366)
at com.sun.faces.facelets.tag.jsf.CompositeComponentTagHandler.applyNextHandler(CompositeComponentTagHandler.java:191)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.IncludeHandler.apply(IncludeHandler.java:120)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:107)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:178)
at com.sun.faces.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:395)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:366)
at com.sun.faces.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:112)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:184)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:774)
at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:223)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:453)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)We use glassfish 3.1.1 as our application and the project_stage property is set to System_test. I would like to get suggestions on how should I investigate this further. Is this a normal behavior? Does glassfish provide an alternative for resolving blocked threads like some caching mechanism for resources etc?
Thanks in advance
Nik wrote:
Even if it is legal, have you tried moving them out of there (just to pinpoint a possible bug since the stacktrace indicates a wait on a jar file)?Indeed. If that clears up the issue it is good information to put in a JSF bug report (which may even cascade to the Glassfish level).
Putting resources in a jar file is only really useful when you want to share those resources among different web applications, which should be a rare case. Even when it happens I would probably still choose to simply copy the resources so they are individually managed and you don't get unnecessary dependencies between applications. Just because something is technically possible doesn't make it a good idea.
Similar Messages
-
High CPU usage during 15 acquiring analog input and write to file (suggestion needed)
Helllo everybody,
I have a problem about the usage of CPU now i am using a realtime target (PXI-8186) with Daq (PXI-6259) to get 15 analog signals at the rate of 10kHz
at first i try to get signal at different rate but i found out that all of the channels share the same clock so i get the highest frequency that i desired after that i do
some data manipulation with displaying charts and use shift register to stack data in array of string finally i write the data to spreadsheet every 5 second, by doing this the CPU usage
is always 100% and reduce by the time the file is recordedto 71% or so and then start to increase to 100% again. I think the things that make CPU usage too high are
1. Time loop: because i set the period to be 10ms maybe this is too low.
2. The shift registered: may be it use too much overhead memory but i do not know other method to stack data before writing to a file
3. RAM too low: The RAM of PXI is only 256mb
4. Poor program arrangement: Because i am new to labview the program is not arranging correctly or i may use some inappropriate structure.
My program is very messy sorry about it because i avoid using SubVI and i am new to labview. Please help any suggestion is apperciated. Thanks in advance.
Best regard
Wuttikrai
Attachments:
target save.vi 328 KBIt looks like you are writing your data to disk every so often. For that reason, I recommend making it based on the number of samples you have instead of the time. With that you can preallocate your arrays with constants going into the shift registers. You then use Replace Array Subset to update your arrays. When you write to the file, make sure you go back to overwriting the beginning of your array. This will greatly reduce the amount of time you spend reallocating memory and will reduce your memory usage.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines -
Is there a way to monitor CPU usage during the execution of a vi?
I am wondering if there is a way, using LabView, to monitor the CPU usage during the execution of a vi. I want to be able to programmatically adjust the program controls based on the CPU usage. This program is designed to run all day in the background.
Thanks!JAI wrote:
> I am wondering if there is a way, using LabView, to monitor the CPU
> usage during the execution of a vi. I want to be able to
> programmatically adjust the program controls based on the CPU usage.
> This program is designed to run all day in the background.
>
> Thanks!
There are at least two Windows tools you can use to see CPU usage
(depending on what version of Windows you have). The Task Manager
(ctrl-alt-del) has a panel that shows CPU usage. There is another
program that has more options as to what to watch. Under W2K, it is in
the Administrative Tools in the Control Panel and is called Performance.
Play around with adding various new "Counters".
Another option is to measure CPU usage programmatically. George Zou
has a tool that makes the appropriate dll call. Check out
http://www.geocities.com/gzou999/index.html
Regards,
Dave Thomson
David Thomson 303-499-1973 (voice and fax)
Original Code Consulting [email protected]
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Developer
Certified Instrument Driver Developer
Research Scientist 303-497-3470 (voice)
NOAA Aeronomy Laboratory 303-497-5373 (fax)
Boulder, Colorado [email protected]
There are 10 kinds of people: those who understand binary,
and those who don't. -
This is a spin off from another thread which started off as slow inserts. But what actaully happens is every insert is preceded by select it turned out that the select was slow.
We have a multi-tier web application conencting to the DB using connection pool and inserting about a 100000 records in a table. To isolate the issue I wrote a PL/SQL which does the same thing.
This problem happens every time the schema is recreated or the table dropped and created again and we start inserting. When the table is empty, the selects choose a full table scan but as the records are inserted it continues to use the same even though after a few thousands of rows I run stats. But as its running if gather stats and flush the shared pool, it picks up the new plan using the indexes and immediately gets faster.
But in either case, full tablescan being slow after a few thousands of rows or using the index and getting much faster. Or me just doing the same select and no inserts on a table with 100000 rows, the CPU seems to be pegged to the core.
The code snipped repeated again
DECLARE
uname NVARCHAR2 (60);
primid NVARCHAR2 (60);
num NUMBER;
BEGIN
FOR i IN 1 .. 100000
LOOP
uname := DBMS_RANDOM.STRING ('x', 20);
primid := DBMS_RANDOM.STRING ('x', 30);
DBMS_OUTPUT.put_line (uname || ' ==> ' || primid);
SELECT COUNT (*)
INTO num
FROM TEST
WHERE ID = 0
AND (primid = primid OR UPPER (username) = uname OR uiname = uname
AND (deldate IS NULL)
ORDER BY TIME DESC;
INSERT INTO TEST
VALUES (0, uname, uname, 1, uname, primid);
IF MOD (i, 200) = 0
THEN
COMMIT;
DBMS_OUTPUT.put_line ('Commited');
END IF;
END LOOP;
END;This is the original thread
Re: Slow insertsMaybe if you post the actual code, or a code as similar to the actual code, the users of this forum may provide you with more appropriate suggestions.
Personally, I would like to understand what is the logic behind, so I can provide you with better advices.
Anyway, let's focus on the code that we currently have on the table.
Why your CPU goes high?
- Huge amount of LIOs produced by SELECT statement which is executed 100000 times.
- Usage of single-row / aggregate functions
- You mentioned you have some indexes created on table TEST. Index maintenance consumes some CPU as well.
Let's focus on the SELECT statement, since it is the most important reason for having high number of LIOs thus having high CPU usage.
I built a test case using the query you provided, with one difference, I named TEST table columns as COL1, COL2, etc. And instead of 100,000 cycles, I did 10,000
declare
uname varchar2(60);
pname varchar2(60);
num number(5);
begin
for i in 1..10000 loop
uname:=dbms_random.string('x',30);
pname:=dbms_random.string('x',20);
select count(1)
into num
from test
where col1=0
and (col2=uname or upper(col5)=pname or col3=uname)
and col4 is not null;
insert into test
values (0,uname,pname,1,uname,uname);
if mod(i,200)=0 then
commit;
end if;
end loop;
end;When I run 10046 trace and made tkprof report, I got the following for the SELECT part:
SELECT COUNT(1)
FROM
TEST WHERE COL1=0 AND (COL2=:B1 OR UPPER(COL5)=:B2 OR COL3=:B1 ) AND COL4 IS
NOT NULL
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 10050 0.48 0.43 0 0 50 0
Fetch 10000 94.07 94.37 0 2910664 2 10000
total 20052 94.56 94.80 0 2910664 52 10000As you can see, tkprof report indicated high CPU usage and 2,910,664 LIO calls.
The execution plan (I didn't include that part) indicated FULL TABLE scan on table TEST was used.
At this point the goal should be to reduce the number of LIO calls.
For this purpose I created the following indexes:
TEST_IDX1 on TEST(col2)
TEST_IDX2 on TEST(col3)
TEST_IDX3 on TEST(upper(col5)) - a Function Based Index
Let's forget about the statistics at this moment.
I will use index_combine hint in the SELECT statement to make CBO to try every index combination for listed indexes (B-Tree) and make bitmap conversion.
The new code looks like this
declare
uname varchar2(60);
pname varchar2(60);
num number(5);
begin
for i in 1..10000 loop
uname:=dbms_random.string('x',30);
pname:=dbms_random.string('x',20);
select /*+ index_combine(test test_idx1 test_idx2 test_idx3) */ count(1)
into num
from test
where col1=0
and (col2=uname or upper(col5)=pname or col3=uname)
and col4 is not null;
insert into test
values (0,uname,pname,1,uname,uname);
if mod(i,200)=0 then
commit;
end if;
end loop;
end;After running 10046 trace and creating tkprof report, I got the following result:
SELECT /*+ index_combine(test test_idx1 test_idx2 test_idx3) */ COUNT(1)
FROM
TEST WHERE COL1=0 AND (COL2=:B1 OR UPPER(COL5)=:B2 OR COL3=:B1 ) AND COL4 IS
NOT NULL
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 10000 0.79 0.70 0 0 0 0
Fetch 10000 0.68 0.71 3 59884 0 10000
total 20001 1.47 1.42 3 59884 0 10000
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 54 (recursive depth: 1)
Rows Row Source Operation
10000 SORT AGGREGATE (cr=59884 pr=3 pw=0 time=1188641 us)
0 TABLE ACCESS BY INDEX ROWID TEST (cr=59884 pr=3 pw=0 time=1012723 us)
0 BITMAP CONVERSION TO ROWIDS (cr=59884 pr=3 pw=0 time=915796 us)
0 BITMAP OR (cr=59884 pr=3 pw=0 time=820728 us)
0 BITMAP CONVERSION FROM ROWIDS (cr=20039 pr=1 pw=0 time=258455 us)
0 INDEX RANGE SCAN TEST_IDX1 (cr=20039 pr=1 pw=0 time=157107 us)(object id 52988)
0 BITMAP CONVERSION FROM ROWIDS (cr=19902 pr=1 pw=0 time=198466 us)
0 INDEX RANGE SCAN TEST_IDX2 (cr=19902 pr=1 pw=0 time=109999 us)(object id 52989)
0 BITMAP CONVERSION FROM ROWIDS (cr=19943 pr=1 pw=0 time=198730 us)
0 INDEX RANGE SCAN TEST_IDX3 (cr=19943 pr=1 pw=0 time=107200 us)(object id 52990)As you can see the number of LIO calls fallen dramatically. Also CPU time is significantly less.
The second code completed in few seconds compared to the previous one which needed about 100 seconds to complete.
Please be aware that this is just an example of tuning the code that you provided.
This solution might not be suitable for your actual code, since we don't have any information about it. That's why it is important to give us as much information as you could, so you can get the most appropriate answer.
If the test code is similar to the actual one, you should focus on reducing LIOs calls.
In order to achieve it, you may want to use hints to force an index to be used.
Cheers,
Mihajlo -
We have a table named "tbl_geodata" which has address and latitude and longitude values. We
also have a "History" table which has only latitude and longitude values including other information. What we need is like following...
We get a set of records based on a query from "History" (lat long values), say 5000 records
Now we are using the following formula to calculate address from the "tbl_geodata" for each row
(5000 rows).
SELECT top 1 geo_street,geo_town,geo_country,( 3959 acos( cos( radians(History.lat) ) cos( radians(
gps_latitude ) ) cos( radians( gps_longitude ) - radians(History.long) ) + sin( radians(History.lat) ) sin( radians( gps_latitude ) ) ) ) AS distance FROM tbl_geodata ORDER BY distance
Currently we are seeing high cpu utilisation and performance issue. What would be the optimized way to do
thisWe are using SQL Server Web Edition. We have a table which has around 120 million records (every second around 100 insertion). It has a AFTER INSERT trigger to update another table. There is following performance issue we are facing.
High CPU Usage
Insertion failed (Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting
to create multiple active connections. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=0; handshake=10046; [Login] initialization=0; authentication=0; [Post-Login] complete=3999;)
Insertion Failed (A severe error occurred on the current command. The results, if any, should be discarded.)
Insertion Failed (Some time we are getting connection pool error.. There is no limit set in the connection string)
I ran sp_who2 command and found a lot of queries are in suspended mode..
here is the "sys.dm_os_sys_info" result...
cpu_count hyperthread_ratio
physical_memory_in_bytes virtual_memory_in_bytes
8 8
12853739520
8796092891136
Can anyone please suggest the improvement steps... -
I'm using Vibe Desktop Version 1.0.1 (17445) on Mac OSX 10.8. During file syncronization there is a realy high CPU load:
Does anybody else see high CPU usage while using Vibe Desktop?Originally Posted by sbuechsenschuetz
Does anybody else see high CPU usage while using Vibe Desktop?
I'm the Novell developer responsible for Vibe Desktop and I'm sorry for the delayed response...I've been out of the office. Can you give me a little more information? I want to get a better feel for when the high CPU usage occurs.
Approximately how many files are synced to your Desktop?
When you click on the icon in the menu bar and select "Synchronize Now", how long does it take and how is the CPU usage? The first time you sync all the files down to your desktop can take some time, but once everything is in sync, forcing it to synchronize should not be very resource intensive. Is the high CPU utilization only when it is has files to download, or is it also high when there is nothing to download?
When Vibe Desktop is not syncing, it's still watching the file system for changes you make to the local copies of the files. Do you see noticeable CPU utilization when Vibe Desktop is not syncing? -
Sometimes, after a while, firefox (36.0.4) uses up 1 core of my CPU (is a quad core due to hypertreading). The way it happens is really strange. Many tabs without a problem until suddenly ff decides to floor it. This is alway in the run, not on startup or close. All add-ons need to ask my permissions to be activated, this includes flash.
On close, I ordered ff to clear all history and cookies.
Notes that could be important (The behavior encountered while using it. This varies from time to time):
opening new tabs (a lot or a few) => "heavy" load during site loading, then idling
==> The above makes sense
- same as above but load continues to be heavy. => could be some badly written javascript on the site, however, sometimes this occurs with sites I know have no stressful javascript
==> The above seems odd
- Browser is idle in the background (not actively using it). Then all of the sudden "lets floor it until closed".
==> The above seems pretty odd
- When confronted with high CPU usage, closing ff doesn't close it (the ff process remains active. Not a ff process, THE ff process). => High CPU usage remains
==> The above looks like that there is definitely something wrong here
This last one has some other things to keep in mind
- When it happens and I close ff, upon restarting it it will ALWAYS ask to close ff. After confirming to close it, it will start and behave normally.
- When killing ff via the task-manager, or other means like powershell commands, restarting it will result in an idle ff even after every tab is loaded again.
I hope this isn't a heisenbug and there is a solution to this, a reboot ff button would be a nice workaround though. I personally think that it must be some routine in the code that decides to go nuts for no reason.
If you need further details, feel free to ask.
Thanks in advanceTried those before and tried them again. Unfortunately, the problem keeps repeating itself at random times. As said, sometimes it doesn't occur and sometimes suddenly it does. Keep the following things in mind about this, what seems like a heisenbug, behavior.
- opening new tabs (a lot or a few) => "heavy" load during site loading, then idling
==> The above makes sense
- same as above but load continues to be heavy. => could be some badly written javascript on the site, however, sometimes this occurs with sites I know have no stressful javascript
==> The above seems odd
- Browser is idle in the background (not actively using it). Then all of the sudden "lets floor it until closed".
==> The above seems pretty odd
- When confronted with high CPU usage, closing ff doesn't close it (the ff process remains active. Not a ff process, THE ff process). => High CPU usage remains
==> The above looks like that there is definitely something wrong here
As stated, a reboot ff button would be a nice workaround. I personally think that something like a tread must get stuck in some sort of infinite loop. Browsing in ff works just fine though. I just don't like the fact that I turns into a "gasoline guzzler".
Again, thanks in advance -
CF 10 sp 12 Enterprise high CPU usage hangs services, 2012 server on 2012 Hyper-V host
The last 2 days - my [removed link] CF site has suffered from high CPU usage (on and off) that stops functionality.
This will last several minutes then suddenly the high usage stops a few minute later the high cpu usage starts again.
I don't have any scheduled processes allowed to run.
Restarting the coldfusion service during a high CPS incident - the cpu usage just picks up where it left off when restarted.
I have assigned 4 CPUs (normal) or 8CPUs (as a test) to the VM and I get the same high CPU then low usage. This is a fresh install several months ago on a new VM.
I'd like some Adobe support on this issue but can't seem to find the contact phone number.
This series of high and low cpu usage first started Monday AM about midnight until 7:00 AM Tuesday was quiet and Wednesday this AM I'm having the same issues.
Ideas?
Update: While waiting for this to post - the high CPU usage started again and this time I stopped and restarted the Jetty service ... and the CPU usage went away...
Update: the high cpu started again and a restart of the jetty service didn't help --- neither did the .net service restart... the cf10 application service did stop the high usage...
Jay Bietz
Message was edited by: Jay Bietz after post accepted.After 2 hang free days -- Friday midnight (above is the gcviewer ) and ~2 hours later had the hang condition again. Current java.config includes
java.args=-server -Xms4096m -Xmx4096m -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+UseParallelGC -Xbatch -Dcoldfusion.home={application.home} -Dcoldfusion.rootDir={application.home} -Dcoldfusion.libPath={application.home}/lib -Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true -Dcoldfusion.jsafe.defaultalgo=FIPS186Random -Dcom.sun.management.jmxremote.port=8701 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Xmn1024m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -verbose:gc -Xloggc:cfwhispererGClive4.log -Dcoldfusion.classPath={application.home}/lib/updates,{application.home}/lib,{application .home}/lib/axis2,{application.home}/gateway/lib/,{application.home}/wwwroot/WEB-INF/flex/j ars,{application.home}/wwwroot/WEB-INF/cfform/jars,C:\\CFusion10\\cfusion\\verisign\\payfl owpro\\Java\\PFProColdFusion,C:\\CFusion10\\cfusion\\verisign\\payflowpro\\Java\\PFProCold Fusion\\Verisign.jar
GCviewer shows that the full GCcollections suddenly start firing off many times in a short period of time.
Jay
will work on the tomcatlog issues next. -
Unusually high cpu usage with iMovie 6.0.3
I'm having trouble with very high cpu-usage. Just the open imovie app is taking up about 50%, during playback it sometimes peaks over 100%! The project file is pretty big (about 30 gig), but that is mainly because of the amount of footage imported into it. The movie itself is about 25 minutes in length. There is some audio editing going on: some soundeffects, musicfiles (no drm-protection), audio commentary that i recorded within imovie. I know that imovie has trouble when there is a lot of audio/audio editing involved and this project is probably a little more complex than other stuff i did in imovie, but i never had such problems. i can hardly use playback anymore. I recently updated Quicktime to 7.6.4 and Perian to version 1.2.1. Any ideas what's going on or how to work around the problems? Since the movie is about 80% finished i don't really want to start all over again. Thanks in advance for your input!
Hi Klaus1
I have several plug-ins by cfx and the slick volumes 4, 6 8 and 10. I can post a list of all of them if you like. Up to now they never made any trouble, but you'll never know...
The edit in the timeline is about 25 minutes long. But the project file contains captured dv-footage of about 2 hours, so that alone adds up to something like 26 GB. Then there are a few rendered effect-clips done with some of the plug-ins like stabilizing or color correction which also add to the 30 GB, as well as some audio-files (some music, my voice-over commentary). I emptied the trash several times while working on the movie. At this moment there are only a few MB of erased audio in it.
It all sounds a bit like this is an insanely huge and complex project, but as i said, i have done projects like this in imovie without the massive cpu-usage. I'd like to continue to use imovie, but if this problem keeps coming up with future projects, i might as well take the step and switch to Final Cut Express.
For now I will try your idea of exporting the movie as it is now and open it in a new project file.
Thanks for your help and input so far! -
SQL Server 2012 - RESOURCE MONITOR / PREEMPTIVE_XE_CALLBACKEXECUTE high CPU usage
Hello,
We are currently in the process of migrating an existing clustered SQL Server 2008 R2 instance over to a clustered SQL Server 2012 instance as we phase out the Windows Server 2008 with SQL Server 2008 R2.
The setup is identical for the SQL Server 2012 instance as it is on the SQL Server 2008 R2 instance. (meaning the RAM and CPU are both the same or better on the SQL Server 2012 instance)
The process in which we are migrating is that we're moving a few databases over to the new SQL Server 2012 instance each night. What we've noticed is that the CPU usage is much higher on the SQL Server 2012 instance than on the previous
SQL Server 2008 R2 instance even though the there is only 1/2 of the databases migrated to the 2012 instance.
Running the following script:
;with cte ([totalCPU]) as (select sum(cpu) from master.dbo.sysprocesses)
select
tblSysprocess.spid
, tblSysprocess.cpu
, CONVERT(BIGINT,(tblSysprocess.cpu * CONVERT(BIGINT,100))) / CONVERT(BIGINT, cte.totalCPU) as [percentileCPU]
, tblSysprocess.physical_io
, tblSysprocess.memusage
, tblSysprocess.cmd
, tblSysProcess.lastwaittype
from master.dbo.sysprocesses tblSysprocess
cross apply cte
order by tblSysprocess.cpu desc
Produces the following results:
In a clustered environment, is this normal and if not, does anyone know what this means or how to reduce the CPU usage?
Thanks.Hello,
The following query may help us identify extended events or audit configurations running on that SQL Server server that are producing that high CPU usage scenario.
SELECT
s.name
AS 'Sessions'
FROM
sys.server_event_sessions
AS s
WHERE
s.name
<> 'system_health'
and s.name
<> 'AlwaysOn_health';
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
DNS server process, high CPU usage
Hello,
I am having a problem with high CPU usage on DNS process. We have 1921 setup in network of about 100 workstations that use it as DNS server. It also performs split view functionality for couple of domains in order to avoid hairpin NAT. I know that a router is not fit for heavy server duty but such setup was unfortunately necessary.
In peak work hours we oftenly have CPU hitting 100% with DNS server process being the root cause,and on several occasions we had DNS process stuck in such state for prolonged periods of time during which other router functions were affected (t's a default gateway, IPsec concentrator etc.). Sometimes shutting the process and restarting it would solve the problem, but once it required a full reload in order to restore functionality (such was the description that engineer on duty reported to me).
Forwarder queue statistics:
Current size = 0
Maximum size = 86
Drops = 0
IOS upgrade did not help, we are currently running 15.2(2)T.
The question is ... is such behaviour (CPU load) to be expected on LAN with 100 workstations due to slow CPU on router or we have bugged IOS DNS server (requiring a TAC case)?
The previous solution seem to do this functionality quite nicely (even though it was also a router), so I am not inclined to think that we are dealing with someone DoS-ing the DNS (WAN access to DNS is of course forbidden)
P.S.
Since we moved servers off the routers DNS, we do not receive complaints, but we had a couple of unresolved messages a day while mail server was using router for DNS. I am suspecting that an old bug where IOS DNS servers occasionaly sends clients back empty DNS replies (properly formatted message but without A record) could be still around?hi,
i have the same problem on UC540 and 2911 on IOS 15.0.1. CPU high, router crashed. Reboot helps but until CPU usage spikes again. the only fix is to remove "ip dns server" from config and use a different DNS server
111 1111 1111111111
999999999900077777777799999777778888000099990000000000
322222111119999900077776666622222111119999000088880000000000
100 ******** ******************
90 ************* ***** **********************
80 *************************** **********************
70 ******************************************************
60 ******************************************************
50 ******************************************************
40 ******************************************************
30 ******************************************************
20 ******************************************************
10 ******************************************************
0....5....1....1....2....2....3....3....4....4....5....5....6
0 5 0 5 0 5 0 5 0 5 0
CPU% per second (last 60 seconds)
after removed IP dns server
111
99999999990007777777779999977777888
33333333332222211111999990007777666662222211111999
100 ********
90 ************* ***** ***
80 *************************** ***
70 ***********************************
60 ***********************************
50 ***********************************
40 ***********************************
30 ***********************************
20 ***********************************
10 ***********************************
0....5....1....1....2....2....3....3....4....4....5....5....6
0 5 0 5 0 5 0 5 0 5 0
CPU% per second (last 60 seconds) -
High CPU usage in cisco 7613 with rsp720-3cxl
Hi everybody,
our cisco 7613 has about 4.5 Gbps Tx/Rx IP traffic in total, and we run ospf with other cisco cloud for routing I list in the following some our router show.what is your idea about our high cpu usage .Is it in normal range with the listed cards and modules.How can I tune the rsp720 and other SIP-200,400,600 for better performances
why our interrupt rate is high ,and one thing more the total sum of 5sec in separate rows not equal to cpu utilization for five second 50%
show proc cpu sor
CPU utilization for five seconds: 50%/46%; one minute: 54%; five minutes: 59%
PID Runtime(ms) Invoked uSecs 5Sec 1Min 5Min TTY Process
8 196795220 12640741 15568 1.51% 0.38% 0.26% 0 Check heaps
224 1048610528 4169501364 0 1.19% 1.45% 1.44% 0 IP Input
13 374006320 3155162661 0 0.23% 0.26% 0.24% 0 ARP Input
217 119862004 985030884 121 0.15% 0.32% 0.25% 0 ADJ resolve pro
c
185 537716 1825736183 0 0.07% 0.03% 0.02% 0 ACE Tunnel Task
260 1550992 2983272818 0 0.07% 0.13% 0.15% 0 Ethernet Msec T
i
305 38186336 58050485 657 0.07% 0.02% 0.00% 0 XDR mcast
34 67208 11707798 5 0.07% 0.00% 0.00% 0 IPC Loadometer
27 232776 57160812 4 0.07% 0.01% 0.00% 0 IPC Periodic Ti
m
325 17539200 92894502 188 0.07% 0.15% 0.15% 0 CEF: IPv4 proce
s
195 7406636 43782487 169 0.07% 0.00% 0.00% 0 esw_vlan_stat_p
r
show ip route summ
IP routing table name is default (0x0)
IP routing table maximum-paths is 32
Route Source Networks Subnets Replicates Overhead Memory (bytes)
static 1 120 0 7620 20812
connected 0 313 0 18860 53836
ospf 98 17 4892 0 589020 863984
Intra-area: 89 Inter-area: 383 External-1: 0 External-2: 0
NSSA External-1: 0 NSSA External-2: 4437
bgp 12880 0 1 0 60 172
External: 1 Internal: 0 Local: 0
ospf 410 0 269 0 16220 47344
Intra-area: 1 Inter-area: 0 External-1: 0 External-2: 268
NSSA External-1: 0 NSSA External-2: 0
internal 137 260544
Total 155 5595 0 631780 1246692
sh module
Mod Ports Card Type Model Serial No.
1 0 4-subslot SPA Interface Processor-200 7600-SIP-200
2 0 4-subslot SPA Interface Processor-400 7600-SIP-400
3 24 CEF720 24 port 1000mb SFP WS-X6724-SFP
6 1 1-subslot SPA Interface Processor-600 7600-SIP-600
7 2 Route Switch Processor 720 (Active) RSP720-3CXL-GE
8 2 Route Switch Processor 720 (Cold) RSP720-3CXL-GE
show ver
System image file is "bootdisk:c7600rsp72043-adventerprisek9-mz.122-33.SRE2.bin"
1 SIP-200 controller .
1 SIP-400 controller (1 Channelized OC3/STM-1).
1 SIP-600 controller (1 TenGigabitEthernet).
2 Virtual Ethernet interfaces
28 Gigabit Ethernet interfaces
1 Ten Gigabit Ethernet interface
1 Channelized STM-1 port
1 Channelized STM-1 port
show int vlan 1
Encapsulation ARPA, loopback not set
Keepalive not supported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of "show interface" counters 2d23h
Input queue: 0/75/2886/1830 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 2380531000 bits/sec, 287383 packets/sec
5 minute output rate 422133000 bits/sec, 254113 packets/sec
L2 Switched: ucast: 1200869468 pkt, 101172643240 bytes - mcast: 253599 pkt, 78
873415 bytes
L3 in Switched: ucast: 60947040633 pkt, 68919665115039 bytes - mcast: 0 pkt, 0
bytes mcast
L3 out Switched: ucast: 52594517004 pkt, 9869168832783 bytes mcast: 0 pkt, 0 b
ytes
62147839148 packets input, 69016175499764 bytes, 0 no buffer
Received 257634 broadcasts (0 IP multicasts)
0 runts, 0 giants, 15 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
53647248858 packets output, 10292998021217 bytes, 0 underruns
0 output errors, 0 interface resets
0 unknown protocol drops
0 output buffer failures, 0 output buffers swapped outThank you for your hints and replying
These are our show ibc in 1 min interval
Interface information:
Interface IBC0/0
5 minute rx rate 20045000 bits/sec, 30183 packets/sec
5 minute tx rate 47394000 bits/sec, 60212 packets/sec
19879272237 packets input, 4006174536193 bytes
19835355282 broadcasts received
19808585787 packets output, 3981305571968 bytes
90548 broadcasts sent
0 Bridge Packet loopback drops
19756362091 Packets CEF Switched, 1320184 Packets Fast Switched
0 Packets SLB Switched, 0 Packets CWAN Switched
Label switched pkts dropped: 0 Pkts dropped during dma: 339549
Invalid pkts dropped: 0 Pkts dropped(not cwan consumed): 0
IPSEC pkts dropped: 635184
Xconnect pkts processed: 0, dropped: 0
Xconnect pkt reflection drops: 0
Total paks copied for process level 0
Total short paks sent in route cache 2605317676
Total throttle drops 265338 Input queue drops 5831090
total spd packets classified (120217214 low, 174503 medium, 3073 high)
total spd packets dropped (339549 low, 0 medium, 0 high)
spd prio pkts allowed in due to selective throttling (0 med, 0 high)
IBC resets = 1; last at 23:52:49.004 Sat Jan 19 2013
Driver Level Counters: (Cumulative, Zeroed only at Reset)
Frames Bytes
Rx(0) 26537712 3421085217
Rx(1) 3449063135 2838813650
Tx(0) 3390340306 2016620276
Input Drop Frame Count
Rx0 = 0 Rx1 = 2488435
Per Queue Receive Errors:
FRME OFLW BUFE NOENP DISCRD DISABLE BADCOUNT
Rx0 0 0 0 0 0 0 0
Rx1 0 0 0 3633 0 0 0
Tx Errors/State:
One Collision Error = 0 More Collisions = 0
No Encap Error = 0 Deferred Error = 0
Loss Carrier Error = 0 Late Collision Error = 0
Excessive Collisions = 0 Buffer Error = 0
Tx Freeze Count = 0 Tx Intrpt Serv timeout= 1
Tx Flow State = FLOW_ON
Tx Flow Off Count = 0 Tx Flow On Count = 0
Counters collected at Idb:
Is input throttled = 0 Throttle Count = 0
Rx Resource Errors = 0 Input Drops = 2488435
Input Errors = 194243
Output Drops = 0 Giants/Runts = 0/0
Dma Mem Error = 0 Input Overrun = 0
Hash match table for multicast (in use 0, maximum 64 entries):
show ibc
Interface information:
Interface IBC0/0
5 minute rx rate 20194000 bits/sec, 30412 packets/sec
5 minute tx rate 47753000 bits/sec, 60663 packets/sec
19891125514 packets input, 4007158118761 bytes
19847185365 broadcasts received
19820407164 packets output, 3982279276274 bytes
90576 broadcasts sent
0 Bridge Packet loopback drops
19768178233 Packets CEF Switched, 1321008 Packets Fast Switched
0 Packets SLB Switched, 0 Packets CWAN Switched
Label switched pkts dropped: 0 Pkts dropped during dma: 339549
Invalid pkts dropped: 0 Pkts dropped(not cwan consumed): 0
IPSEC pkts dropped: 635574
Xconnect pkts processed: 0, dropped: 0
Xconnect pkt reflection drops: 0
Total paks copied for process level 0
Total short paks sent in route cache 2606549061
Total throttle drops 265338 Input queue drops 5831090
total spd packets classified (120252754 low, 174531 medium, 3074 high)
total spd packets dropped (339549 low, 0 medium, 0 high)
spd prio pkts allowed in due to selective throttling (0 med, 0 high)
IBC resets = 1; last at 23:52:49.004 Sat Jan 19 2013
Driver Level Counters: (Cumulative, Zeroed only at Reset)
Frames Bytes
Rx(0) 26550723 3422835145
Rx(1) 3461063605 176652699
Tx(0) 3402319442 3368513724
Input Drop Frame Count
Rx0 = 0 Rx1 = 2490155
Per Queue Receive Errors:
FRME OFLW BUFE NOENP DISCRD DISABLE BADCOUNT
Rx0 0 0 0 0 0 0 0
Rx1 0 0 0 3633 0 0 0
Tx Errors/State:
One Collision Error = 0 More Collisions = 0
No Encap Error = 0 Deferred Error = 0
Loss Carrier Error = 0 Late Collision Error = 0
Excessive Collisions = 0 Buffer Error = 0
Tx Freeze Count = 0 Tx Intrpt Serv timeout= 1
Tx Flow State = FLOW_ON
Tx Flow Off Count = 0 Tx Flow On Count = 0
Counters collected at Idb:
Is input throttled = 0 Throttle Count = 0
Rx Resource Errors = 0 Input Drops = 2490155
Input Errors = 194358
Output Drops = 0 Giants/Runts = 0/0
Dma Mem Error = 0 Input Overrun = 0
Hash match table for multicast (in use 0, maximum 64 entries):
and sorry what is your idea about total sum of 5sec in separate rows not equal to cpu utilization for five second 50% -
XML select query causing very high CPU usage.
Hi All,
In our Oracle 10.2.0.4 Two node RAC we are facing very high CPU usage....and all of the top CPU consuming processes are executing this below sql...also these statements are waiting for some gc wiat events as shown below.
SELECT B.PACKET_ID FROM CM_PACKET_ALT_KEY B, CM_ALT_KEY_TYPE C, TABLE(XMLSEQUENCE ( EXTRACT (:B1 , '/AlternateKeys/AlternateKey') )) T
WHERE B.ALT_KEY_TYPE_ID = C.ALT_KEY_TYPE_ID AND C.ALT_KEY_TYPE_NAME = EXTRACTVALUE (VALUE (T), '/AlternateKey/@keyType')
AND B.ALT_KEY_VALUE = EXTRACTVALUE (VALUE (T), '/AlternateKey')
AND NVL (B.CHILD_BROKER_CODE, '6209870F57C254D6E04400306E4A78B0') =
NVL (EXTRACTVALUE (VALUE (T), '/AlternateKey/@broker'), '6209870F57C254D6E04400306E4A78B0')
SQL> select sid,event,state from gv$session where state='WAITING' and event not like '%SQL*Net%';
SID EVENT STATE
66 jobq slave wait WAITING
124 gc buffer busy WAITING
143 gc buffer busy WAITING
147 db file sequential read WAITING
222 Streams AQ: qmn slave idle wait WAITING
266 gc buffer busy WAITING
280 gc buffer busy WAITING
314 gc cr request WAITING
317 gc buffer busy WAITING
392 gc buffer busy WAITING
428 gc buffer busy WAITING
471 gc buffer busy WAITING
518 Streams AQ: waiting for time management or cleanup tasks WAITING
524 Streams AQ: qmn coordinator idle wait WAITING
527 rdbms ipc message WAITING
528 rdbms ipc message WAITING
532 rdbms ipc message WAITING
537 rdbms ipc message WAITING
538 rdbms ipc message WAITING
539 rdbms ipc message WAITING
540 rdbms ipc message WAITING
541 smon timer WAITING
542 rdbms ipc message WAITING
543 rdbms ipc message WAITING
544 rdbms ipc message WAITING
545 rdbms ipc message WAITING
546 rdbms ipc message WAITING
547 gcs remote message WAITING
548 gcs remote message WAITING
549 gcs remote message WAITING
550 gcs remote message WAITING
551 ges remote message WAITING
552 rdbms ipc message WAITING
553 rdbms ipc message WAITING
554 DIAG idle wait WAITING
555 pmon timer WAITING
79 jobq slave wait WAITING
117 gc buffer busy WAITING
163 PX Deq: Execute Reply WAITING
205 db file parallel read WAITING
247 gc current request WAITING
279 jobq slave wait WAITING
319 LNS ASYNC end of log WAITING
343 jobq slave wait WAITING
348 direct path read WAITING
372 db file scattered read WAITING
475 jobq slave wait WAITING
494 gc cr request WAITING
516 Streams AQ: qmn slave idle wait WAITING
518 Streams AQ: waiting for time management or cleanup tasks WAITING
523 Streams AQ: qmn coordinator idle wait WAITING
528 rdbms ipc message WAITING
529 rdbms ipc message WAITING
530 Streams AQ: waiting for messages in the queue WAITING
532 rdbms ipc message WAITING
537 rdbms ipc message WAITING
538 rdbms ipc message WAITING
539 rdbms ipc message WAITING
540 rdbms ipc message WAITING
541 smon timer WAITING
542 rdbms ipc message WAITING
543 rdbms ipc message WAITING
544 rdbms ipc message WAITING
545 rdbms ipc message WAITING
546 rdbms ipc message WAITING
547 gcs remote message WAITING
548 gcs remote message WAITING
549 gcs remote message WAITING
550 gcs remote message WAITING
551 ges remote message WAITING
552 rdbms ipc message WAITING
553 rdbms ipc message WAITING
554 DIAG idle wait WAITING
555 pmon timer WAITINGI am not at all able to understand what this SQL is...i think its related to some XML datatype.
Also not able to generate execution plan for this sql using explain plan- getting error(ORA-00932: inconsistent datatypes: expected - got -)
Please help me in this issue...
How can i generate execution plan?
Does this type of XML based query will cause high GC wiat events and buffer busy wait events?
How can i tune this query?
How can i find that this is the only query causing High CPU usage?
Our servers are having 64 GB RAM and 16 CPU's..
OS is Solaris 5.10 with UDP as protocol for interconnect..
-YasserI found some more xml queries as shown below.
SELECT XMLELEMENT("Resource", XMLATTRIBUTES(RAWTOHEX(RMR.RESOURCE_ID) AS "resourceID", RMO.OWNER_CODE AS "ownerCode", RMR.MIME_TYPE AS "mimeType",RMR.FILE_SIZE AS "fileSize", RMR.RESOURCE_STATUS AS "status"), (SELECT XMLAGG(XMLELEMENT("ResourceLocation", XMLATTRIBUTES(RAWTOHEX(RMRP.REPOSITORY_ID) AS "repositoryID", RAWTOHEX(DIRECTORY_ID) AS "directoryID", RESOURCE_STATE AS "state", RMRO.RETRIEVAL_SEQ AS "sequence"), XMLFOREST(FULL_PATH AS "RemotePath"))ORDER BY RMRO.RETRIEVAL_SEQ) FROM RM_RESOURCE_PATH RMRP, RM_RETRIEVAL_ORDER RMRO, RM_LOCATION RML WHERE RMRP.RESOURCE_ID = RMR.RESOURCE_ID AND RMRP.REPOSITORY_ID = RMRO.REPOSITORY_ID AND RMRO.LOCATION_ID = RML.LOCATION_ID AND RML.LOCATION_CODE = :B2 ) AS "Locations") FROM RM_RESOURCE RMR, RM_OWNER RMO WHERE RMR.OWNER_ID = RMO.OWNER_ID AND RMR.RESOURCE_ID = HEXTORAW(:B1 )
SELECT XMLELEMENT ( "Resources", XMLAGG(XMLELEMENT ( "Resource", XMLATTRIBUTES (B.RESOURCE_ID AS "id"), XMLELEMENT ("ContentType", C.CONTENT_TYPE_CODE), XMLELEMENT ("TextExtractStatus", B.TEXT_EXTRACTED_STATUS), XMLELEMENT ("MimeType", B.MIME_TYPE), XMLELEMENT ("NumberPages", TO_CHAR (B.NUM_PAGES)), XMLELEMENT ("FileSize", TO_CHAR (B.FILE_SIZE)), XMLELEMENT ("Status", B.STATUS), XMLELEMENT ("ContentFormat", D.CONTENT_FORMAT_CODE), G.ALTKEY )) ) FROM CM_PACKET A, CM_RESOURCE B, CM_REF_CONTENT_TYPE C, CM_REF_CONTENT_FORMAT D, ( SELECT XMLELEMENT ( "AlternateKeys", XMLAGG(XMLELEMENT ( "AlternateKey", XMLATTRIBUTES ( H.ALT_KEY_TYPE_NAME AS "keyType", E.CHILD_BROKER_CODE AS "broker", E.VERSION AS "version" ), E.ALT_KEY_VALUE )) ) ALTKEY, E.RESOURCE_ID RES_ID FROM CM_RESOURCE_ALT_KEY E, CM_RESOURCE F, CM_ALT_KEY_TYPE H WHERE E.RESOURCE_ID = F.RESOURCE_ID(+) AND F.PACKET_ID = HEXTORAW (:B1 ) AN
D E.ALT_KEY_TYPE_ID = H.ALT_KEY_TYPE_ID GROUP BY E.RESOURCE_ID) G WHERE A.PACKET_ID = HEXTORAW (:B1
SELECT XMLELEMENT ("Tagging", XMLAGG (GROUPEDCAT)) FROM ( SELECT XMLELEMENT ( "TaggingCategory", XMLATTRIBUTES (CATEGORY1 AS "categoryType"), XMLAGG (LISTVALUES) ) GROUPEDCAT FROM (SELECT EXTRACTVALUE ( VALUE (T), '/TaggingCategory/@categoryType' ) CATEGORY1, XMLCONCAT(EXTRACT ( VALUE (T), '/TaggingCategory/TaggingValue' )) LISTVALUES FROM TABLE(XMLSEQUENCE(EXTRACT ( :B1 , '/Tagging/TaggingCategory' ))) T) GROUP BY CATEGORY1)
SELECT XMLCONCAT ( :B2 , DI_CONTENT_PKG.GET_ENUM_TAGGING_FN (:B1 ) ) FROM DUAL
SELECT XMLCONCAT (:B2 , :B1 ) FROM DUAL
SELECT * FROM EQ_RAW_TAG_ERROR A WHERE TAG_LIST_ID = :B2 AND EXTRACTVALUE (A.RAW_TAG_XML, '/TaggingValues/TaggingValue/Value' ) = :B1 AND A.STATUS = '
NR'
SELECT RAWTOHEX (S.PACKET_ID) AS PACKET_ID, PS.PACKET_STATUS_DESC, S.LAST_UPDATE AS LAST_UPDATE, S.USER_ID, S.USER_COMMENT, MAX (T.ALT_KEY_VALUE) AS ALTKEY, 'Y' AS IS_PACKET FROM EQ_PACKET S, CM_PACKET_ALT_KEY T, CM_REF_PACKET_STATUS PS WHERE S.STATUS_ID = PS.PACKET_STATUS_ID AND S.PACKET_ID = T.PACKET_ID AND NOT EXISTS (SELECT 1 FROM CM_RESOURCE RES WHERE RES.PACKET_ID = S.PACKET_ID AND EXISTS (SELECT 1 FROM CM_REF_CONTENT_FORMAT CF WHERE CF.CONTENT_FORMAT_ID = RES.CONTENT_FORMAT AND CF.CONTENT_FORMAT_CODE = 'I_FILE')) GROUP BY RAWTOHEX (S.PACKET_ID), PS.PACKET_STATUS_DESC, S.LAST_UPDATE, S.USER_ID, S.USER_COMMENT UNION SELECT RAWTOHEX (A.FATAL_ERROR_ID) AS PACKET_ID, C.PACKET_STATUS_DESC, A.OCCURRENCE_DATE AS LAST_UPDATE, '' AS USER_ID, '' AS USER_COMMENT, RAWTOHEX (A.FATAL_ERROR_ID) AS ALTKEY, 'N' AS IS_PACKET FROM EQ_FATAL_ERROR A, EQ_ERROR_MSG B, CM_REF_PACKET_STATUS C, EQ_SEVERITYD WHERE A.PACKET_ID IS NULL AND A.STATUS = 'NR' AND A.ERROR_MSG_ID = B.ERROR_MSG_ID AND B.SEVERITY_I
SELECT /*+ INDEX(e) INDEX(a) INDEX(c)*/ XMLAGG(XMLELEMENT ( "TaggingCategory", XMLATTRIBUTES ( G.TAG_CATEGORY_CODE AS "categoryType" ), XMLELEMENT ("TaggingValue", XMLATTRIBUTES (C.IS_PRIMARY AS "primary", H.ORIGIN_CODE AS "origin"), XMLAGG(XMLELEMENT ( "Value", XMLATTRIBUTES ( F.TAG_LIST_CODE AS "listType" ), E.TAG_VALUE )) ) )) FROM TABLE (CAST (:B1 AS T_TAG_MAP_HIERARCHY_TAB)) A, TABLE (CAST (:B2 AS T_ENUM_TAG_TAB)) C, REM_TAG_VALUE E, REM_TAG_LIST F, REM_TAG_CATEGORY G, CM_ORIGIN H WHERE E.TAG_VALUE_ID = C.TAG_VALUE_ID AND F.TAG_LIST_ID = E.TAG_LIST_ID AND G.TAGGING_CATEGORY_ID = F.TAGGING_CATEGORY_ID AND H.ORIGIN_ID = C.ORIGIN_ID AND C.ENUM_TAG_ID = A.MAPPED_ENUM_TAG_ID GROUP BY C.IS_PRIMARY, H.ORIGIN_CODE, G.TAG_CATEGORY_CODE START WITH A.MAPPED_ENUM_TAG_ID = HEXTORAW (:B3 ) CONNECT BY PRIOR A.MAPPED_ENUM_TAG_ID = A.ENUM_TAG_ID
SELECT /*+ INDEX(e) */ XMLAGG(XMLELEMENT ( "TaggingCategory", XMLATTRIBUTES ( G.TAG_CATEGORY_CODE AS "categoryType" ), XMLELEMENT ( "TaggingValue", XMLATTRIBUTES (C.IS_PRIMARY AS "primary", H.ORIGIN_CODE AS "origin"), XMLAGG(XMLCONCAT ( XMLELEMENT ( "Value", XMLATTRIBUTES ( F.TAG_LIST_CODE AS "listType" ), E.TAG_VALUE ), CASE WHEN LEVEL = 1 THEN :B4 ELSE NULL END )) ) )) FROM TABLE (CAST (:B1 AS T_TAG_MAP_HIERARCHY_TAB)) A, TABLE (CAST (:B2 AS T_ENUM_TAG_TAB)) C, REM_TAG_VALUE E, REM_TAG_LIST F, REM_TAG_CATEGORY G, CM_ORIGIN H WHERE E.TAG_VALUE_ID = C.TAG_VALUE_ID AND F.TAG_LIST_ID = E.TAG_LIST_ID AND G.TAGGING_CATEGORY_ID = F.TAGGING_CATEGORY_ID AND H.ORIGIN_ID = C.ORIGIN_ID AND C.ENUM_TAG_ID = A.MAPPED_ENUM_TAG_ID GROUP BY G.TAG_CATEGORY_CODE, C.IS_PRIMARY, H.ORIGIN_CODE START WITH A.MAPPED_ENUM_TAG_ID = HEXTORAW (:B3 ) CONNECT BY PRIOR A.MAPPED_ENUM_TAG_ID = A.ENUM_TAG_IDBy observing above sql queries i found some hints forcing for index usage..
I think xml schema is created already...and its progressing as you stated above. Please correct if i am wrong.
I found all these sql from AWR report and all of these are very high resource consuming queries.
And i am really sorry if i am irritating you by asking all stupid questions related to xml.
-Yasser
Edited by: YasserRACDBA on Nov 17, 2009 3:39 PM
Did syntax allignment. -
Continual HD activity, high CPU usage when idle
I got my first notebook, a Compaq V2000, a few weeks ago and have Arch set up pretty well on it but I have a few issues. Even when the machine is sitting idle it sounds like the HD is doing a read (or whatever) about every 5 seconds. This only starts after I log into Gnome and stops if I log out.
I tried a couple of things with hdparm:
If I try 'hdparm -y /dev/hda' the drive goes to standby but immediately spins up again.
'hdparm -B 255 /dev/hda' disables APM and stops the cyclic behavior. This would seem to be good but during the 5 second cycle the drive alternates between quiet and noisy and this leaves it in the noisy state.
I tried to determine what might be causing all this disk activity so I edited lilo.conf to remove "acpi=on apm=off" from the "append=" line and in rc.conf I put a ! in front of all modules and daemons and rebooted. I removed the applets from task bar. No change.
I ran top to see if I could tell what was accessing the HD but I'm not knowledgable enough to make much sense of it. I did notice that on my notebook the top summary shows:
CPU: ~30% user, ~10% system, ~60% idle with 'wait' bouncing between 0 and 5%
On my main computer, also running Arch/Gnome, I get
CPU: ~2% user, ~1% system, ~97% idle with 'wait' solid at 0%
On the notebook, if I run hdparm -B 255 /dev/hda the CPU #'s for user and system remain high but the wait # drops to zero and stays there.
I don't think all this HD activity could be good for my machine, and I know I find it very annoying. If anyone could help me stop all the HD accesses and understand the high CPU usage I would appreciate it.I loaded lsof and frankly it scared me. It listed what looked like a couple hundred files and I didn't know exactly how to use that information.
Then I tried laptop-mode-tools. The man pages didn't sound too promising since it uses, among other things, hdparm, which I already tried with mixed results. I gave it a try anyway and right out of the box, with no configuration, it worked. HD access when idle dropped to essentially none, the drive spins down and the cooling fan runs much less frequently.
So far all I have changed in the config file are the HD idle timeouts. The default of 5 seconds was starting and stopping the HD too often so I changed that to 20 seconds for now.
Whatever laptop-mode did to stop the 5-second HD accesses the effect persists even if I run 'laptop_mode stop' and '/etc/rc.d/laptop-mode stop'. When I get the time I should be able to use 'laptop_mode status' and laptop-mode.conf settings to determine exactly what the magic bullet was.
Thanks, lucke. I never would have tried laptop-mode on my own because I thought it only duplicated functionality that I already had with hdparm and powernowd. -
Dispatch Unit - High Cpu Usage
Hi,
ASA5510 8.2.5(50)
The Dispatch unit process is contantly having high cpu usage for last 10 hours.
Things checked:
1. show proc cpu-usage
2. show perf
It seems fine . Output attached
3. Show interfaces for error
No error, overruns, underrruns on interfaces
4. show traffic
Total cumulative through put on approx 4 Mbps.
drop rate max is 3 pkts /sec randomly and rare occurance on some interfaces
5. Connections and Xlate seem normal.
approx 1100.
Counters were reset 1 hour before the data was collected.
# sh cpu usage
CPU utilization for 5 seconds = 39%; 1 minute: 38%; 5 minutes: 44%
# sh processes cpu-usage sorted
PC Thread 5Sec 1Min 5Min Process
081aadc4 a79aff7c 35.7% 37.5% 42.5% Dispatch Unit
0853f89e a79a0b68 0.4% 0.2% 0.2% ARP Thread
# show perfmon
PERFMON STATS: Current Average
Xlates 0/s 0/s
Connections 21/s 32/s
TCP Conns 17/s 28/s
UDP Conns 1/s 1/s
URL Access 0/s 0/s
URL Server Req 0/s 0/s
TCP Fixup 0/s 0/s
TCP Intercept Established Conns 0/s 0/s
TCP Intercept Attempts 0/s 0/s
sh interface e0/0 | inc overrun
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
fw01/act# sh interface e0/1 | inc overrun
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
# sh conn all
1135 in use, 8777 most used
# sh xlate count
112 in use, 265 most used
# show asp drop frame
No route to host (no-route) 870
Flow is denied by configured rule (acl-drop) 103915
First TCP packet not SYN (tcp-not-syn) 1317
Bad TCP checksum (bad-tcp-cksum) 2
TCP failed 3 way handshake (tcp-3whs-failed) 6695
TCP RST/FIN out of order (tcp-rstfin-ooo) 4025
TCP packet SEQ past window (tcp-seq-past-win) 13
TCP Out-of-Order packet buffer full (tcp-buffer-full) 1949
TCP Out-of-Order packet buffer timeout (tcp-buffer-timeout) 600
TCP RST/SYN in window (tcp-rst-syn-in-win) 5
TCP dup of packet in Out-of-Order queue (tcp-dup-in-queue) 617
TCP packet failed PAWS test (tcp-paws-fail) 1248
IPSEC tunnel is down (ipsec-tun-down) 2
Slowpath security checks failed (sp-security-failed) 1699
DNS Inspect id not matched (inspect-dns-id-not-matched) 4
FP L2 rule drop (l2_acl) 15436
Dropped pending packets in a closed socket (np-socket-closed) 2
Please let us know what reason can be there for high cpu usage by Dispatch unit under current statistics?
What else should be checked to ensure cpu usage comes down?
Regards,
Gurjit Singh
Network Engineer
Spooster IT Services.Hi Gurjar,
r u getting the below mentioned syslog messages?
Flow is denied by configured rule (acl-drop) 103915
106023, 106100, 106004
TCP Out-of-Order packet buffer full (tcp-buffer-full) 1949
TCP Out-of-Order packet buffer full:
This counter is incremented and the packet is dropped when appliance receives an
out-of-order TCP packet on a connection and there is no buffer space to store this packet.
Typically TCP packets are put into order on connections that are inspected by the
appliance or when packets are sent to SSM for inspection. There is a default queue size
and when packets in excess of this default queue size are received they will be dropped.
Recommendations:
On ASA platforms the queue size could be increased using queue-limit configuration
under tcp-map.
Similarly you need to check many reasons for the asp drop logs that you have captured and you need to monitor how much it is increasing and the difference.......
but 40 % CPU utilization is a okay kind of thing and you do not need to worry if that happens only during peak hours ans it is not increasing drastically more and more.
http://www.cisco.com/c/en/us/td/docs/security/asa/asa82/command/reference/cmd_ref/s2.html#wp1435096
Regards
Karthik
Maybe you are looking for
-
Session Time Out For UNLOGGED USER During Search -pls help
Hi, The problem lies in searchresultscontroller.java/searchcontroller.java file under search/web/handler of an application that supports educational note sharing. The problem is that - When I search with query strings in different fields(as you will
-
our family is currently using all the same Apple ID so we don't have to purchase thing twice, but now I want to set up the family share. Do we all have to have our own Apple ID to set up the family share? We do all have separate iCloud's accounts, I'
-
ICal Search doesn't find events in the "distant" future !!!
I posted this in LEOPARD and at the end, no resolution and "Fred II" recommended I post this is this Snow Leopard discussion - he sent me this link -- appreciate any comments! Here's a bit of a disturbing one: I use iCal (Leopard, so iCal 3.0.8 1287)
-
Gnome stuck in fallback mode - not recognizing nvidia drivers
Every time I start a gnome session it is stuck in fallback mode. Checking under System Settings > Details > Graphics I see that the Driver is listed as Unknown and Experience is Fallback. Forced Fallback Mode is OFF. I cannot get it to recognize the
-
Group Currency [LC2] is BLANK in BSEG-DMBE2
Hi All, We have an issue with Group currency / Local Currency 2 which is coming BLANK in FB03 and infact in table BSEG-DMBE2.. The settings are already made for additional local currency thru OB22. Somehow the Group currency / Local currency 2 is zer