Board index » delphi » ISAPI and dual processor / XEON

ISAPI and dual processor / XEON


2004-04-11 04:24:48 AM
delphi103
Hi there,
can anyone tell me something about ISAPI.DLL and using a dual processor or XEON (Hyper-
threading) system? Does this work performant? Do I have to include some settings, do I have
to use some special coding technique? I ask this because we are planning to buy a new server
AND because we also have a dual proc system. This dual system has a very bad performance,
but I could not find yet, if this is because of the two proc's. I can see in the perfom, that there
are phases (half of the time) where are (too) many context switches; 200.000/s and more ..
If this is because the dual proc, is there a way to tell the isapi.dll only to use one of them?
thanks a lot for yous support
carsten willems
 
 

Re:ISAPI and dual processor / XEON

I have a number of ISAPIs (making DB and COM calls) running on both dual and
quad xeon processors and they perform very well. You don't have to do
anything special in reference to coding or configuration. You don't provide
enough information about your application and other tools that your
integrating with for me to offer any suggsestions.
"Carsten Willems" <XXXX@XXXXX.COM>writes
Quote
Hi there,

can anyone tell me something about ISAPI.DLL and using a dual processor or
XEON (Hyper-
threading) system? Does this work performant? Do I have to include some
settings, do I have
to use some special coding technique? I ask this because we are planning
to buy a new server
AND because we also have a dual proc system. This dual system has a very
bad performance,
but I could not find yet, if this is because of the two proc's. I can see
in the perfom, that there
are phases (half of the time) where are (too) many context switches;
200.000/s and more ..
If this is because the dual proc, is there a way to tell the isapi.dll
only to use one of them?

thanks a lot for yous support
carsten willems


 

Re:ISAPI and dual processor / XEON

Hi, thanks for your answer. I have a isapi dll, which realizes online shops. Therefore it fetches
data from a mysql server in its LAN and pases HTML Template files. I have this application
(built with D5) running on 6 servers, one of them has two processors and performs very badly.
The only thing I could find out until now, is that the performance monitor shows a very lot of
context switches (see last mail). The CPU usage(s) is/are only at 30-50 percents.
carsten willems
 

Re:ISAPI and dual processor / XEON

The Delphi memory allocator can become a bottleneck with multi-threaded apps
on a multi-cpu machine because it is single-threaded.
Avoiding string concatenation inside loops (like when using nested
templates) could help. An efficient alternative to string concatenation is
writing everything to a memory stream. TMemoryStream is "buffered" (it
allocates in fairly big chunks) and does not use the Delphi memory allocator
but uses the Windows memory allocator instead.
Another possibility would be the use of an alternative memory allocator
(preferably with a seperate heap for each thread) but I have never tried
that.
Danny
---
"Carsten Willems" <XXXX@XXXXX.COM>schreef in bericht
Quote
Hi, thanks for your answer. I have a isapi dll, which realizes online
shops. Therefore it fetches
data from a mysql server in its LAN and pases HTML Template files. I have
this application
(built with D5) running on 6 servers, one of them has two processors and
performs very badly.
The only thing I could find out until now, is that the performance monitor
shows a very lot of
context switches (see last mail). The CPU usage(s) is/are only at 30-50
percents.

carsten willems


 

Re:ISAPI and dual processor / XEON

Unfortunately, my experience with MySQL is very limited but how is your
ISAPI connecting to your MySQL database? I recall reading somewhere that
there were 2 ways of connecting to MySQL dbs and one was very resource
intensive when there were more than one connection to the db.
It doesn't appear that you're doing anything else that would cause ISAPI
performance issues on a Multi-cpu server.
Good luck.
"Carsten Willems" <XXXX@XXXXX.COM>writes
Quote
Hi, thanks for your answer. I have a isapi dll, which realizes online
shops. Therefore it fetches
data from a mysql server in its LAN and pases HTML Template files. I have
this application
(built with D5) running on 6 servers, one of them has two processors and
performs very badly.
The only thing I could find out until now, is that the performance monitor
shows a very lot of
context switches (see last mail). The CPU usage(s) is/are only at 30-50
percents.

