Solved

Slow image loading on IIS  ASP app (but everything else is fine)

Posted on 2002-03-30
10
310 Views
Last Modified: 2010-08-05
We're running IIS on Win 2k Advanced Server. We also use https.  The ASP application hits all kinds of stuff, SQL, ASP calculations, different vendors, etc.  The performance is great, but the images take much longer to load than the rest of the text.  

These are _small_ little icon-type images -- most times the file size is 1 to 2k. Most are gifs, some are jpgs.

I'll go to the site and the most complicated of queries and page formatting is immediately done, but this little image is still loading for 5 or 6 seconds.

Is this an IIS tuning thing?  Any ideas?
0
Comment
Question by:Notwise
  • 4
  • 3
  • 3
10 Comments
 
LVL 11

Expert Comment

by:ASPGuru
ID: 6907333
right-click on the web-site->Proerties

make sure, that "HTTP Keep-Alives Enabled" is checked on the WebSite-Tab.

This is actually checked by default, but maybe someone unchecked it ...

are the images on the same server / protocoll ?
or are the asp stuff on https and the images on http?

ASPGuru
0
 

Author Comment

by:Notwise
ID: 6907369
ASP Guru,

Thanks for the comment -- I checked the site properties and HTTP keep-alives Enabled is checked.

The images are on the same server, in the same site, just in sub-directory. Within in the asp pages, we tried hard-coding the image path as well as the '../images/image.gif' and it doesn't seem to make a difference.


0
 
LVL 11

Expert Comment

by:ASPGuru
ID: 6907414
does this happen with every browser/client computer?
is bandwidth throttling enabled(Internet Information Services -> Properties)

ASPGuru
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6907957

Well, what you are saying is to be expected.  You note that you are doing ASP logic, database access, and yet the images are loading last.

Here is what is happening starting when your user clicks someone in his browser to call your ASP page:

1) (Browser) User clicks something significant and waits for an HTML page to be returned.

2) (Server) Server receives the request and loads the requested .ASP document.

3) (Server) Server interprets ASP page, executing script, calling database, etc.  During this process it generates the HTML page and begins to pass it back to the web browser.

4) (Browser) Web browser recieves HTML page, and when the HTML requires an IMAGE, the browser makes a seperate call BACK to the web server to recieve the image.

5) (Server) Intercepts request for image and returns it to browser (between other processing requests)

6) (Browser) Browser displays images when they are downloaded.

The Browser makes seperate requests for each item it finds it needs within the HTML document.  It cannot even make the requests for these items until it recieves the HTML describing these dependencies (it will begin requesting dependencies even if the whole document has not been recieved yet).

One way you can speed the performance up, is to move all of your images to a different web server.  This way, image requests can be served efficiently, without having to compete for CPU and bandwidth against the HTTP and ASP overhead.

Inside your HTML, instead of having:

<img src="/images/eeLogoTop.gif">

Your code would be:

<img src="http://images.mysite.com/images/eeLogoTop.gif">

Depending on your traffic, this could have a profound impact on how quickly your pages load.

CodeWizrd
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6907960

Pardon the typo above.  The user doesnt click "someone", but "something".  Im sure you get the drift...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 11

Expert Comment

by:ASPGuru
ID: 6908518
CodeWizrd,

of course the images get fetched after the html is built, but some small images shouldn't take 6 seconds...
least of all, if the page is called a second time and all images are cached....
and in fact the browser starts fetching images before the html is finished...

notwise,
how many images do you use? how many different images?
do you set the size of the images in the img tags?
do you use an older computer as a test client?
how big is the html page which gets produced?
does it use complicated hierarchical table structures/formating?

ASPGuru
0
 

Author Comment

by:Notwise
ID: 6908836
In theory I can understand Codewizrd's points, but in reality the image sizes are tiny, there are no more than 30 total images in the whole site, and they take fundamentally longer than the rest of the page to display.

As regards ASPGuru's questions:
1. 30 images total, no more than 2 or 3 on a given page.
2. No, I don't specify the size
3. The test client is a new machine with modern specs.
4. Most of the ASP pages are 10 to 20k of text and when displayed generally fit in a 800 x 600 window.
5. Some of the structures are indeed complicated, but the image delay occurs even in simple pages.
0
 
LVL 11

Accepted Solution

by:
ASPGuru earned 100 total points
ID: 6908847
what cpu usage does the task manager show on the server?

ASPGuru
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6908971

Again, it may be a an issue with resource contention if your server has a decent amount of traffic on it.
0
 

Author Comment

by:Notwise
ID: 6922786
ASP Guru is very helpful.  Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

23 Experts available now in Live!

Get 1:1 Help Now