Subject BLOB insert performance on Linux using ODBC
Author nocsav
Hello,

I'm porting a Firebird application from Windows to Linux and I've
noticed some performance degradation when writing data to BLOBs. I'm
hoping somebody can offer me some advice to help me improve this.

I wrote a small test program to help me isolate the problem. The
program is written in C++, and uses ODBC (open source OdbcJdbc driver).

My program UPDATEs a record containing a BLOB field, then it writes
data into the BLOB using SQLPutData and SQLParamData.

* The total data written is around 2.5MB.
* The application sends 4096 bytes per call to SQLPutData

Here are the results...

* Client and server on same Linux computer (server specs below)
* Total time = 8 seconds
* 6.5 seconds are spent inside the final call to SQLParamData!

I was interested to know if this slowness was caused by the client
(odbc?) or the server.

So, I ran a second test with client on Linux and server on Windows 2000.

* Client on Linux
* fbserver on Windows 2000
* Total time = 1.75 seconds
* SQLParamData only 0.4 seconds!

This result looks much better.

Now I'm thinking the problem is with the server's configuration. I am
using a stock Firebird 1.5.2 RPM downloaded this week from sourceforge.

Server details:

1. Firebird 1.5.2 Superserver (NPTL version)
2. Page size is 4096
3. Blob segment size 4096
4. RedHat Enterprise 3
5. 2 CPUs ~ 2GHz
6. RAM ~ 2GB

I tried restoring the DB from GBAK, increasing page buffers, and
changing page size to 8192. These changes didn't make any difference.

Any thoughts?

Thanks in advance!

David