Firebird SuperServer running at 100% CPU?


This problem usually shows up when you have an UPDATE intensive database and the sweep process has to kick in periodically to clean up the old versions of records. This is also known as the garbage collection. When it starts running on the SuperServer, it takes most of the server's resources until it completes (This is due to be fixed in Firebird 3). The default sweep interval setting is 20000, meaning that it would kick in when the difference between the Oldest Interesting Transaction (OIT) and Oldest Active Transaction (OAT) becomes larger than that. Each transaction checks this gap when it starts and starts the sweep if interval is breached. Sweep interval is set on database basis, i.e. you can have a different setting for each database.

Cure to this problem is to disable the automatic sweep (by setting the interval to zero) and running the sweep in the off-line hours. This works if you don't have a 24/7 application. To set the sweep interval, you can use your administration tool (Database properties window in FlameRobin) or gfix:

gfix -sweep -user SYSDBA -password ***** myserver:/path/to/db.fdb

Sweep is automatically done by GBAK while backing up the database, unless you use -g option which disables it. If you run regular nightly backup, there is no need for a special sweep job.


Beside this, there is a known problem when you set the database cache to a very high value (high compared to total RAM available to the machine). When this happens, swap space starts to get used and the whole system slows down. See the related FAQ #333 for more details.


Do you find this FAQ incorrect or incomplete? Please e-mail us what needs to be changed. To ensure quality, each change is checked by our editors (and often tested on live Firebird databases), before it enters the main FAQ database. If you desire so, the changes will be credited to your name. To learn more, visit our add content page.



All contents are copyright © 2007-2024 FirebirdFAQ.org unless otherwise stated in the text.


Links   Firebird   News   FlameRobin   Powered by FB: Home Inventory   Euchre  
Add content   About  

Categories
 Newbies
 SQL
 Installation and setup
 Backup and restore
 Performance
 Security
 Connectivity and API
 HOWTOs
 Errors and error codes
 Miscellaneous