carsten willems


 

Re:ISAPI and dual processor / XEON

for some of my apps I saw bad performance on multi-cpu machines.
some of the apps are ISAPIs and some are multi-threaded EXE...
I tried the memory manager from nexus ( the creators of NexusDB ) - they
sell it at a very competetive price ( something in the 75 USD range ) - AND
: yes, it works very fine ! I didn't change even one line of my code. just
added one line in the project file to include their memory manager. it is
optimized for multi-threaded usage and it solved another problem I had :
memory fragmentation occuring after the apps ran a long time...
the delphi memory manager is not suited for multi-threaded apps ( like
ISAPIs ) and causes a real bottleneck.
Yahia
 

Re:ISAPI and dual processor / XEON

I use D5 Enterprise on multi processor machines and have not memory or
performance problems. I go against SQL Sever though on W2K Server . I dont
believe that Carsten mentioned his operating system. Be careful of the use
of that "multi threaded" term I think. If you start a thread in your app,
then yes you have a multi-threaded program an may be running a risk, but IIS
(at least under W2K) will multi thread the ISAPI as multiple copies of
itsself, therefore I dont think adding aline to a Delphi project could
affect what IIS is doing could it? The operating system is running all kinds
of threads all the time and IIS is nothing more than just another DLL for
the OS to handle and since it belongs to M$, I have never experienced a
problem with it. IIS has never messed me up even running as many as 15 or 18
simultaneous copies of the same ISAPI that is over 1Meg big dll file. I
think he has some other problem on his machine, and like Dmiester, I would
be suspicious of that MySQL thing. Like connection overhead due to lack of
connection pooling , the ISAPI opening and closing the connection on every
DML request, etc.
 

Re:ISAPI and dual processor / XEON

Quote
Hi, thanks for your answer. I have a isapi dll, which realizes online
shops. Therefore it fetches
data from a mysql server in its LAN and pases HTML Template files. I have
this application
(built with D5) running on 6 servers, one of them has two processors and
performs very badly.
The only thing I could find out until now, is that the performance monitor
shows a very lot of
context switches (see last mail). The CPU usage(s) is/are only at 30-50
percents.
The default delphi MemoryManager serializes all memory requests so this can
hurt performance on multi cpu systems. The NexusMM removes this problem and
improves on a few other things.
I wrote a little multithreaded test app here's the results:
DelphiMM = 283.7758 seconds
NexusMM = 251.6197 seconds
The only thing that changed was placing nexusMM as the first unit for the
project, for a 32 second improvement.
I'll post the app in the attachments group, but you will have to grab the
nexusMM demo from their site. www.nexusdb.com/
DD
Quote
Hi, thanks for your answer. I have a isapi dll, which realizes online
shops. Therefore it fetches
data from a mysql server in its LAN and pases HTML Template files. I have
this application
(built with D5) running on 6 servers, one of them has two processors and
performs very badly.
The only thing I could find out until now, is that the performance monitor
shows a very lot of
context switches (see last mail). The CPU usage(s) is/are only at 30-50
percents.
The default delphi MemoryManager serializes all memory requests so this can
hurt performance on multi cpu systems. The NexusMM removes this problem and
improves on a few other things.
I wrote a little multithreaded test app here's the results:
DelphiMM = 283.7758 seconds
NexusMM = 251.6197 seconds
The only thing that changed was placing nexusMM as the first unit for the
project, for a 32 second improvement.
I'll post the app in the attachments group, but you will have to grab the
nexusMM demo from their site. www.nexusdb.com/
DD
 

Re:ISAPI and dual processor / XEON

Thanks for you hints; first of all I will try the NexusMM, then I will have a further look
to the MySQL (firsted I used ADO components, but now I use the native zeos lib).
But the main thing I wanted to know (and I do know now :)), was if there are general
problems with isapi & multiproc and if I have to use special prograqmming techniques
and/or settings for that purpose.
carsten
 

Re:ISAPI and dual processor / XEON

Nexus seemed to fix it ... I will have an eye on it
but nevertheless it speeded up my application from .35 processed pages per second
up to .50 pages 8)) thanks a lot
carsten willems