Post by blizeH » Tue Jun 24, 2014 7:24 pm

Hi,

My girlfriend has heard on a podcast that using a CDN will massively boost her site's performance, which to be fair, I'm guessing it will.

We don't have an SSL certificate (everything goes through PayPal) so that isn't an issue at the moment, so if we do move to CloudFlare or similar, are there any potential problems that could arise?

Thanks

New member

Posts

Joined
Sat Jan 14, 2012 4:20 am

Post by Dhaupin » Tue Jun 24, 2014 9:27 pm

Everything will work the same -- all a CDN really does is spread your resources across many servers that are closer to people. It uses your main server as a "sync and deploy" point to push resources to these child servers. When a customer comes to your site, CDN looks for the closest node and connects them. So if they are in Kenya, it would find a server near there, whereas if they are in Australia, it would use a different one.

Personally i feel its not really worth it unless you do international business or have an extremely media/graphic-rich site. Cloud/CDN in general is a farse that has been around since literally 1995 -- its just closer servers...thats the only speed per-say.

As far as CDN provider goes, the hundreds of them are all about the same "speed" since they all basically piggyback on eachother. Many of them are simply resellers of the big 4....Networks like Akamai, Edgecast (verizon), or Google though actually own their networks + fiber and resell to small fries. If you go CDN, go to the top tier or find a host who works with the big 4.

If you just need to host your JS and CSS without images and whatnot, there are many free ones like google, jsdelivr and bootstrapcdn, look for libraries hosted there and that will speed it up alot (since they are shared cached with thousands of other sites)

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by blizeH » Mon Jun 30, 2014 4:36 pm

Thank you so much for the reply, it's good to know that most providers are the same, we were considering CloudFlare as their free package looks decent enough (for now, at least) although like you said we could possibly speed up our JS/CSS hosting with those providers you've mentioned anyway.

Yesterday we had a problem with the host whereby an email was sent out to lots of people who visited the site at once, causing the CPU to overload - I'm guessing using a CDN would help with this?

New member

Posts

Joined
Sat Jan 14, 2012 4:20 am

Post by sml » Mon Jun 30, 2014 8:29 pm

Your email system should throttle the sending rate.

How are you sending your emails?

sml
Active Member

Posts

Joined
Sat Apr 02, 2011 6:56 am

Post by blizeH » Mon Jun 30, 2014 9:27 pm

Sorry, the newsletter was sent from another site, but it had a link to my girlfriend's site in it, which drew massive traffic to it and caused the server to die

New member

Posts

Joined
Sat Jan 14, 2012 4:20 am

Post by Dhaupin » Mon Jun 30, 2014 11:20 pm

Ah a CDN is strictly a replicator for cached resources like images and files and has nothing to do with the "logic", "load" or "building pages" end of things (this is known as parsing or server side). So static resources are what CDN deploys, it cant act "as a server" persay, it only knows how to copy and paste stuff that exists to a closer location to the user online.

It could reduce the footprint for requests somewhat due to caching, but as far as the actual server bogging down due to DB requests, building the page for client, and mitigating connections/sessions -- well thats all your server still and you would need to optimize/partition for more server resources if spikes are taking it down. If you are getting slammed and really need something like a CDN for your server side, check out clustering or load balancing. Normally this is not needed unless you are a massive site that is capping out sessions beyond what hardware (or vhardware) can handle.

A modern VPS with 4g ram on a dual core processor can handle many hundreds of OC sessions online at once. Looking atm on one of our stores, theres 310 recent sessions open and its only peaking 30% cpu and 200mb ram @ 4 entry processes. Now if these 310 all decided to interact at the same time, and say 300 more people came online, some would be forced to wait a sec till a process/socket opened, but at least it wouldnt crash out. If it were clustered/balanced, those 600+ people and way beyond wouldnt even have to wait a second since the cluster node would act like "hey theres more sockets over here, cmon in".

