Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Intraweb Project slow


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Nov 1, 2016 1:14 AM Last Post By: Alexandre Machado
Freddy Bueno

Posts: 11
Registered: 10/15/03
Intraweb Project slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 11:12 AM
I cannot find the reason why my Intraweb project run slowlest with 60 concurrent users.

I will try to describe my architecture, and I hope you can help me with tips or corrections. thanks.

It was developed with DXE10U1 and Intraweb 14.0.50,

I have 3 tiers.

a. Interbase smp 2009 (repository)
b. SoapServerApplication, made with delphi as isapi and configured into IIS 7.5 (bussiness logic)
c. Intraweb project, made with delphi as isapi and configured into IIS 7.5 (presentation)

so, I have

(Intraweb project) IWForm -> IWControl -> UserSession -> TClientDataSet -> SoapConnection ->
(soapServerApplication) TDataSetProvider -> TSQLDataSet -> TSQLConnection ->
(Interbase database) MyDB.DGB

the project is very simple, intraweb loads questions to the user, and they answer that questions to save that answers onto database. each user answer 30 questions, and each one of the has 6 posible answers.

my project was deployed on a Windows 2008 R2 server SP1 64 bits, with a very good internet bandwidth (100 MB upload and download), it has enough hard disk space for the database, 1 Gb RAM and 1 processor intel xeon 2.4Ghz , and both, the intraweb isapi, and the soapserver isapi are configured into IIS 7.5. and the database is on the same machine.

everything works fine, until 60 concurrent users accesing the application started to experiment slow performance. (almost 1 minute to load the next question). If I check the server Task Manager, I can see that IBServer.exe process consumes between 95 and 100% the cpu, and the memory usage is about 500 Mb for the process w3wp.exe (IIS process).

I think it's a very basic functionality for the project to said it's bigger or heavy.
when the user stars the application loads the first question and the answers, and after select one of them, the answer is saved to the database, and the process starts again with the next question.

maybe is problem of my architecture,
for intraweb I have SoapConnection and Clientdatasets at the UserSession unit (to diference each user data).
for the soapServerApplication, I have TSQLConnection, TSQLDataSet (DBExpress) and TDatasetProvider on a SoapServerdataModule.

I know soapserverapplication works as stateless, that for each call one instance is created.
and I know that intraweb consumes memory for each session created, so I close each ClientDataset that I use. And I try to load just the necessary information.

How can I made my application faster?? how connection pools works?
where TSQLConnection should reside into soapserverapplication?
where TSoapConnection should reside into intraweb project?

many thanks for you help Delphi friend.

Edited by: Freddy Bueno on Oct 28, 2016 11:14 AM

Daniel Fields

Posts: 622
Registered: 11/29/04
Re: Intraweb Project slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 5:55 PM   in response to: Freddy Bueno in response to: Freddy Bueno
My first guess would be memory! 1 GB on a Windows Server is just enough to be functional. I start at 4GB and move up. I also never have the database on the same machine as the application for performance and security reasons. You are asking that little server to do a lot of work. It seems to be adequate until you reach 60 users.

At that point the database and IIS require more memory that is not available. The system will then start using its Virtual Memory, which means writing to the swap file on disk. This is called "paging" and it allows your computer to act like it has more memory than it does. On a personal computer this is not such a big deal, but on a server it's very bad. It will kill your performance when you need it most, in multitasking.

Every time your application server or the database server needs more memory than is available the system will pause to swap memory to disk. It will have to do the opposite when it resumes or starts another thread. You are forcing your server to fight itself. To make matters worse, the swapping causes disk fragmentation, which causes the system to slowdown even further.

Options:
1. Scale Up by adding more memory. This would be the quickest fix.
2. Scale Out by putting the database on its own server. Even if it's another 1GB server. It would at least let the application have more resources.
3. Scale Up & Out by adding another server, and adding RAM to both servers.

Any of those options will give you an exponential performance boost, and allow you to support more users.
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: Intraweb Project slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 7:47 PM   in response to: Daniel Fields in response to: Daniel Fields
Daniel Fields wrote:
My first guess would be memory! 1 GB on a Windows Server is just enough to be functional. I start at 4GB and move up. I also never have the database on the same machine as the application for performance and security reasons. You are asking that little server to do a lot of work. It seems to be adequate until you reach 60 users.

At that point the database and IIS require more memory that is not available. The system will then start using its Virtual Memory, which means writing to the swap file on disk. This is called "paging" and it allows your computer to act like it has more memory than it does. On a personal computer this is not such a big deal, but on a server it's very bad. It will kill your performance when you need it most, in multitasking.

Every time your application server or the database server needs more memory than is available the system will pause to swap memory to disk. It will have to do the opposite when it resumes or starts another thread. You are forcing your server to fight itself. To make matters worse, the swapping causes disk fragmentation, which causes the system to slowdown even further.

Options:
1. Scale Up by adding more memory. This would be the quickest fix.
2. Scale Out by putting the database on its own server. Even if it's another 1GB server. It would at least let the application have more resources.
3. Scale Up & Out by adding another server, and adding RAM to both servers.

Any of those options will give you an exponential performance boost, and allow you to support more users.

I agree with Daniel's guess. You may want to get some data on what's going on with machine resources. Normal windows tools can give you some clues on whether it's just memory, or more than one thing.

That said, adding memory many times is as easy as more complex troubleshooting.

Dan
steven chesser

Posts: 401
Registered: 4/13/09
Re: Intraweb Project slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 28, 2016 8:32 PM   in response to: Freddy Bueno in response to: Freddy Bueno
Like mentioned 1gb isn't enough for anything doing much work in todays age. Not when the OS and such consume a lot to begin with.

Which 2.4ghz Xeon you running? Only reason I ask is 2.4ghz Xeon's date back to 2002 (32bit) ... and from there 2006 there was 2.4ghz xeon 64 bit.

These today would be considered pretty lousy.

With our IW apps, we run Oracle back end on dedicated servers which get hit from all sides all day long.

For our IW servers (3 of em) they are over kill a bit but work. Each one is dedicated to running just the IW app. Two production and 1 standby machine.
Older machines, but 16gb with dual, Dual Core AMD's ... but I use a standalone IW app to run it all. Even with 100+ people on at a time,
the CPU usage is always pretty low. Usually single digits... and mem usage is low too. Never more than 40-50mb..

Without seeing code and such it would be hard to pin point the area of the problem of the program so easiest thing is throw more hardware at it.

Memory is cheap.. go as much as you can.

With stuff getting more and more thread happy, more grunt and more cores never hurts either. If you got 60 people on... and DB runs on same machine, your DB engine is spawning
threads and doing work and so on. Splitting it up also is nice so if one part of the process goes down, can then switch to a standby system to take over to keep downtime to a minimum.
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Intraweb Project slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 1, 2016 1:13 AM   in response to: Freddy Bueno in response to: Freddy Bueno
Hi Freddy,

I've IW applications with 3000 active, simultaneous sessions. So the number of users is not the key factor here.

However, this

"I can see that IBServer.exe process consumes between 95 and 100% the cpu"

shows me that your database server is using all the available CPU power, not your IW application. I haven't used Firebird/Interbase in a long time. In the old days, IIRC, they used to have issues when the number of connections reached 100. How many open connections do you have?

Also, as noticed by other users here, 1 Gb of RAM is very little memory. Some android applications (yes, in a smart phone!) might need more than this!
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02