1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Reduce Server Response Time

Discussion in 'Site & Server Administration' started by JohnScott, Oct 27, 2015.

  1. #1
    Hi,

    Google PageSpeed insights actually has some good insights. Minify CSS, optimize images, leverage browser caching, etc.

    But then Google says I need to reduce server response time. And their guidance here is less than helpful:

    1. Gather and inspect existing performance and data. If none is available, evaluate using an automated web application monitoring solution (there are hosted and open source versions available for most platforms), or add custom instrumentation.
    2. Identify and fix top performance bottlenecks. If you are using a popular web framework, or content management platform, consult the documentation for performance optimization best practices.
    3. Monitor and alert for any future performance regressions!


    Right, very actionable advice there.

    So what exactly should I be inspecting? Where do I find bottlenecks? The dev team is fixing all the other issues, but I don't know what determined server response time (as opposed to page load times).
     
    Solved! View solution.
    JohnScott, Oct 27, 2015 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Server response time could simply be latency between you and the server (or between Google's server that does the speed test). Like if you had a server in China and you were using the site from the United States, server response time will be slow.

    If they are talking about server response time from the time a connection to the server is established to where the server finished generating the page and returned it to the user, that could be framework related. In that case, what framework are you using and what are your server specs and server load? Like WordPress (for example) isn't super fast, but some of the caching plugins for it will make it seem fast to end users because you are no longer needing to generate pages for every page view.
     
    digitalpoint, Oct 28, 2015 IP
    JohnScott likes this.
  3. JohnScott

    JohnScott Notable Member

    Messages:
    862
    Likes Received:
    285
    Best Answers:
    0
    Trophy Points:
    250
    #3
    All the speed tests I do are based in North America, and the server is in Florida.

    I am getting the idea from these speed tests that the server response time is the actual time it takes for the server to respond to the initial request. For example, when they mention DNS lookup times as a factor.

    And, what is a bottleneck? Google mentioned identifying bottlenecks as part of the resolution.

    Hardware
    Hard Drives: 2 x 1TB SAS 0.00
    Processor: 3.5Ghz Intel Xeon Ivy Bridge E3-1270-V2 with 8MB cache and HT 15.00
    Ram: 16GB Ram DDR3 15.00
    –Network
    Bandwidth: 2,000GB Transfer / 1Gbps Port 30.00
    IP Addresses: 3 IPs 0.00
    Hardware load balancing (2 server minimum): none 0.00
    DDOS protection: none 0.00
    –Software
    Operating System: CentOS 6.x 0.00
    OS Version: 64 Bit 0.00
    Control Panel: cPanel 25.00
    –Software
    Operating System: CentOS 6.x
    OS Version: 64 Bit
    Control Panel: cPanel
    Connectivity of Datacenter here.

    I've never noticed a load on the server other than when we send out the monthly inventory mailer to something like 30,000 customers.

    The script is custom, and very poorly written. It is the result of bad coding added to over the years with more bad coding. A lot of unnecessary stuff that slows page load speed to a crawl, but all those issues are being addressed now by the web dev people. The only thing I am looking to resolve is the server response time. Kind of clueless here.
     
    JohnScott, Oct 28, 2015 IP
  4. #4
    Well I'd probably wait until the backend is redone before you worry about it. 0.25s really isn't horrible and the end goal is to make it nice and useable for end users. And that sort of timing really shouldn't affect that goal.

    Because who knows, it might sort itself out and be even faster after the backend framework gets some love.
     
    digitalpoint, Oct 29, 2015 IP
    JohnScott likes this.
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Sadly, between those good bits pagespeed insights is rotting on the vine as they are turning it into a tool to dupe people into shelling out for services that just make things worse (like their pagespeed service) or CDN's before they actually need them. (You'd think they were advertising for CDN's)

    Five or six years ago everything they said made some sense, a lot of it made a good deal of sense. There were only one or two minor things (like putting certain bits of unique CSS in the markup -- only makes sense if the visitor only ever bounces) that I disagreed with them on.

    Now? They're so full of **** it's ridiculous -- as evidenced by them giving a higher quality rating to websites that measure megabytes in size in hundreds of files that takes > 30 seconds to load by their own measurements, than they do a site that loads BY THEIR OWN MEASUREMENTS in 3 seconds because it's 140k in 12 files. WHY? Because the faster site isn't dicking with cache-control headings or using a CDN.

    THAT'S when I started calling bullshit on it.

    REALLY though on things like server response, that varies so wildly based on geography between the client and the server that it's hard to meaningfully say what's going on there. I'd have to see the site in question to measure in meaningfully as to whether or not it's really a concern, or if they're just trying to dupe you into wasting time on something you don't need.

    Something as simple as too many simultaneous requests from too many separate files could also overtax the server into slow response. In that case it's not the server or hosting's fault, it's the websites.

    For example, that Japanese used car site you mention in your siggy? Let's use that as an example:

    You've got 5k of plaintext, maybe 30 content images (a bit high, but not disastrously so for content), so what's it wasting 3.4 megabytes in 153 files on? That file count ALONE is why it takes > a minute to load here.

    Certainly all those separate little country images (not content) increase the filecount unneccessarily -- techniques like the inaccurately named "CSS Sprites" could reduce all those to a single handshake and probably reduce the size of the markup in the process. Same for the maker icons and the ones on the menu.

    WORSE though is the fifteen separate bits of scripttardery coming to a massive 1.5 megabytes. You've got more scripting than you do IMAGES. Same for the style -- a site like that for the ENTIRE website I doubt that given you don't even HAVE media targets, for screen media only it shouldn't break more than 48k in a single stylesheet, so what's it wasting 343k of CSS in 7 separate files for.

    The more separate files, the more requests thrown at the server by visitors. You have too many files in too large a size, they'll get flushed from the cache anyways regardless of what you dick with for cache-control headings the moment the visitor goes to some other site, meaning they are requested or at the very least verified AGAIN. Eventually you end up with so many requests the server can't keep up even though in terms of disk load or even CPU load it's sitting there with it's thumb up it's backside -- as it's waiting on the networking side of things and dealing with the connection limits.

    It's why I'm always ranting on and on about file counts. As a rule of thumb NOT counting content, if you can't bring in your page template under 16 files, you ARE going to see slowdowns in request times.

    Again, just using that site as an example, but if you have a bunch of sites like that -- well, there's your problem; and throwing more hardware at it probably isn't the answer.

    Now that said, looking at the waterfall I'm averaging 300ms per request here, so if that's on the same hosting they're full of *** about server response time. Again, if I could see an actual site specific to the server you are asking about, I could dial in a much better explanation of it.
     
    deathshadow, Nov 3, 2015 IP
    JohnScott likes this.
  6. JohnScott

    JohnScott Notable Member

    Messages:
    862
    Likes Received:
    285
    Best Answers:
    0
    Trophy Points:
    250
    #6
    Thank you for the insightful review. I am wondering, when we get the new design draft coded, perhaps you will be willing to review with a critical eye? I would of course compensate you for your time. Very much appreciate your input so far, very educational.
     
    JohnScott, Nov 3, 2015 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    Pretty sure you are the first person to offer @deathshadow money after one of his rants about what the Internet has turned into. lol

    Can't we just go back a world of dialup and no JavaScript? hah (kidding)
     
    digitalpoint, Nov 3, 2015 IP
  8. JohnScott

    JohnScott Notable Member

    Messages:
    862
    Likes Received:
    285
    Best Answers:
    0
    Trophy Points:
    250
    #8
    The more critical the view, the more I appreciate it. Not that I think DS would be an overly fun fellow to spend time with, but "friends" who don't tell you when your fly is open aren't being all that friendly. With that in mind, I tend to value people who are willing to be aggressively critical. And in general, I think we need more aggressively critical people in society. Peace and love never forced progress upon anybody; confrontation and adversarial engagement forces evolution. No?
     
    JohnScott, Nov 3, 2015 IP
  9. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #9
    I agree... although I don't agree with everything he says, he does usually have some good points. I just meant that usually people get offended because he can be a little abrasive is all. :)

    He does have his head on straight, but when he tells you that you need to keep your page under 1k so that it works good with an EDGE cellular network or something along those lines, I start disagreeing. heh

    I'm all for making things as fast and as lean as possible and cutting all the bloat. But sometimes it's not completely possible, so you just have to figure out what is worth it and what isn't. I know he hates jQuery for example and I disagree there. It's a great tool for minimizing JavaScript code because you don't need to write multiple JavaScript versions for different browsers.

    But I *do* agree with his general notion that libraries like jQuery *do* proliferate bad and lazy coders who don't actually understand what they are doing. As far as things within jQuery he hates (like animations), that's on the developer, not the library. You can animate using pure JavaScript if you *wanted* to.

    Either way... just made me smile that you offered him a job. Most people get offended. lol
     
    digitalpoint, Nov 3, 2015 IP
    PoPSiCLe and JohnScott like this.
  10. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #10
    You'd be surprised. The difference is the people who take it to heart are far less noisy about it.

    Generally the reason most people get their panties in a knot is understandable -- I'm telling them they have rubbish and need to start over from scratch. I DARE to point out that their artsy fartsy stuff is useless to visitor; that's not something you want to hear if you've got weeks, months or even years of work poured into something. Worse, I use terms they SHOULD know if they knew the first damned thing about websites, yet likely have never heard before given how nobody is teaching the fundamentals of accessibility -- something that should be taught before anyone is even allowed near the ability to change the default appearance of any tag.

    ... and NOTHING gets people more upset than things they don't want to hear. It's part of the whole psychological aspect of things like confirmation bias and cognitive dissonance; further played with by ritualistic indoctrination and what Goebbels called "The big lie" -- a lie told so often and so vehemently and by people who you expect to be authorities that it becomes accepted as the truth, no matter what utter and complete fairy tale nonsense it is. Both are easily pushed by certain emotional factors, the two most powerful of which being fear and laziness.

    See how Religion continues to even be a thing in the 21st century. See how anti-vaxxers still delude themselves into thinking it causes autism despite that having been discredited. See how "normative" people view autism as a disease. (A stance the AMA is backing away from). See how people are DUMB enough to blindly believe all the bullshit that spews from the Food Babe's mouth or rant and rave about things they have zero understanding of like GMO's.

    The laugh being all those groups usually react as if not worse than I do if you dare contest them, but Joe forbid you respond in kind. Even more of a laugh is that when you press them for proof to suppor their claims they back down and go with the "Let's just agree to disagree" nonsense as they are -- as I often point out -- woefully ill equipped to support their own position.

    To me, JohnScott's reaction is typical of what I expect from an ACTUAL businessman, and not some still in or fresh out of college twit who still knows **** about **** and hasn't had any real world experience. Probably also means he understands in REAL marketing grabbing someones attention with goofy flashy stuff only lasts a fraction of a second -- good for impulse buys but no way to build a long term relationship with a client-base; particularly in the age where even the hint of it being "advertising" makes the majority of people slap their blinders on.

    Which good for a laugh, Cracked explained beautifully not that long ago.


    Of all the sources for such insight to come from -- though it's a laugh how the "also ran" of comic strip parodies "got" the Internet more than any of their competitors and are now the big dog in the yard... so they get it.

    ... a LOT of people don't get it, or don't want to admit the reality of it out of fear, ignorance or just plain wishful thinking... and when those powers combine, that's when the predators start circling.

    I actually used to couch it in more polite terms, but I have up on that when I realized that some people will get it, and some people will get offended no matter how it's worded, so why the *** should I self censor behavior, mannerisms and wordings entirely the norm for the office of a proper business? I mean hell, if I'm to be damned let's be damned for who I really am.

    Which is why I laugh when people say "you wouldn't talk to someone that way in person"; yes, yes I do. Or "It's not what you're saying, it's how you're saying it" -- bullshit, it's EXACTLY what I'm saying and people just use that as a lame excuse to go "wah, wah, he's saying something I don't want to hear."

    Hence why the current generation of soft, limp, namby-pamby slack-jawed "if you can't say anything nice" wussies leaves me with little but utter and complete disgust. The whole "Status quo for the win" and "sleazy by on as little effort as possible" mentality leaves me utterly flabbergasted since you'd think anyone over the age of 16 would be past that nonsense.

    A bit of an exaggeration to be sure, but there is NO legitimate reason for the majority of sites markup to exceed 3k + plaintext * 1.5 + 256 bytes per content media type element apart from utter and complete developer ineptitude. There is NO legitimate reason for an entire forum software to need more than 48k of CSS for screen targets apart from utter and complete developer ineptitude... and the majority of what people crap all over websites with using scripttardery are the poster children for -- you guessed it, utter and complete developer ineptitude!

    Depends on if you care about accessibility or not; there really is little excuse apart from ignorance or blindly following bad advice -- or hoping that the ratty off the shelf system chosen is well written when most... I can't even fathom why people would choose them in the first place.

    In a lot of ways it reminds me of the credit mentality -- pay more later for something you can't afford now; such a sound business plan. But why should citizens and businesses act any different from their governments?

    If what you are doing is SO complex you need to worry about different browsers, given how simple capabilities detection is, you are PROBABLY doing something wrong -- more so now that everyone is kicking legacy browsers to the curb in terms of supporting fancy scripttardery or even the pretty new CSS stuff.

    As I often say of jQuery, 99.99% (to pull a percentage out of my arse) of what people do with it falls into three categories:

    1) Things that would have been simpler, cleaner and less code WITHOUT jQuery even without counting the size of the framework itself against it.

    2) Things that are CSS' job.

    3) Things that have no damned business on a website in the first place.

    To that I'd append that 90% of what people do with JavaScript in general falls into those latter two's purview.

    ... or you could realize that most animations are goofy bandwidth wasting crap that makes things harder to use, slower to use, and more painful to users once they're past the "ooh neat" factor of their first visit to the page -- and can actually PREVENT return visits.

    ... or that if you go "Oh well, IE8/earlier doesn't get animations" the majority of the heavy lifting can be done from CSS, so at MOST all you need in your scripting is a simple class swap trigger. Part of why so many "slideshows" codebases are an utter and complete laugh; wasting anywhere from 16 to 32k of their own code and the massive library asshattery, hooking onto timers to still get jerky slow amateurish animations to do the job of 6 to 8k of scripting and 2k of CSS.

    But somehow that writing more code and having some extra massive library to learn on top of it is "easier" -- RIGHT.

    Of course the real issue with jQuery is it teaches sloppy habits and advocates methodologies the ECMA spent the entire past decade (2000 to 2010) telling us to STOP ****ING DOING!!! Things like blindly posting markup into strings document.write or innerHTML style instead of using the DOM properly, things like putting scripting only elements in the markup instead of generating them in the script, things like repeatedly calling a querySelector-style method that's slow and sucks on cpu power instead of calling it once and storing the result in an isolated scope.

    Even just simple nonsense like wasting time hooking onload when all that's being done is markup/DOM manipulation, in which case instead of wasting time on loading handlers just load the script right before </body> -- it will be faster there ANYWAYS.

    But to be fair, I'm the whackjob who thinks <script> should be made invalid in BODY and HEAD and be moved after both as a sibling to them, that document.write should be removed from the spec altogether and removed from even being supported over the next decade or so, and that the onevent attributes should be removed from the HTML specification as they have ZERO malfing business in the markup to begin with. Much akin to how I think <style> should be stricken from the HTML specification as well, with style="" having it's role and usage strictly defined to the two or three legitimate corner case usage scenarios where style may be used to convey data (like the width of a percentage bar, height on a graph, or size in a tag cloud).

    That's why right now why I say if you use onevent attributes or have <script> anywhere but right before the </body> tag after ALL other BODY DOM elements, you're doing it all wrong and have bloated halfwit garbage markup!

    I've got the time if you want some pointers, but beware I'm currently dealing with a number of health issues that's why over the past decade I've weaned most of my clients off support. Right now I have great difficulty with things like deadlines or even normal hours as I have non-24 sleep wake disorder -- big fancy way of saying if I don't maintain a 26 hour day, I start to get the equivalent of jet lag and long term I start to have the same symptomology of sleep deprivation... which if you research has far, FAR nastier implications than you'd think. Mix in a Parkinsonism from some quack giving me the wrong meds, and a host of other maladies and I'm REALLY on doctors orders not to work.

    Orders I often have trouble with since I have great difficulty sitting around with my thumb wedged up my backside... hence why I keep a hand in and help out people where I can.

    ... and it seems like you are someone ACTUALLY asking for help, as opposed to what I normally see with people saying "help" when what they really want is a pat on the back and re-assurance that everything is fine -- or worse, silver bullet fixes for deep rooted problems that end up more akin to trying to treat a gunshot wound with a package of band-aids.

    There are times I really miss doing this stuff full time, and times where the current direction of things leaves me so infuriated I'm really glad I'm not... what with idiocy like bootcrap, jQuery and even HTML 5 undoing a decade and a half of progress and dragging everything back to the worst of pre-STRICT 1990's methodologies... and with the artsy-fartsy types who probably liked Clippy pissing all over things with the same type of garbage.
     
    Last edited: Nov 5, 2015
    deathshadow, Nov 5, 2015 IP