Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO Read and Writes Bytes/Sec Exploded out of proportion. Degrade System Performance [CORE3023] #3404

Closed
firebird-automations opened this issue May 28, 2010 · 25 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Andrew Dimech (adimech)

Attachments:
FB Schema.sql
Script Executing Stored Procedures.sql

We are considering moving to Engine 2.5 and carried out a test to compare Engine 2.1.1 with Engine 2.5 RC2.

The test consists of a executing 7 Stored Procedures from a .NET application. These procedures consists of just select statements and they return a total of 6700 records. The test called these stored procedures a number of times (with different parameter values) for a period of 4minutes.

From Performance Counter we added the following counters for the (.NET application) process we were monitoring:

The results were shocking. These are the average Bytes/sec values over 4minutes.

Engine 2.1.1

IO Read Bytes/Sec 164,250
IO Write Bytes/Sec 201,172

Engine 2.5 RC2
IO Read Bytes/Sec 3,879,708
IO Write Bytes/Sec 3,939,374

The IO in Engine 2.5 is around 23 times higher. This would result in degrading system performance. Is this a known issue? are you planning to handle it?

Attached is the database schema used. For simplicity I only kept the stored procedures used during the test. The stored procedures are called in this order:

GETMESSAGEUPDATESHDRFA
GETMESSAGEUPDATESADDRFA
GETMESSAGEUPDATESATTACHFA
GETMESSAGEUPDATESOWNERSFA
GETMESSAGEUPDATESTAGSFA
GETDELETEDMESSAGEUPDATESFA
GETTAGUPDATESFA

Thanks,
Andrew

@firebird-automations
Copy link
Collaborator Author

Modified by: Andrew Dimech (adimech)

summary: IO Read and Writes Bytes/Sec Exploded out of proportion. Degrade System Peformance => IO Read and Writes Bytes/Sec Exploded out of proportion. Degrade System Performance

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

It is not clear what bytes did you measured ? Disk IO ? Network IO ?

Seems you are talk about network IO from the app side. If so, could you try to use fbclient instead of native protocol implementation ?

As for performance - you have all results at hands and could compare, for example, number of runs within 4 minutes.

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

The counter counts all I/O activity generated by the process to include file, network and device I/Os.

The Stored Procedures execution time seems more efficient in Engine 2.5 RC2. They run under 2seconds and stay like that through out the test, where as in Engine 2.1.1 the execution time takes long and longer through out the test. It starts from around 2 seconds and steadily increases to around 5 seconds at the end of the 4minute test.

Our concern is that such a high I/O output in Engine 2.5 will impact server performance in general. Hence also effecting other systems on the server.

The I/O involved here is more DISK I/O rather than Network I/O since we are using an embedded version of Firebird. Any reasons why is it so high? and what else can we do?

Thanks

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

So, you comparing FB embedded 2.1 agaist FB embedded 2.5, correct ?
As FB embedded in v2.5 based on CS code it have default page cache size = 75 buffers (it was 2048 in v2.1, based on SS).
I recommend you to raise page cache size and compare numbers again.

Note, it is not recommended to set page cache size to high values for CS, at least in multy-user environment.
So, if you''ll have comparable IO numbers with larger cache size it will be good idea to not use big values in production (typically 75-1024 pages).

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

Yes, we're comparing the embedded versions.

Here are the results based on changes in the default page cache size:

DefaultDbCachePages: 1024

IO Read Bytes/Sec 2,714,516
IO Write Bytes/Sec 4,701,461

DefaultDbCachePages: 2048

IO Read Bytes/Sec 2,870,665
IO Write Bytes/Sec 4,894,382

IO performance is better in Reads by around 1,000,000 / sec compared to having the page cache size to 75. However it is still way off compared to Engine 2.1 with just an average of 164,250 / sec

IO performance went worse with these modifications.

Anything else you can suggest? as we cannot consider upgrading with these numbers.

Thanks for your quick responses.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Compare execution statistics, it is possible that 2.5 choosed different execution plan

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

Execution Plan seems the same.

Have you ever benchmarked the IO read/writes between Engine 2.1 and 2.5? and is there a way to know where is all the IO coming from?

Thanks

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Sure, we did the tests ;)
Could you compare execution statistics ?
Or show us the query which have such big difference in IO at 2.1 and 2.5

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

Added Database Schema

@firebird-automations
Copy link
Collaborator Author

Modified by: Andrew Dimech (adimech)

Attachment: FB Schema.sql [ 11633 ]

description: We are considering moving to Engine 2.5 and carried out a test to compare Engine 2.1.1 with Engine 2.5 RC2.

