Jump to content

How to Setup Content Delivery Network (CDN) on VPS


Recommended Posts

Hi,

 

I'm using 1.4.11 and have my own vps (ubuntu 12.04) + Apache 2.2

 

I'm trying to setup the media servers in BO but with no luck. I even followed this tutorial and did not worked http://blog.dh42.com...-media-servers/

 

Does anyone know how to setup step by step?

I created a subdomain like static1.site.com and made the root path to img/ folder. Is this how it should be setup?

My site doesn't load the images if I activate Media Servers

I'm trying to speed up my site.post-360290-0-58671100-1373765215_thumb.jpg

 

Thanks.

Edited by misu3108 (see edit history)
Link to comment
Share on other sites

Actually I have both. Local server (backup) and online. I'm interested to speeding up the loading time. I have a store online and I need to make it load faster. If you know how to setup CDN please let me know. I want to use same VPS for cdn.

 

Thanks,

Dan.

Link to comment
Share on other sites

On looking at your site, it seems there are a few other things that you can do to squeeze a little quicker performance out of your site. You should roll some of your images into sprites, reducing http requests. You are pulling way to many requests, you have like 113, you should only have 40 or so at the most.

Link to comment
Share on other sites

I checked out the tutorial for enabling APC on the website, but I have memcache enabled which works fine. Is APC better than memcache??

 

Regarding the improvement of the speed of the website reducing the HTTP requests you said "You should roll some of your images into sprites, reducing http requests" what does that mean exactly?

 

Ok, so how about the CDN setup? How do I do this?

 

 

Thanks,

Dan.

Link to comment
Share on other sites

Ok, here are a couple articles talking about memcache vs APC

http://stackoverflow.com/questions/1794342/memcache-vs-apc-for-a-single-server-site-data-caching

http://stackoverflow.com/questions/815041/memcached-vs-apc-which-one-should-i-choose

 

APC is more suited for this type of caching and is faster than memcache by a factor of 5 to 8. You can actually set up both to work together, I never have, but I have heard people talking about it.

 

I have a bit of free time this morning so I will deconstruct your site.

 

 

One of your main problems seems to be the processing time on the home page, look at this http://screencast.com/t/Cdh5OrGFhrSh It is taking almost a second before any data is returned when requesting your site. I would install apc to see if your bottle neck is a disk read / write issue. If it does not come down that much, then the issue could be that your vps account does not have much processing time allocated to it.

 

Here are some recommendations I would make just looking at your home page. http://screencast.com/t/pFuNJ3zZ86ab The recommendations will all reduce the cpu usage of your site, where it will start delivering content to the browser faster.

 

Here is some suggestions on the file usage on your site, http://screencast.com/t/pwvKkJrV

 

I think this should be a good starting point for things. Here is some information on CSS sprites, http://www.w3schools.com/css/css_image_sprites.asp

 

 

Oh, about the media servers, you never mentioned what the actual problem you are running into is, but if you do all of the other things I listed you will gain about 10x more performance than using media servers.

Link to comment
Share on other sites

Ok. This is how it looks if I activate CDN subdomain static.nerospetstore.com (on online server APACHE2.2)

 

post-360290-0-17663700-1373846195_thumb.jpg

 

It doesn't load images...

 

Here's my vhost file for static subdomain:

<VirtualHost *:80>
	ServerAdmin [email protected]
	ServerName static.nerospetstore.com
	DocumentRoot /var/www/nerospetstore.com/public_html/img
	#DirectoryIndex index.php
	#<Directory />
	#	   Options FollowSymLinks
	#	   AllowOverride None
	#</Directory>
	<Directory /var/www/nerospetstore.com/public_html/img/>
			Options Indexes FollowSymLinks MultiViews
			AllowOverride all
			Order allow,deny
			allow from all
	</Directory>
	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
			AllowOverride None
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Order allow,deny
			Allow from all
	</Directory>
	ErrorLog ${APACHE_LOG_DIR}/error.log
	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn
	CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
	Options Indexes MultiViews FollowSymLinks
	AllowOverride None
	Order deny,allow
	Deny from all
	Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
..........

Am I missing something here?? That's why it doesn't load images?

 

About APC..

