Speed of PHP (through a CDN)
Moderator: General Moderators
Speed of PHP (through a CDN)
I work for a CDN. I've been trying to get my boss to let me implement a CMS into the corporate website because things are constantly being updated and I'm the only one that can do it. His drawback of this is that using PHP might significantly slow the process of displaying the content of the site. Since we're a CDN our content should be faster than a normal site. I'd like to know what thoughts people have as far as speed when people are using PHP to generate dynamic content.
Here's how the CDN works (in case you're not familiar with the term): With the way we're using it for our site, we have all of our files in a server that we own that is our origin. Instantly, all of our larger file types are cached throughout our various servers all over the world (everything but HTML and PHP files - maybe some others.) So when someone grabs a page - say with a video on it and some images (all of which are cached the CDN) - in London it loads at the same speed as where my origin server is located here in the States - really fast.
The potential problem is if that video is called by a PHP script it may load "pretty fast" instead of "really fast" everywhere and we'll say that, in this case, its a significant difference because of the time it takes for the php to call that video from the network. Does anyone think that this may be the case? Please let me know what you think. Hopefully, I can talk my boss into it so that I won't have to keep resorting to using static HTML pages.
Here's how the CDN works (in case you're not familiar with the term): With the way we're using it for our site, we have all of our files in a server that we own that is our origin. Instantly, all of our larger file types are cached throughout our various servers all over the world (everything but HTML and PHP files - maybe some others.) So when someone grabs a page - say with a video on it and some images (all of which are cached the CDN) - in London it loads at the same speed as where my origin server is located here in the States - really fast.
The potential problem is if that video is called by a PHP script it may load "pretty fast" instead of "really fast" everywhere and we'll say that, in this case, its a significant difference because of the time it takes for the php to call that video from the network. Does anyone think that this may be the case? Please let me know what you think. Hopefully, I can talk my boss into it so that I won't have to keep resorting to using static HTML pages.
It's not necessarily geographical but whichever rout is the fastest with our CDN. However, yes, that plays a part. Say that I have a large library of music that I's like to get to my target audience which is a lot. If I use a regular hosting company based in Canada (eigh
) A single person in Tokyo may be able to see it but it would take longer than a single person in Canada. If my audience is large then that dude in Tokyo would have an even longer lag time because of everyone listening to my sweet jams at the same time. At this time I may be so popular that even my Canadian friends may know what that dude in Tokyo is talking "aboot."
If I used a CDN at this time this amazing music library would be cached on thousands of servers. So when Jo Tokyo jumps online the same time as Sally Canadian and all of her thousands of friends he's jammin' out just as if he's the only one on the server and it's right down the street (because this probably is the case.)
So now you know about a CDN (which may be based in Canada, but isn't the same.) As much as I just realized that I like talking about it, the only think it has to do with my question is my reason for using static HTML as opposed to a PHP CMS (I want it to appear significantly faster than the sites someone's use to.) Given that, would you say that a dynamic PHP site runs significantly slower than if I had my whole site in static HTML pages?
If I used a CDN at this time this amazing music library would be cached on thousands of servers. So when Jo Tokyo jumps online the same time as Sally Canadian and all of her thousands of friends he's jammin' out just as if he's the only one on the server and it's right down the street (because this probably is the case.)
So now you know about a CDN (which may be based in Canada, but isn't the same.) As much as I just realized that I like talking about it, the only think it has to do with my question is my reason for using static HTML as opposed to a PHP CMS (I want it to appear significantly faster than the sites someone's use to.) Given that, would you say that a dynamic PHP site runs significantly slower than if I had my whole site in static HTML pages?
Last edited by tad on Sat Mar 24, 2007 4:50 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I fail to see how it is possible to cache large amounts of binaries over thousands of servers.. so I doubt I'll be of much help. But what is the deal with these static html pages -- are you caching the html or the binaries?
Just so you know, you can implement php caching systems easily. Also, the http protocol is not the best method for file transfer, have you considered other protocols?
One more thing.. it's eh not eigh
Just so you know, you can implement php caching systems easily. Also, the http protocol is not the best method for file transfer, have you considered other protocols?
One more thing.. it's eh not eigh
Actually, the HTML and PHP files don't get cached. Files such as images and videos and music are (and for some reason CSS.) A CDN is a service for larger companies that want to make their files seen faster and better (like when you go to ABC.com to watch the latest episode of "Lost.") We do also stream and and use other various delivery methods including HTTP. But that's beside the point.
I'm really just looking for a theory behind the how fast PHP renders HTML as opposed to a static HTML page. Caching is something that I can already do well. But thanks for being so responsive.
I'm really just looking for a theory behind the how fast PHP renders HTML as opposed to a static HTML page. Caching is something that I can already do well. But thanks for being so responsive.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
http://acronyms.thefreedictionary.com/CDNnickvd wrote:One thing is still puzzling me. What the heck does CDN stand for?
Consolidated Data Network I believe
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Actually, I meant CDN as in "Content Delivery Network" http://en.wikipedia.org/wiki/Content_Delivery_Network
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
I never win 
For all the other confused people:
http://en.wikipedia.org/wiki/Tim_Horton ... Rim_to_Win
Tim Horton's is such a Canadian institution that we actually distribute new coinage through them instead of the bank... much more efficient that way.
For all the other confused people:
http://en.wikipedia.org/wiki/Tim_Horton ... Rim_to_Win
Tim Horton's is such a Canadian institution that we actually distribute new coinage through them instead of the bank... much more efficient that way.