Subject Sort error No free space found in temporary...


The other day we had a major slowdown on a database - one server with a single database. Some of our queries received this error:

Sort error No free space found in temporary directories operating system directive open failed

All queries that received this error used union in some way.

The Firebird log is shows a lot of errors at the same time. 

Cannot dump the monitoring data operating system directive open failed Too many open files


Cannot initialize the shared memory region operating system directive open failed Too many open files

After this the following changes was made to the config

TempBlockSize = 2048576(changed from default value)

TempCacheLimit = 567108864(changed from default value)

(I took the values from the firebird_25_superclassic_64bit.conf from ib-aid)

However today same thing happened once again. Does anyone know the solution to this? 

TempDirectories in config is set to default, so I guess /tmp/firebird i used, this disk has about 12Gb free space at the time of writing. Could all this space have been consumed and causing the errors?

A few weeks back we moved the database from a Windows Server 2008R2 to CentOs  to accommodate an increased load, on the database, before this we hand never seen this kind of error. The windows server used a default firebird config file except for DefaultDbCachePages that was configured to 1024.

Firebird: SuperClassic 2.5.7

Server: Virtual server, 16 cores, 128Gb of Ram, Multi disk SSD SAN.