homepage Welcome to WebmasterWorld Guest from 54.166.10.100
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Images taking longer to load on new server
Apache 2.0
AprilS




msg:1515562
 8:41 pm on Jul 22, 2004 (gmt 0)

I have a new dedicated server that has 3 times the specs as our current VPS servers - however, the new dedicated (running Apache 2.0) is serving images much slower than the same site on our VPS (shared) servers (running Apache 1.3.22). I'm just curious if it could be due to a setting in apache that I'm missing. - Both servers are with the same hosting company in the same NOC.

On a positive note, PHP and MySQL are running noticeably faster on the dedicated server! It just seems odd that the images are loading much slower on the dedicated server (RedHat ES w/Apache 2.0).

Just in case, I opened another thread in WebmasterGeneral to see if it may be related to the IP address I was provided.

Let me know if there is any information I could provide to better assist me.

Thanks!

 

jdMorgan




msg:1515563
 9:01 pm on Jul 22, 2004 (gmt 0)

Are you configuring correct cache-control headers on the new server? If you can still do an A-B test, then start each test by flushing your browser cache before loading images; images already in cache don't have to be requested from the server, and so will appear to load much faster.

Use the server headers check in the WebmasterWorld control panel and check the cache-control headers on image requests.

Jim

AprilS




msg:1515564
 10:19 pm on Jul 22, 2004 (gmt 0)

I'm currently doing cache control within our php.ini file (same on both servers).

I've tried clearing the cache and testing both sites - and then simply doing a refresh once the images are in the cahce and both times the old shared server supplies the images faster.

I even tried a tool on NetMechanic.com where it times load times - and each test shows it was able to load pages faster on the old server.

Below are the headers from both servers:

OLD VPS

HTTP/1.1 200 OK
Date: Thu, 22 Jul 2004 22:11:54 GMT
Server: Apache/1.3.22 (Unix) PHP/4.3.1 mod_perl/1.26 FrontPage/5.0.2.2623 AuthMySQL/2.20 mod_ssl/2.8.5 OpenSSL/0.9.6a
X-Powered-By: PHP/4.3.1
Set-Cookie: PHPSESSID=38978d6bf343ad44b790ad06b6668b15; path=/
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Thu, 1 Jul 2004 04:21:35 GMT
Set-Cookie: Referal_URL=deleted; expires=Wed, 23-Jul-03 22:11:53 GMT; path=/; domain=.domain-name.com
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Content-Type: text/html

DEDICATED

HTTP/1.1 200 OK
Date: Thu, 22 Jul 2004 22:16:01 GMT
Server: Apache/2.0.46 (Red Hat)
Accept-Ranges: bytes
X-Powered-By: PHP/4.3.2
Set-Cookie: PHPSESSID=f5b9ba46402b8c8963b0819ef0cfe1db; path=/
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Tue, 20 Jul 2004 22:34:56 GMT
Set-Cookie: Referal_URL=deleted; expires=Wed, 23-Jul-2003 22:16:00 GMT; path=/; domain=.domain-name.com
Content-Encoding: gzip
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8

jdMorgan




msg:1515565
 10:26 pm on Jul 22, 2004 (gmt 0)

> check the cache-control headers on image requests.

Both of those header checks look like they were for page content, not images, because of the text/html MIME-types...

You have different operating systems, and different php versions there as well as Apache 1.3 vs. 2.0

Jim

AprilS




msg:1515566
 10:41 pm on Jul 22, 2004 (gmt 0)

Sorry I misread your post. Here are the headers for an image:

OLD VPS SERVER

HTTP/1.1 200 OK
Date: Thu, 22 Jul 2004 22:38:33 GMT
Server: Apache/1.3.22 (Unix) PHP/4.3.1 mod_perl/1.26 FrontPage/5.0.2.2623 AuthMySQL/2.20 mod_ssl/2.8.5 OpenSSL/0.9.6a
Last-Modified: Tue, 04 May 2004 21:26:48 GMT
ETag: "111df4-236d-40980a98"
Accept-Ranges: bytes
Content-Length: 9069
Keep-Alive: timeout=120, max=100
Connection: Keep-Alive
Content-Type: image/jpeg

NEW DEDICATED

HTTP/1.1 200 OK
Date: Thu, 22 Jul 2004 22:37:55 GMT
Server: Apache/2.0.46 (Red Hat)
Last-Modified: Tue, 04 May 2004 21:26:48 GMT
ETag: "60689e-236d-f7a5d600"
Accept-Ranges: bytes
Content-Length: 9069
Connection: close
Content-Type: image/jpeg

andrew_m




msg:1515567
 10:43 pm on Jul 22, 2004 (gmt 0)

keep-alive vs "close every time" is probably at fault here.

AprilS




msg:1515568
 10:52 pm on Jul 22, 2004 (gmt 0)

Thanks - it looks like the keep-alive was the issue! I turned it on in httpd.conf and now the dedicated server is a fraction of a second faster.

Thank You!

gergoe




msg:1515569
 1:30 pm on Jul 23, 2004 (gmt 0)

fyi

w/o the keepalive enabled the browser needs to open a new socket connection to the server each time it wants to request a file, making each request slower. With keepalive enabled the browser re-uses the first connection for a certain time (you can control this in your server), so if you have 30 images on a html page, the browser can use the same connection for each of the images, which is considerably faster than 30 individual requests.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved