cancel
Showing results for 
Search instead for 
Did you mean: 

100% CPU usage

Former Member
10,183

What my BOFHs observe daily:

  • All 16 CPU cores maxed out at 100%
  • It is possible to connect to the server instance using Sybase Central, but it takes forever and they have given up further diagnostics (easier to just turn the process 'off and on again')
  • Deadlock logging enabled, does not show anything according to one of my colleagues
  • SQL Anywhere 10 could "phreak out" as well I'm told, but would not max out all CPU cores (at most just one)

Given the extremeness of the situation (100% CPU usage), I am hoping that someone may fill me in on what we could be doing that could possibly cause this situation. We have not been able to reproduce this yet nor have we discovered any infinite loops in our code. Any pointers are welcome.

I am basically a n00b when it comes to SQL Anywhere, so I have to read up on application profiling I guess.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I had to defer the troubleshooting to my colleague, as I was otherwise engaged.

Eventually he found a query that would run all CPUs flat out and never finish. He waited for 15 minutes before killing it.

Then he looked at the query plan. In his words "it was messy".

The solution was to add an index to one of the temporary tables used. That whacked the query execution plan back into shape and we are back in business. The query now takes 20 seconds to run.

Not sure this deserves to be marked as 'an answer', but my colleague's workaround will hopefully see us through.

VolkerBarth
Contributor
0 Kudos

IMHO, what "deserves to be marked as an (accepted) answer" should be answered by the one with the question - in short by you:)

Former Member
0 Kudos

IMHO that's not a workaround - that's fixing the problem. This is exactly what indexes are for!

Former Member
0 Kudos

Yeah, indexes are nice and all, but the code in question ran just fine with SQL Anywhere 10. We think we tripped over a bug introduced with later versions of SQL Anywhere. Even if a lack of an index (for a temporary table mind you) triggers a table scan, one would assume the query would finish eventually. To go flat out on all 24 CPU cores for a long time (on one occasion they waited for more than an hour before killing it) does not seem right to me.

VolkerBarth
Contributor
0 Kudos

So then you might consider a bug report?

Former Member
0 Kudos

We will look into a reliable way of reproducing this eventually, yes.

Answers (0)