Improve page load time and increase server capacity by doing simple DNS and server changes

Problem:

One of the sites I maintain has been getting more and more traffic everyday. A very good thing for the site, not so good for the solo server which is serving those pages. The site is VERY dynamic with LAMP setup. We only have one server serving our web pages to our users. Since its a dynamic site with PHP and MySQL, it has a lot of load during peak times. Average load time of a page is between 1-2 secs during normal usage, 2-5 secs under average to heavy load.

During heavy load, we started to see our mysql stop responding to requests which is a big concern for us since we don’t show content if there is no db connection. We had to come with a solution, fast, to prevent this issue from appearing.

Solution:

So here are couple things I ended up doing on the server side to reduce load on this server without having to do much code change.

  • We have couple other servers at the same location for doing other tasks. So I decided to use one of those servers to offload some of the http processing. I setup our dns to point js.domain.com and css.domain.com to go to this spare server which reduced load on our main server quite a bit. We have a lot of js and css content which is loaded every time user hits a page. Our development team took care of the including the domain in the part where it loads js/css on the page. Another benefit of doing this was to allow users’ browsers to simultaneously download from two servers at a time which in turn equates to load time decrease. Browsers only do certain # of connection per server and wait until those requests are completed before making another request. I believe both FF and IE have limit of 2 per domain.
  • Second thing I did was to turn on compression at Apache level to decrease the amount of traffic sent to users. As long as users browsers support compression, apache would server compressed content. Doing this more than halved our bandwidth usage. We went from doing about 20-25 gigs/day to about 11-13 gigs.

As of now our load has been low even during high traffic times. Our bandwidth usage is low and going up with traffic as expected. Users have to wait 1-2 secs during high traffic times compared to 2-5 secs before tweaking. And during normal usage, we barely see 2 sec page load time instead its mostly only 1 sec. As of writing of this blog, we currently have 12781 users on-line with 90 sql queries per sec on average.

21 thoughts on “Improve page load time and increase server capacity by doing simple DNS and server changes

  1. Karl

    It ‘called one of the best photo editing software.
    Rich in effects and customization with amazing lighting effects that allow you to make your photos beautiful masterpieces.
    Thousands of people satisfied, now for you is under discount.
    Take advantage of it, use IMAGIC PHOTO! info and buy–> http://9nl.co/ImagePhoto

  2. Read More

    As of now, the plan for the WWE Fastlane main event is for Roman Reigns to win and go on to Wrestlemania 32 to face Triple H for the WWE World Heavyweight Championship. Reigns is probably going to get booed the most out of the three WWE Fastlane main event participants, which is interesting considering how WWE is trying to build him up. If he wins, he will face HHH, who would likely get cheered by the fans partly because he is in charge of NXT.

  3. bape hoodie

    I’m also writing to make you know what a beneficial encounter my princess experienced viewing yuor web blog. She came to find such a lot of details, most notably what it is like to have an ideal helping style to let men and women really easily know just exactly a variety of extremely tough things. You really exceeded visitors’ expectations. Thanks for presenting such precious, dependable, revealing and even unique guidance on that topic to Mary.

  4. chrome hearts

    I and my pals have already been checking the nice secrets located on your site and then the sudden I got a terrible feeling I had not thanked the website owner for those tips. Most of the men appeared to be totally passionate to read through them and have now sincerely been loving these things. Appreciation for genuinely really helpful and then for settling on varieties of essential subject matter millions of individuals are really needing to know about. My very own honest apologies for not expressing gratitude to you earlier.

  5. chrome hearts

    I together with my guys have already been looking through the best pointers from the website then all of the sudden got a terrible feeling I had not expressed respect to the blog owner for them. These ladies were definitely for this reason glad to study them and have in reality been using them. Many thanks for genuinely well kind and also for deciding upon this form of exceptional resources most people are really eager to understand about. Our honest apologies for not expressing appreciation to you sooner.

  6. stephen curry 5

    Thank you so much for providing individuals with an exceptionally terrific chance to check tips from this site. It really is very excellent and also packed with a good time for me and my office acquaintances to search your web site a minimum of three times every week to read through the fresh tips you will have. Of course, I’m so usually satisfied concerning the splendid pointers served by you. Certain 2 facts in this article are without a doubt the most impressive we’ve had.

  7. lebron 15

    Thanks a lot for providing individuals with an extraordinarily splendid possiblity to read critical reviews from this website. It’s always very excellent and also packed with a good time for me personally and my office acquaintances to visit your website no less than three times a week to read the new things you will have. And definitely, I’m just always amazed with your astounding tactics served by you. Some 3 ideas on this page are rather the most beneficial we’ve had.

  8. moncler

    Thank you a lot for giving everyone a very remarkable chance to check tips from this site. It can be very good plus stuffed with a great time for me personally and my office friends to visit your site at the least 3 times per week to read through the latest stuff you have. Of course, I’m just at all times pleased considering the cool strategies served by you. Some 3 areas in this article are really the simplest I have ever had.

  9. links of london

    I simply had to thank you very much once again. I do not know the things that I would’ve worked on without those opinions contributed by you on this problem. It seemed to be a very difficult case in my view, but noticing a new well-written approach you managed the issue forced me to jump with fulfillment. I will be grateful for your assistance and even trust you comprehend what an amazing job your are carrying out training the rest through the use of your web site. I know that you haven’t got to know all of us.

  10. Pingback: ?????

  11. https://Uljin-massage.blogspot.com

    Please let me know if you’re looking for a writer for your blog.
    You have some really good posts and I believe I would be a good asset.
    If you ever want to take some of the load off, I’d absolutely love to write some articles for
    your blog in exchange for a link back to mine. Please send me an email if interested.
    Many thanks!

  12. https://Hans-tomcat.blogspot.com

    What i do not understood is in fact how you’re
    not actually much more smartly-liked than you might
    be right now. You’re so intelligent. You realize therefore significantly on the subject of
    this topic, made me in my view consider it from a lot of varied angles.

    Its like men and women are not involved until it’s something
    to do with Woman gaga! Your personal stuffs nice. Always take care
    of it up!

  13. https://sunchang-krmassage3.blogspot.com

    I’m impressed, I have to admit. Rarely do I come across a blog that’s both
    equally educative and amusing, and let me tell you,
    you’ve hit the nail on the head. The issue is something which not enough folks are speaking intelligently about.
    Now i’m very happy that I came across this in my
    hunt for something concerning this.

  14. ?? ??? ???

    Hey very nice blog!! Guy .. Beautiful .. Wonderful .. I will bookmark your blog
    and take the feeds additionally? I am glad to find numerous helpful information here within the publish, we need develop more strategies on this regard, thank you
    for sharing. . . . . .

  15. ?????

    Definitely imagine that which you said. Your favourite justification seemed to be
    at the web the easiest thing to take into accout of. I say to you,
    I certainly get annoyed while people consider concerns that they just don’t recognize about.
    You controlled to hit the nail upon the top and also outlined out the entire thing
    with no need side effect , other folks can take a signal. Will
    likely be back to get more. Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *