Wednesday, March 15, 2006 Hi Steve,
> We've been using 4D Client as our Active4D web server for a couple of > years. While we knew we'd take a speed hit, not having some rotten > code bring down the server was a benefit that far outweighed the loss > in speed. Hear, hear! Having the web server on the client is really the way to go in a corporate environment. For one of my clients, they have the 4D Client web server off in the DMZ, which they feel is much better (than if they had the whole 4D Server sitting there, or had the internet accessing the 4D Server inside the corporate firewall). Anyway, the #1 way to improve speed that I've found (particularly for reports) is to pretty much move everything into arrays and work from there. If you have to do anything "record by record", you're going to have a huge speed hit. As you know, the SELECTION TO ARRAY command is optimized to run off the server and deliver only the results to the client. Once there, your client machine will fly through any array processing, and deliver the results much quicker than if it has to wait for any back-and-forth with records. Don't know if this is what you're already doing, but if not, see if there's a way you can shift to this type of processing. Of course, memory may be an issue; you mentioned a 200,000 record figure in your message, which likely will be difficult to impossible to handle all in one shot. However, if you can break up your processing in smaller chunks (ie, SELECTION RANGE TO ARRAY), then this should work fine. You also mention the stored procedure route; this should speed things up, but as you point out, puts your 4D Server at risk. Another possibility--if the report doesn't need to be "real time", maybe build it overnight on a local 4D Client workstation, then just put a link to it on the web page? That'll be just about as "instant" access as you can get for the user (as long as they don't need live data). Hope this helps... Cheers! Michael Larue ------------------- > From: Steve Alex <[EMAIL PROTECTED]> > Reply-To: Active4D Developer Discussion List <[email protected]> > Date: Tue, 14 Mar 2006 17:22:38 -0500 > To: [EMAIL PROTECTED] > Subject: [Active4d-dev] 4D Client as Web Server > > We've been using 4D Client as our Active4D web server for a couple of > years. While we knew we'd take a speed hit, not having some rotten > code bring down the server was a benefit that far outweighed the loss > in speed. 99% of the time with what we do, the server is as fast as > we need it. However, the 1 percent points out what kind of speed hit > we do get. > > I wrote a report script that goes through a bunch of records and > tells our Project Managers what is screwed up in the projects they're > managing. A "bunch" roughly being 20 Project Managers with about 20 > Projects each, that have an average of about 500 detail records (that > are another level down). The script looks at the latest one (order by > timestamp <) to do some calculations. That's roughly 200,000 records > (probably a high estimate) and the detail records are in groups that > sometimes have to be further reduced. Running it on our development > machine (which has Active4D running on the server) the script took > about 8 seconds to execute from the browser view. I later added a > tick count and it took about 400 ticks. Running it on the 4D Client > as the web server, the same process took about 90 seconds and about > 4700 ticks! Roughly 12 times slower. > > Just a little food for thought. Still would not go back to the server > as the web server, at least not as long as clients are connecting to > it. This audit report is something I'll run on a weekly basis and not > a link that someone is going to wait 90 seconds to get the answer. If > I need that, we'll go the stored procedure route. Should also point > out that our Active4D crashes are almost non-existent, but > occasionally someone tries a little tweak that finds some rotten code. > > > Steve Alex > > > _______________________________________________ > Active4D-dev mailing list > [email protected] > http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev > Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/ > _______________________________________________ Active4D-dev mailing list [email protected] http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
