Subject Re: [IBO] Data Pump Problem
Author Daniel Rail
Hi,

At September 11, 2003, 15:12, Marco Lauria wrote:

> At 15:03 11/09/2003 -0300, you wrote:
>>Hi,
>>
>>At September 11, 2003, 14:10, Marco Lauria wrote:
>>
>>What about setting the CPU affinity in your application? The API call
>>SetProcessAffinityMask is available in Delphi and BCB, and is only
>>available for WinNT/2000/XP/2003. It might be possible that your
>>application is creating a few threads that is causing this performance
>>degradation. Have you checked the stats in Task Manager regarding
>>your application, when HT is enabled?
>>
>>It wouldn't hurt to try.

> I tried it FBServer is running with affinity 1 so it is on the first
> logical CPU.
> I called setprocessaffinity in my application to set the affinity to the
> second logical CPU.
> In the task manager I can see now that fb has affinity to CPU 0
> and my app to CPU 1
> during the transfer the CPU is at 0-5% and it's really really slow (as slow
> as without setting cpuaffiinity
> in my app).
> I am still confused...

Someone(back in January 2003) on the Firebird-devel list reported that
Windows wasn't performing very well with HT CPUs. And, that is
including Windows XP.

Here's the message from Phil Shrimpton that started the thread:

[start quote...]
"Should the CPU_AFFINITY in ibconfig work for 'Hyperthreading' CPU's
(e.g XEON's)?

I recently installed FB1 on a customers new machine that had a single
2.2Ghx XEON processor, running Windows2000 advanced server, and
performance was awful, and was consistant with what happens when
running SS on multi processor machines. Changing the CPU_AFFINITY did
not make any difference. The 'work around' was to zap Windows, install
Linux and Classic FB, and performance increased dramatically.
Unfortuatly the customer is not happy about running Linux, and wants
his Windows back, any ideas apart from waiting for an offical
'classic' Window release? "
[...end quote]

And, here's another discussion further in the thread:

[start quote...]

Phil:
> The new P4 1.8Ghz Xeons are hyperthreaded

Claudio V.:
>> - An operating system that understands it. In the Win32 world, only XP can
>> take advantage of hyperthreading. I don't know if an hyperthreading-enabled
>> app running on older MS operating systems will see any improvement in
>> performance.

Phil:
> I think the big question is pre-XP should an app see a reduction in
> performance in a hyper-threaded system?

Nickolay:
Yes, you will see. I wanted to stay away of this conversation.
Ok, to gain overall performance HT-enabled OS need to do a bit
different multitasking handling (issue YIELD instruction during spin
wait, agressively execute HALT on idle virual processors and
schedule tasks regarding virtual/physical processors).

There is no released server OS from Microsoft that does that. You
need to disable hyperthreading if you use OS from M$. Otherwise you
will probably face performance degradation as compared to HT disabled.
Hyperthreading, if supported, works simular to SMP and Firebird
SuperServer should not be used on it.

Linux support hyperthreading in kernel since 2.4.18 and recent GLIBC
also have some optimizations for it.

The only correct way to get maximum performance from modern processors
with Firebird is to use Linux CS. BTW, this applies to Oracle too.

Phil:
> I have a Xeon system here, and FB1 SS works fine under linux, I shall try to
> dual boot it with W2K over the weekend to see if I can replicate what I saw.

[...end quote]

So, maybe if you require the hyperthreading to be enabled, use FB 1.5
CS. Or, use Linux on the server. Hopefully this problem will be
rectified with FB 2.0.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)