I'm still looking into APC and image sprites ...I have tried APC on local server nginx with backup website and I don't know why on performance page it only shows memcache in dropbox as Caching system...(using 1.4.11 on local server). Maybe I need to add some code in settings.inc.php so it shows up. I tested it and it works. I don't see a big difference in loading speed even though I took out from homefeatured module 8 products plus I removed the one on the right that you said it takes resources. SO here are the results with apc on, no memcache.

 

post-360290-0-21879900-1373847484_thumb.jpg

post-360290-0-73716100-1373847668_thumb.png

 

If you have any suggestions please let me know.

Thanks.

Link to comment
Share on other sites

What does it load in the static.nerospetsore.com, can you make any files load from that directory?

 

 

About your APC questions, YSLOW and Google page speed do not measure server performance at all. They just measure how many resources are being served per page load. And if those resources could be compressed or anything like that. It is totally a client side measurement. I can have a page that takes 1 minute to download, but it scores a 90 in google page speed or yslow.

 

 

APC works outside of prestashop. 1.5 has an apc option, it does not actually do anything. I honestly do not know why it is included, because APC works above prestashop and if it is running on the server prestashop has to run under it.

 

You really should start using tools.pingdom.com or gtmetrix.com, they provide more insight to how long it takes to load a page. See this http://gtmetrix.com/compare/Zw79xZhz/PA20zqtt

 

Notice how the other prestashop site loads quicker even though it has more requests than your site and scores less in yslow than your site.

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...

Thanks for the tips. I added images sprites to the front page and tested with memcache and without and it seems site loads faster without memcache enabled. Still I'd like to know how to make use of this CDN feature. I added that subdomain static.nerospetstore as CDN server and if I try to login to the website the page doesnt load images when SSL is enabled. I don't know why...even though my ssl is set for any subdomain to work *.nerospetstore.com

 

post-360290-0-22978200-1375557096_thumb.png

Link to comment
Share on other sites

  • 1 year later...

:)

 

Thank you for the reply. I've got the CDN all setup at my host and we've added a cname.  I was just trying to tackle this part of the instructions:

 

3. The last action needed to get your content on to the CDN is to go into the source code of your website and replace the URL for images and other cacheable content with your CDN hostname.

<imgurl=“http://www.mydomain.com”> becomes <imgurl=“http://cdn.mydomain.com>

 

I just found under media server where I can add a CDN url.  If I add cdn.flyclothing.com, is that it?  I see something about modifying htaccess though in Prestashop instructions.

 

Thank you.

 

Jonathan

Link to comment
Share on other sites

I just took a look at your gtmetrix report, that is how everything got off topic in the first place with this thread. It doesn't matter if you score an a+, b, or even a c. Your site still took 35 seconds to load. The cdn might take .5 seconds off the load time, but you need to work on other things before I would even consider doing a cdn. 

  • Like 2
Link to comment
Share on other sites

Thank you.  I noticed that also!  I think the icons from the template are not loading correctly.  That usually happens when the site is accessed through http://flyclothing.com rather than http://www.flyclothing.com.  I've also noticed it is taking quite a while to load.  My hosting company is making some tweaks right now!  By the way, if you ever need a great hosting company, PM me!

 

Jonathan

  • Like 1
Link to comment
Share on other sites

The tips I would give you are this

  • Use xpress cache from xtendify
  • Use the kraken image optimizer from PresteamShop ( you have over 1mb of size that could be lost)
  • your template is shrinking the home_default images in code, regnerate them the correct size for even more savings
  • Kill one whole row of products on every tab. Or at least lazy load the tabs with ajax. 
  • Like 2
Link to comment
Share on other sites

Yeah, the load time on the front page is ridiculous.  These kind of things are not more forte so I can only ask advice and assume what is the issue--too many images.  I've done about everything else with maximizing performance, caching, etc.

 

Jonathan

Did you smush the images? in my opinion you should get the pagesize under 1mb, pageloadtime under 5 sec. request are very high. which version of PS?

Link to comment
Share on other sites

  • 7 months later...

I must say the website flyclothing is one of the lowest speed website I have seen in Prestashop.

I think flyclothing should consider the gtmetrix advises to reduce page size. You must reduce these that the loading time be under 3 seconds:

 

Page load time: 8.17s
Total page size: 5.63MB
Total number of requests: 310
 
I have no knowledge about all these but made some searches & changed the .htaccess file.
Edited by mecollectibles (see edit history)
Link to comment
Share on other sites

  • 7 months later...
×
×
  • Create New...