The test consists of a executing 7 Stored Procedures from a .NET application. These procedures consists of just select statements and they return a total of 6700 records. The test called these stored procedures a number of times (with different parameter values) for a period of 4minutes.

From Performance Counter we added the following counters for the (.NET application) process we were monitoring:

The results were shocking. These are the average Bytes/sec values over 4minutes.

Engine 2.1.1

IO Read Bytes/Sec 164,250
IO Write Bytes/Sec 201,172

Engine 2.5 RC2
IO Read Bytes/Sec 3,879,708
IO Write Bytes/Sec 3,939,374

The IO in Engine 2.5 is around 23 times higher. This would result in degrading system performance. Is this a known issue? are you planning to handle it?

Thanks,
Andrew

=>

We are considering moving to Engine 2.5 and carried out a test to compare Engine 2.1.1 with Engine 2.5 RC2.

The test consists of a executing 7 Stored Procedures from a .NET application. These procedures consists of just select statements and they return a total of 6700 records. The test called these stored procedures a number of times (with different parameter values) for a period of 4minutes.

From Performance Counter we added the following counters for the (.NET application) process we were monitoring:

The results were shocking. These are the average Bytes/sec values over 4minutes.

Engine 2.1.1

IO Read Bytes/Sec 164,250
IO Write Bytes/Sec 201,172

Engine 2.5 RC2
IO Read Bytes/Sec 3,879,708
IO Write Bytes/Sec 3,939,374

The IO in Engine 2.5 is around 23 times higher. This would result in degrading system performance. Is this a known issue? are you planning to handle it?

Attached is the database schema used. For simplicity I only kept the stored procedures used during the test. The stored procedures are called in this order:

GETMESSAGEUPDATESHDRFA
GETMESSAGEUPDATESADDRFA
GETMESSAGEUPDATESATTACHFA
GETMESSAGEUPDATESOWNERSFA
GETMESSAGEUPDATESTAGSFA
GETDELETEDMESSAGEUPDATESFA
GETTAGUPDATESFA

Thanks,
Andrew

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

What queries should i run to see the issue ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

I run all of them in on method in this order:

GETMESSAGEUPDATESHDRFA
GETMESSAGEUPDATESADDRFA
GETMESSAGEUPDATESATTACHFA
GETMESSAGEUPDATESOWNERSFA
GETMESSAGEUPDATESTAGSFA
GETDELETEDMESSAGEUPDATESFA
GETTAGUPDATESFA

Their execution times is very fast. We are concerned with the IO they generate.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

All these procedures could be run without input parameters ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

I ask you for a simple thing - provide reproducible example.
How can i said something looking at set of procedures on empty db ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

Attached is a script which executes the stored procedures mentioned.

How can I send the database with data since its about 50MB?

Thanks once again.

@firebird-automations
Copy link
Collaborator Author

Modified by: Andrew Dimech (adimech)

Attachment: Script Executing Stored Procedures.sql [ 11641 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

> How can I send the database with data since its about 50MB?

Could you pack (zip\rar\7z) it and send it to me directly ? (hvlad at users sf net)
Just cut-off file extension, else SF will not pass it

Or put it for download somewhere. You can send me url privately if you wish.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

The procedure GETTAGUPDATESFA have a few SORT's in its plan.
Firebird performs sorting first in memory (up to TempCacheLimit setting) and then using temporary files.
In SS TempCacheLimit is 64MB by default.
In CS this setting have default value of 8MB.
As v2.5 embedded is based on CS, it used 8MB for sorting.
Your procedure needs near 18MB for two of sortings and thus used temporary files if run by v2.5 embedded engine.

You can
a) raise TempCacheLimit setting in firebird.conf, or
b) create indices to avoid MERGE JOIN in plan, or
c) do nothing as temporary files usually cached by OS and you will not see big performance degradation (in this case)

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

And what is the default TempCacheLimit for Embedded Engine 2.1?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

64MB of couse.

Because, as i already said, on Windows Embedded was based on SuperServer before v2.5 and is based on ClassicServer stating from v2.5

@firebird-automations
Copy link
Collaborator Author

Commented by: Andrew Dimech (adimech)

Thanks for your help and patience. We confirm that when we increased the TempCacheLimit to 64MB, IO Dropped again.

Do you have any suggestions as to which columns should be indexed?

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

This is support question and better use corresponding list for it.

Anyway, consider this index for GETTAGUPDATESFA procedure :

CREATE INDEX ARC_TAGS_MSG_UPDATES_IDX2 ON ARC_TAGS_MSG_UPDATES (MSGID);

It eliminates almost all SORT's in GETTAGUPDATESFA

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Nothing to fix

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant