Solved

VB and ASP optimization tasks

Posted on 2004-03-30
2
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Expert Comment

by:sokolovsky
ID: 10721558
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
ID: 10722663
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

622 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