Solved

VB and ASP optimization tasks

Posted on 2004-03-30
2
389 Views
Last Modified: 2013-11-13
i am running an standard exe using Wscript.shell. my Vb program accepts 2-5 parameters and connects to a remote database and downloads those tables from SQLserver. the parameters i pass are the table names. it will download the data and zip them and email the user as attachment and uploads these files to a ftp server using Inet object. Is there a way to speed up the process ? and how can i close the VB program if connection to remote database fails or data download is stuck or for some other reason. can anyone give me step by step code to do these optimization tasks and to speed up the entire process.plz help me the project is due today and i have everything ready but its running too slow.

I appreciate ur help in this regard
Thanks
Rama
0
Comment
Question by:ramakrishna1080
2 Comments
 
LVL 4

Expert Comment

by:sokolovsky
Comment Utility
Post your code, at least part that connects to a remote database and downloads those tables from SQLserver
0
 
LVL 17

Accepted Solution

by:
inthedark earned 500 total points
Comment Utility
How many seconds does it take at present? Provide a timing for each part of the process. Emailing is a very slow method of data exchange.  This is because the Zipped data has to be expanded to base64 encoding.  Then a connection to an SMTP server  has to be made, this can take ages (anything upto 1-2 minutes for before the server lets you start sending. The smtp server then contacts the destination MX server and repeats the process.

If you are send via the vbSendMail app. I have reworked the base64 encoding so that it is serveral times faster, but I don't think this is where the slow point is.

In theory the maximum speed could be calculated.

The worker dll has to connect to an SQL server and get the records. For best  speed this yould be using a client locatoed recordset using a readonly+forwardonly options.

Guestimation for a system which does not use email (all depends on size of data):

System A initiates the request for data from System B to be upload onto System C.

If System B was listening on a port using as winsock control.

Process for system B.

Accept the request 0 seconds

RS Open
Say a smallish recordset should only take about a second to open the recordset.

Convert RS to a file
Using the RS.Save with the adPersistADTG should take about 0.5 seconds to save the data.

ZIP the data
Again this should only take about a second.

Convert to base64
Should take about 1 sec per MB.

Send the data back to the client, using winsock. This depends on speed of internet/lan. Much more time is running on internet.

Process on system A continues after all data has been received.

Decode the base64 data takes about 1 second per MB.

FTP to System C

FTP the data to the destination server say about 1 second for this. But longer if uploading via the internet.

So the total time should only be about 6-7 seconds per megabyte if both systems are on a resonable lan.

You could shave some further time by sending the request drectly to System C eg:

System A contracts System C (the destination for the data) and send the parameteres needed.  System C contracts System B and gets the data and then saves the data locally.  This should be looking about 3-4 seconds.


0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now