Running FirebirdCS-220.127.116.1110-0.amd64 under Linux Fedora core 9 version 18.104.22.168-78.2.23.fc9.x86_64
When thedatabase is under a high load (i.e. over 100 connections) where each connection is doing queries and updates, then merely executing select count(*) from mon$attachments causes several of the connections to die. Client apps report error reading data from the connection.
Sorted the problem by upping both the kernel semaphore settings and the firebird.conf setting:
kernel.sem="1024 64000 1024 512"
This allows 300 concurrent connections to exist, and for the MON$ queries to succeed.
The Kernel can be configured dynamically. Check the current settings with:
# cat/proc/sys/kernel/sem 250 32000 32 128
To increase the values put something like this in /etc/sysctl.conf:
# SEMMSL SEMMNS SEMOPM SEMMNI kernel.sem =1024 32000 256 1024
To apply the settings reboot or call sysctl -p. Then check the new settings:
# cat/proc/sys/kernel/sem 1024 32000 256 1024