Subject Re[2]: [Firebird-Architect] Re: Firebird Remote Protocol
Author Sandor Horvath
Hi!

Some time ago I wrote a letter to firebird-devel with the next data:

The server is FB1.5 and isql. Executing a simple query.

Client --> Server (20 bytes) # 29 (op_transaction)
Server --> Client (32 bytes) # 9 (op_response)
Client --> Server (8 bytes) # 62 (op_allocate_statement)
Server --> Client (32 bytes) # 9 (op_response)
Client --> Server (76 bytes) # 68 (op_prepare_statement)
Server --> Client (3504 bytes) # 9 (op_response)
Client --> Server (24 bytes) # 70 (op_info_sql)
Server --> Client (48 bytes) # 9 (op_response)
Client --> Server (20 bytes) # 69 (op_set_cursor)
Server --> Client (32 bytes) # 9 (op_response)
Client --> Server (24 bytes) # 63 (op_execute)
Server --> Client (32 bytes) # 9 (op_response)
Client --> Server (32 bytes) # 65 (op_fetch)
Server --> Client (32 bytes) # 66 (op_fetch_response)
Client --> Server (12 bytes) # 67 (op_free_statement)
Server --> Client (32 bytes) # 9 (op_response)
Client --> Server (8 bytes) # 30 (op_commit)
Server --> Client (32 bytes) # 9 (op_response)

-----------------------------------------------------------------------

Nagy Viktor sent a message with subject "Query speed on the Internet"
around Mar 2003 with the next:



> (I've already posted this question at the ib-support list, with less
> success.)
>
> Hi!
>
> We are using Interbase 6.01 for our application and we want to access
> the data over the internet also. The performance is very good over
> the LAN but low over the internet.
>
> The client's connection speed is 512 kbit/s for download and 128
> kbit/s for upload. This is quite fast, but not enough either...
>
> Even the simplest query takes about 1 sec to get the result. I see on
> my cable modem that there is a quite heavy two-way traffic during the
> query run. I use the isql tool to run a query like "select count(*)
> from table;". The server is a 2.2 GHz P4 connected with higher
> bandwith to the internet than the client. The client and the server
> are in the same city.
>
> Doing this with MS SQL, MySQL or PostgreSQL gives the result immediately
> (0.05 sec).
>
> I installed TCPDUMP and wached running simple queries on MySQL,
> PostgreSQL and Interbase 6.01 (and FireBird).
> See the results after the message.
>
> If I use Interbase on my LAN the query time is under 2 ms because the
> server responses arrive within 0.01 ms - 0.6 ms. But with my cable
> modem the fastest ping times are around 30 ms. This means the minimum
> Interbase query run time is 270 ms. The average is 50 for the tested
> server so here the minimum query time is 450 ms (!).
>
> if firebird.sourceforge.net ran Interbase server over the internet,
> it would take me 2 s to run every simple query (because the average
> server response time is around 217 ms).
>
> When I do remote backup (using service manager) with verbose output 30
> MEGABYTES data was transmitted to the client who made the backup.
> (The database was 1.1M, its backup is 160 k. I used IBConsole.)
> Do we really need the huge amount zeros to be transmitted?
>
> My question is:
> - Can I reach as fast (simple) query run with Firebird over the
> Internet as the MySQL does?
> - If I cannot do this with the current version is protocol change
> planned?
>
> Viktor
>
> TCPDUMP ANALYSIS OF PostgreSQL QUERY RUN:
> -----------------------------------------
>
> query = "select count(*),'RESULT IS HERE' from test"
>
> Start
> client -> PostgreSQL, 45 bytes with the query text
> + 045 ms
> PostgreSQL -> client, 79 bytes with the result and the column headers
>
> The total query time is 45 ms.
>
>
>
> TCPDUMP ANALYSIS OF MySQL QUERY RUN:
> ------------------------------------
>
> query = "select count(*),'RESULT IS HERE' from test"
>
> Start
> client -> MySQL, 49 bytes with the query text
> + 058 ms
> MySQL -> client, 94 bytes with the result and the column headers
>
> The total query time is 58 ms.
>
>
>
> TCPDUMP ANALYSIS OF INTERBASE QUERY RUN:
> ----------------------------------------
>
> query = "select count(*), 'RESULT' from test"
>
> Start
> client -> IB, 12 bytes
> + 065 ms
> IB -> client, 32 bytes
> + 000 ms
> client -> IB, 8 bytes
> + 050 ms
> IB -> client, 32 bytes
> + 000 ms
> client -> IB, 80 bytes with the query text
> + 059 ms
> IB -> client, 64 bytes
> + 000 ms
> client -> IB, 24 bytes
> + 049 ms
> IB -> client, 40 bytes
> + 000 ms
> client -> IB, 32 bytes
> + 083 ms
> IB -> client, 236 bytes, most of it is zero and there is a text
> "COUNT" twice
> + 000 ms
> client -> IB, 32 bytes
> + 110 ms
> IB -> client, 408 bytes, most of it is zero and there is a text
> "COUNT" twice
> + 000 ms
> client -> IB, 24 bytes
> + 048 ms
> IB -> client, 32 bytes
> + 000 ms
> client -> IB, 28 bytes
> + 058 ms
> IB -> client, 32 bytes
> + 000 ms
> client -> IB, 40 bytes
> + 084 ms
> IB -> client, 40 bytes with the text "RESULT"
>
> The total query time is 606 ms.
>