Page 1 of 1

Server pegging CPU every day, requiring restart

PostPosted: Wed Feb 29, 2012 11:29 pm
by ryanparrish
We are having an issue where about once every day or day & a half, the servoy server process will peg the server CPU until we relent and restart the server, sometimes after 15min of trying to find the issue. During this time smart clients will be unresponsive, the servoy-admin page will slow to a crawl and the web clients will start to timeout. I've attached the dump from the admin page, if someone can make some sense of what the issue may be I would (and our customers) appreciate it. I also attached a dump from right after the restart so you can see its 'clean' state.

Re: Server pegging CPU every day, requiring restart

PostPosted: Thu Mar 01, 2012 5:29 am
by chico
We were having a similar problem and learned that it was a databaseManager.recalculate(foundsetofsomesort) which was the culprit.

When we removed it, the problem went away. We'd really notice the slowdown as the number of clients connected picked up.

This might be obvious, but it wasn't to us at the time.

FYI, I have not looked at your stack dumps as I'd have no idea what they would mean. :P

Re: Server pegging CPU every day, requiring restart

PostPosted: Thu Mar 01, 2012 3:30 pm
by Jan Aleman
chico wrote:We were having a similar problem and learned that it was a databaseManager.recalculate(foundsetofsomesort) which was the culprit.

Or perhaps not reading the docs is the culprit? ;-)

http://wiki.servoy.com/display/public/D ... ecalculate

from the docs/sample code: " please use with care, this can be expensive!"

Re: Server pegging CPU every day, requiring restart

PostPosted: Thu Mar 01, 2012 4:02 pm
by chico
Jan, I would agree that we were the culprit, which is the case most of the time :) But see our SSL post, we're stumped there:

viewtopic.php?f=5&t=17828

Re: Server pegging CPU every day, requiring restart

PostPosted: Thu Mar 01, 2012 5:51 pm
by ryanparrish
We most certainly use a sprinkling of .recalculate() throughout our solutions, and try to be conservative with its usage. I did foolishly forget to mention that we where previously on servoy 5.2.8 in production and these issues arose when we moved production to 5.2.12 (development had been on 5.2.11/12 for a while). Of course their had also been code changes in the development cycle when we went to 5.2.12, so, that doesn't really nail down anything.

Re: Server pegging CPU every day, requiring restart

PostPosted: Wed Mar 07, 2012 9:50 am
by dpearce
I have had these issues with one solution, which have stayed since Servoy 3.5.

I am sure it is my fault, but tracking down the issue is very hard. I don't use .recalculate, but find that the server CPU usage from servoy goes up and up and up until reboot of the server, which we have been doing every night in order to bring it back down.

However restarting Servoy sorts it out, so we now use CURL to do this curl -o result.html http://xxxxxx:xxxxxxxxxxx@localhost:808 ... dmin/?rf=1

rather than restarting the server.

The main culprits maybe undeclared global variables or memory leakage from a plugin, but I find the a daily restart of servoy keeps it under control.

I have no idea how to try and find the exact culprit though!

David