Link to home
Start Free TrialLog in
Avatar of JohnnyBCJ
JohnnyBCJFlag for Canada

asked on

How can I lower my time to first byte?

One of my websites is extremely slow loading up (10 to 20 seconds on first load). I've discovered that my time to first byte is 2 to 3 seconds. I have access to everything on the website but I'm not able to modify much (page wise), as most of the site is a 3rd party script.

What can I do to speed up my website? What are the general troubleshooting steps for someone who had similar problems?
Avatar of madgino
madgino
Flag of Romania image

Is your site precompiled, do you have a bin folder with dll files in the live site content?
try to put the javascript files at the end of your page

also try to compress the images if u r using images

also this site may help you

http://www.webpagetest.org/
Avatar of JohnnyBCJ

ASKER

Madgino; I'll check as soon as I get a chance this morning.

king2002; Surprisingly enough, I already tested out the page using that site and with a different site as well (http://analyze.websiteoptimization.com/wso).

webpagetest.org is how I learned about my Time to First Byte problem.
Madgino; There are no .dll files. There are a number of .asp, .xsl, .js, .gif and .css files
OK, if you have chrome installed, in developer tab (F12) use network, timeline and audit tabs and try to see if there is anything not normal in there (any big image, css, javascript etc)

But most probably the site is slow because the asp code is slow and you'll to try to optimize the code to get any significant improvement.

You have to dig into code, measure the time of different procedures/operations and see how you can improve them. It might be a slow database connection if you have one?
madgino, thanks for the suggestions!

Google chrome confirms the time to first byte is bad.

So far I've done a number of things that http://www.webpagetest.org/ suggested and my speed has improved from about 40 seconds to around 3. My time for first byte is still horrid.
As I told you, this is the time it takes to the server to process the page, it can mean that you have a complex page that does a lot of calculations/operations, that your sever is overloaded or that your page is using other resources that are slowly responding (like a database).

So check the serverl loading, check the database loading and if these are fine all you're left to do is to look to the source code and try to optimize it.
Also compare time to first byte on a simple page (something with text only) vs a normal page, is there a big difference?
I'm going to give that a try right now. The basic page vs dynamic page speed difference.

I ended up getting it back to a somewhat expected time (3-4 seconds) but now it's back up to 30 seconds. Extremely annoying!
Also run the pages from server and check the response time.
The extremely small text based only page displays quickly. The dynamic page displays more slowly. If I disable the antivirus program on the web server, it takes about 10 seconds to load. If I enable the antivirus program on the web server, it goes back to its normal 30 seconds.
Maybe a server shortage? Memory, processor, slow hard-disk?
It's a dual core 3.4 ghz, 2 gigs of ram running windows XP pro. The only thing that is running on it is IIS and the 1 program that needs to be running in the background. It has a 40 gig hard drive and has 21+ gigs free.
This is hard to tell, put some monitoring on the server and hit it with requests, see what the peaks are.
It also depends on the pages, maybe are you doing a lot of reads/writes and you need a faster harddisk or to increase the pagefile.
The page file is 4 gigs.

I just tested out the page and it connected without any problem. It takes about 3 seconds to load the page (which I'm OK with). The antivirus program is still running at this point.
My problem is that this could be a completely different story in another hour's time.
Do you have setup any scheduled scans for the antivirus?
The time between this post and my last post, the page goes from 3 seconds to 30+. I know it's not working from cache as I have access to the web server itself and I'm able to see when I hit the web server.

The scheduled scans are for 1 AM every morning.
ASKER CERTIFIED SOLUTION
Avatar of madgino
madgino
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What performance counters would I be looking at specifically for system monitoring?