Why is the connection to the server so slow?
There are various reasons. Here's a checklist:
1. Are you using hostnames or IP adresses. It might simply be a DNS resolving issue on either server or client.
The client needs to resolve server name to IP address in order to access it.
The server needs to resolve client's IP address into name to put it in firebird.log file.
Things that help include proper setup of local DNS server, changing the connection string from server name to IP address or vice versa, and adding client/server to each other's hosts files. On Linux the host file is typically located in /etc/hosts, while on Windows the location differs (try c:\windows\system32\drivers\etc\hosts).
2. If you have CPU that supports hyperthreading try disabling it to see if that helps. If you can multi-core CPU (dual core, quad core), set the CPUAffinity setting in firebird.conf
3. If you are using Windows XP or 2003 or any other that has system recovery, it is advisable to turn it off for the drive where Firebird database is stored. The main problem is that Windows considers that files with .gdb extension are system files and need to be backed up on each write. Newer versions of Firebird use .fdb for security database, and you should use .fdb as extension for your own databases to prevent these problems. See FAQ #353 for more information.
4. On Windows 2003 and other systems that support volume shadowing, it is helpful to turn it off for partitions where database files reside.
5. If you use Firebird 1.5, make sure you run the latest version (1.5.4) as there were some important bugfixes regarding this issue. Also, Firebird 2.1 has significant speed improvements over slow links (Interenet).
6. If you query tables with BLOBs without actually reading BLOB data (just doing SELECT *) it is a good idea to remove them from the column list, since BLOBs require two trips to the server (one to retrieve BLOB ID and other the retrieve the data). Alternatively, you can cast BLOB to varchar to get some the data faster:
select ..., cast(my_blob_field as varchar(2000))