Hi
Over the years I have built up quite a lot of experience in using
stress testers to discover bottlenecks in based dynamic sites. I'd
like to contribute my observations and ask if other developers have
anything to say on this subject.
CPU CORES
What I have noticed in particular is that the bottlenecks are
different at low and high loadings:
- At low loading, the bottleneck is bandwith or DB query response
time (i.e. the ability of the web server / network infrastructure to
transfer content from the disk to the browser)
- At high loading (for a dynamic page with significant quantity of
scripts), the bottleneck appears to be the CPU
i.e. at high loading most of the system is waiting for the CPU to
process scripts in the dynamic pages. Since 4D uses only 1 core for
this, the core is heavily time-sliced across lots of processes and
slows the response time down linearly, even though there is plenty
capacity left in the web server / network / database engine.
Further, of that premium CPU time, most of it is going into
interpreting the script commands (as opposed to doing executing the
commanded function) unless they are calling back into 4D compiled
methods.
(You can verify this by setting a loop running in a regular 4D method,
1-100. For 1 process, the loop time between compiled and interpreted
will be almost indestiguishable - at least to a human. However, set
300 processes going and the difference will be huge. This is what
happens in a web server with dynamic content under a heavy load with
non-limiting bandwith and DBMS capacity).
The best indicator of this CPU max-out phenomenon appears to be a
rising socket error rate on test data.
Of course, this phenomenon is'nt just Active4D, it applies to any
dynamic site of any technology which executes embedded code.
I've just converted quite a big site to a Fusebox implementation and
it's taken a performance hit of about 40% which I can only attribute
to it's executing more code. I don't know how many lines the fusebox
core adds per request but I did'nt imagine it would be excessive.
There are other factors which I'll be quantifying presently. In the
meantime I'd be interested to hear any views, even if (especially
if !) they contradict my own observations.
Regards
Peter
_______________________________________________
Active4D-dev mailing list
[email protected]
http://list.aparajitaworld.com/listinfo/active4d-dev
Archives: http://vasudev.aparajitaworld.com/archive/active4d-dev/