Subject performance issue with firebird 3.0 embedded on linux
Author chen hsu
Hi there, 

Recently I am doing some performance test on firebird 3.0 embedded used in my project. The test is pretty straightforward, on one same table, use 100 insertions per transaction as base test unit (creating a transaction, using a loop to insert 100 records, and committing the transaction), and each test unit is executed on a separate thread. I was trying to see the scalability of firebird with regards to multiple CPUs (each runs a base test unit). But the result is pretty strange, like this: 

with one cpu, 200 insertion per transaction, 1 transaction in total. each record is 128 bytes. 
* Finish Insert: total=25600 bytes elapsed=00.244 throughput=104918.032787 bytes/sec, 819.672131 ops/sec, 4.098361 tx/sec succeeded=1

with 2 cpus, 200 insertion per transaction, 2 transaction in total. each record is 128 bytes. 
* Finish Insert: total=51200 bytes elapsed=01.807 throughput=28334.255672 bytes/sec, 221.361372 ops/sec, 1.106807 tx/sec succeeded=2

with 3 cpus, 200 insertion per transaction, 3 transaction in total. each record is 128 bytes. 
* Finish Insert: total=76800 bytes elapsed=02.377 throughput=32309.633992 bytes/sec, 252.419016 ops/sec, 1.262095 tx/sec succeeded=3

with 4 cpus, 200 insertion per transaction, 4 transaction in total. each record is 128 bytes. 
* Finish Insert: total=102400 bytes elapsed=05.383 throughput=19022.849712 bytes/sec, 148.616013 ops/sec, 0.743080 tx/sec succeeded=4

with 5 cpus, 200 insertion per transaction, 5 transaction in total. each record is 128 bytes. 
* Finish Insert: total=128000 bytes elapsed=06.428 throughput=19912.881145 bytes/sec, 155.569384 ops/sec, 0.777847 tx/sec succeeded=5

with 6 cpus, 200 insertion per transaction, 6 transaction in total. each record is 128 bytes. 
* Finish Insert: total=153600 bytes elapsed=07.655 throughput=20065.316786 bytes/sec, 156.760287 ops/sec, 0.783801 tx/sec succeeded=6

The machine has a 6-core i7 processor. it looks starting from 2 parallel transactions (on 2 CPUs), the performance dropped dramatically from 4 tx/sec to 1.1 ~ 0.7 tx/sec. I tried Super or SuperClassic service configuration, still the same pattern. I am wondering if I missed something in configuration, or it is the known behavior of firebird? Any advice is welcome! 

Thanks a lot. 

-chen