The cheapest way that ive found to "load balance" a VPS with multiple accounts to a degree is to use CloudLinux ontop of CentOS. Set CPU and RAM limits so that it leaves enough headroom for mySQL, PHP, and Linux itself to operate (like 30% of the CPU and half the ram). An account/site like OC can run all day at their capped limit and your server will still run fine since it wont allow it to steal all resources. Also make sure you have enough max_clients and entry processes set for your OC -- we recommend 40 if youre seeing ~250 sessions. Entry processes isnt like CPU/RAM - if your OC peaks entry process, it WILL cause a server fault and the user will see a nasty 500 or 508 error. Bots can cap entry process quickly if too many hit for sitemap or googlebase feed at the same time for example. Finally, if you see your DB is hogging huge CPU for OC mySQL queries, it prob needs a index->key on certain table cols. Also you can turn off category counting on fronside to further reduce mySQL load there.

Hope that helps clarify.

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by blizeH » Mon Jun 30, 2014 11:55 pm

Thank you very much for the reply, at the moment we have a lot of scripts for compressing images or minifying JS/CSS which I'm guessing will slow down the server a lot - whereas switching to a CDN will help with that?

At the moment we're paying around $80p/a for hosting as the business is just starting out, I'm not sure we can justify the extra costs right now of going with a VPS or Cloud hosting unfortunately, which is why I wasn't sure if CDN would be a good middle ground?

New member

Posts

Joined
Sat Jan 14, 2012 4:20 am

Post by Dhaupin » Tue Jul 01, 2014 12:04 am

Yeah those compressors for images may be putting some load on there indeed to build out all the new files...but once theyre generated and cached it should be fine. The minifiers prob not so much load though since they are cached as a single file until one of their sources changes (only kb's of data). Since cached images, CSS, and JS is considered "static" CDN would help deploy those single minified libraries faster to servers closer to Africa or wherever.

So CDN its not like effecting your servers generation time to create those minified/compresses resources, its only making them available all over the world once they are generated. A VPS isnt needed at all, there are things you can do to optimize OC, but sometimes hosts are reluctant to allow you to change the good settings. This is where a VPS shines, you can actually run the server not just go along for the ride :)

As far as costs CDN vs VPS go, they are similar $$. Do you sell global? Do you get alot of global traffic? What percent of your traffic is global vs home country? How many folks do you estimate to have online avg in the future? What about spikes, how many do you est it would bring in?

https://creadev.org | support@creadev.org - Opencart Extensions, Integrations, & Development. Made in the USA.


User avatar
Active Member

Posts

Joined
Tue May 13, 2014 3:45 am
Location - PA

Post by damoncloudflare » Tue Jul 01, 2014 1:54 am

sml wrote:Your email system should throttle the sending rate.

How are you sending your emails?
Just a quick note that CloudFlare would not affect either delivery or receiving of mail (we don't proxy mail).

" minifying JS/CSS which I'm guessing will slow down the server a lot - whereas switching to a CDN will help with that?"

CloudFlare does offer minifying features to all customers that will minify JS, CSS & HTML. We would strongly recommend not using an additional minify option if you use ours (a conflict will eventually arise running two at the same time).


Posts

Joined
Tue Feb 14, 2012 6:15 am

Post by blizeH » Tue Jul 01, 2014 4:51 pm

Thank you again for the responses, damon do you think Cloudflare would help with the CPU levels on the server then, if we could disable the minify option?

And Dhaupin, thank you again for the info. I've looked and I think CloudFlare's free package even should help, compared to a VPS that will cost around $1,000 or more - I know at some point we do need to get a VPS but with the traffic and sales at the moment I'm not sure we're there right now. At the moment it's getting around 2,000 sessions per month, and 10,000 page views. 65% of the views are from the US (where the host is based - IX Web Hosting) and 15% are from the UK (where the site is based)

New member

Posts

Joined
Sat Jan 14, 2012 4:20 am
Who is online

Users browsing this forum: No registered users and 143 guests