Subject Re: [firebird-support] Blob write to Embedded on Linux performance
Author Olivier Mascia
Le 6 juin 2014 à 15:11, Mike Ro miker169@... [firebird-support] <> a écrit :

I am seeing 45 seconds for a 13Mb file using C++ / IBPP and 48 seconds using PHP.

Exactly the same code, database structure and hardware on Windows inserts a 13Mb BLOB in just 2.4 seconds!

That just means the caching/flushing policy is different on both OSes.

On Linux, FB had always been supposed to use 'sync' writes by default.
On Windows, the write times were so terrible with 'sync' writes that the default had been changed to 'no sync' writes at some time (but the real-world scenario was 'no sync' anyway because that was the first setting users were changing on their setups).

On Windows a good compromise was later found, which does not use sync-writes on every writes (if ForcedWrites is set off), but forces the OS to flush 'once in a while' with firebird configuration settings to be able to control what 'once in a while' means.

On Linux it was found that under a good number of configuration, the 'sync-writes' was actually wrongly implemented and didn't actually sync writes really (explaining while it had been found to be so much of a disadvantage for Windows at some point in time).

I don't know the current state of implementation of sync-writes in linux versions of Firebird. Nor its relationship with OS filesystem cache. But reading about firebird.conf parameters FileSystemCacheThreshold, FileSystemCacheSize, MaxUnflushedWrites, MaxUnflushedWriteTimes, and synced / not-synced writes (database setting), will be a good starting point.

Olivier Mascia