On Nov 25, 2003, at 4:00 PM, Brad Perkins wrote:

Hi.  We've just started experiencing this problem today...

We have a few database-intensive reports being generated by Active4D.
Whenever one of these reports is being generated, it appears that Active4D [on the server] is dominating the server's CPU, so that everyone else's processes are getting crowded out. My coworker says that, when doing database-intensive operations, processes [at least from Client] are throttled. I suggested that, since Active4D is a plugin, it's not as strictly bound by the 4D Scheduler. Are we on the right track, or barking up the wrong tree?

David,

A few ideas.

Do any of these reports use any other plug-ins? For example, are you using 4DIC to send mail or to transfer a file via FTP?

The only plugins we have installed are:

4D Pack
4D_InternetCommands
Active4D
Backup

A few of our lesser-used pages send small emails. The SMTP server that gets used is localhost.

What other applicitions are you running on the server (can I assume at least a mail server)? You didn't mention platform, OS, 4D version, etc.


How much memory on the server. How many desktop 4D Clients? Are you running compiled?

Sorry about that... I misspoke about the mail server; the only server software running on the computer is 4D. We are using Mac OS X 10.2.5, 4D Server 6.8.3, and Active4D 3.0 MC1. We have 1GB of RAM and, while we average about 10 clients, this problem has occurred with only one or two clients connected. We are running interpreted; compiling is not an option.



Have you used 4D's Runtime Explorer to see what's happening with available memory or your database's cache when these reports are running? That could let you know if you need change server memory or cache settings.

We've been unable to track that.

You should try it. At the least it could tell you which process on your server is consuming resources.

We have. We can't tell. The server's UI hangs until the problem goes away, precluding the use of any tools to analyze it.



What happens is: the computer's CPU usage [as witnessed by the Activity Monitor utility] jumps to 100% on the server, and the 4D Server user interface becomes unresponsive [pinwheel of death]. We only regain control over the UI after the CPU usage has gone back down.

Can you describe what the database-intensive reports are doing? When you say "reports are generated", do you mean a web page is returned, a 4D report is printed, or something else?

We create a report, in web page format, using Active4D. We have thus far not been able to directly correlate any particular cause [Active4D-based report, 4D Client usage, &c.] with the problem.



On Nov 25, 2003, at 4:07 PM, Aparajita Fishman wrote:

We have a few database-intensive reports being generated by Active4D. Whenever one of these reports is being generated, it appears that Active4D [on the server] is dominating the server's CPU, so that everyone else's processes are getting crowded out. My coworker says that, when doing database-intensive operations, processes [at least from Client] are throttled. I suggested that, since Active4D is a plugin, it's not as strictly bound by the 4D Scheduler. Are we on the right track, or barking up the wrong tree?

Active4D is an _extremely_ good citizen. It yields unconditionally to the 4D scheduler after every line of code is executed. So the behavior you are seeing is not because of Active4D per se.

Sorry for any insinuations ... because this problem freezes up the server at such a low level, and because it has happened with only one or two clients connected, Active4D became most suspect.



If it jogs anyone's memory, the report we're currently investigating does extensive set operations [union, difference, intersection] on sixteen sets of about 8500 records each.

My profiling of typical Active4D page execution showed that 25% of the execution time was spent within the 4D database engine. In addition, if you take a look at the list of 4D commands I support, you will see that those set commands are implemented via an internal EXECUTE. I had no choice, they are not supported by the plugin API. This adds some overhead to their execution.


To isolate Active4D as a variable, I would suggest putting the report generating code into a 4D method and calling that method from Active4D. Then you will see how much of the CPU is being used by the 4D database engine.

I just tried that ... the results were 'inconclusive.' Having the code in an A4D library [where it usually lives] did not seem to be any different [execution time, behavior, &c.] than having the code in a native 4D method; neither caused the problem.



You also might want to consider running the reports from a Client asynchronously. I know that in the SQL world reports are usually run when there is little other client activity because they hog so much of the database engine.

I believe suspicion is falling away from that particular report; it still runs in a few seconds, but when the database freezes up, it freezes up for a long time [fifteen seconds to a minute or two].



On Nov 25, 2003, at 4:10 PM, Brad Perkins wrote:

Another thing to check. Is your server flushing its buffers during the reports?

Not on purpose. (-:


- D




Reply via email to